/* Link Realty Portal — design system (igual à apresentação de vendas e ao funil auction.linkrealty.consulting)
 * Layout: topo escuro fixo; listas/painéis em verde-escuro profundo; telas de preenchimento longo em faixa clara.
 * Componentes usam as variáveis de contexto --c-*: o mesmo componente funciona no escuro e dentro de .on-light. */
:root {
  --bg: #02231C;
  --bg-deep: #04170F;
  --bg-light: #F4F7F5;
  --card: #04170F;
  --card-light: #FFFFFF;
  --fg: #FFFFFF;
  --fg-dark: #02231C;
  --muted: #B9C8C2;
  --muted-dark: #4E6660;
  --line: rgba(255, 255, 255, .10);
  --line-light: #DDE5E1;
  --mint: #3FD08F;
  --green: #1E8A5A;
  --mint-soft: rgba(63, 208, 143, .14);
  --danger: #C0392B;
  --warning: #E0A82E;
  --display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* contexto escuro (padrão) */
  --c-bg: var(--bg);
  --c-fg: var(--fg);
  --c-muted: var(--muted);
  --c-line: var(--line);
  --c-line-strong: rgba(255, 255, 255, .18);
  --c-card: var(--card);
  --c-accent: var(--mint);
  --c-input: rgba(255, 255, 255, .04);
  --c-input-line: rgba(255, 255, 255, .18);
  --c-hover: rgba(255, 255, 255, .06);
  --c-seg: rgba(255, 255, 255, .05);
  --c-danger-ink: #FF8F80;
  --c-warning-ink: #F2C55C;
  --c-danger-soft: rgba(192, 57, 43, .16);
  --c-warning-soft: rgba(224, 168, 46, .14);
  --c-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-md: 14px;
  color-scheme: dark;
}

.on-light {
  --c-bg: var(--bg-light);
  --c-fg: var(--fg-dark);
  --c-muted: var(--muted-dark);
  --c-line: var(--line-light);
  --c-line-strong: #C4D3CC;
  --c-card: var(--card-light);
  --c-accent: var(--green);
  --c-input: #FFFFFF;
  --c-input-line: #C4D3CC;
  --c-hover: rgba(2, 35, 28, .05);
  --c-seg: rgba(2, 35, 28, .06);
  --c-danger-ink: #A93226;
  --c-warning-ink: #8A6100;
  --c-danger-soft: rgba(192, 57, 43, .09);
  --c-warning-soft: rgba(224, 168, 46, .16);
  --c-shadow: 0 18px 50px rgba(2, 35, 28, .16);
  color-scheme: light;
  color: var(--c-fg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--c-accent); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
.on-light :focus-visible { outline-color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.page { padding-block: 28px 64px; flex: 1; }
.band-light { background: var(--bg-light); color: var(--fg-dark); padding-block: 28px 64px; flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 28px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .gauto { grid-template-columns: 1fr; } }
.divider { height: 1px; background: var(--c-line); border: 0; margin: 4px 0; }

/* ---------- tipografia ---------- */
.h1 { font-size: clamp(34px, 5.4vw, 56px); font-weight: 700; }
.h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; }
.h3 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 700; }
.h4 { font-size: 19px; font-weight: 700; }
.lead { font-size: clamp(17px, 1.5vw, 19px); color: var(--c-muted); max-width: 62ch; }
.muted { color: var(--c-muted); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }
.strong { font-weight: 800; }
.mono-num, .num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--display); }
.accent { color: var(--c-accent); }
.ink-danger { color: var(--c-danger-ink); }
.ink-warning { color: var(--c-warning-ink); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-accent);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.label {
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted);
}

/* ---------- topo ---------- */
.topwrap { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; }
.topbar {
  position: relative;
  background: rgba(2, 35, 28, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 68px; flex-wrap: wrap; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.logo img { height: 28px; width: auto; }
.logo:hover { text-decoration: none; }
.logo-text { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.logo-text b { color: var(--mint); }
.nav { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button {
  border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 15px;
  padding: 10px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.nav button:hover { color: var(--fg); background: rgba(255, 255, 255, .06); }
.nav button.on { color: var(--fg-dark); background: var(--mint); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint-soft); color: var(--mint); font-weight: 800; font-size: 14px; flex: none;
  border: 1px solid rgba(63, 208, 143, .35);
}
@media (max-width: 760px) {
  /* no celular o menu quebra em duas linhas: nada fica escondido fora da tela */
  .nav { order: 3; flex-basis: 100%; flex-wrap: wrap; overflow: visible; }
  .nav button { padding: 9px 12px; font-size: 15px; }
  .user-chip .who { display: none; }
}
.viewas {
  background: var(--warning); color: var(--fg-dark); font-weight: 800; font-size: 15px;
}
.viewas .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
.viewas button { background: var(--fg-dark); color: #fff; border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 800; cursor: pointer; }
.demo-note {
  font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-block: 14px 24px; margin-top: auto;
}

/* ---------- cards ---------- */
.card {
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 22px; min-width: 0;
}
.card.pad-lg { padding: 28px; }
.card.pad-sm { padding: 16px; }
.card.flat { background: transparent; }
.card.accent-border { border-color: rgba(63, 208, 143, .45); }
.card.danger-border { border-color: rgba(192, 57, 43, .6); }
.card.warning-border { border-color: rgba(224, 168, 46, .6); }
.card.click { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.click:hover { border-color: rgba(63, 208, 143, .45); }
.highlight {
  border-radius: var(--radius); padding: 22px;
  background: linear-gradient(135deg, rgba(63, 208, 143, .2), rgba(63, 208, 143, .04));
  border: 1px solid rgba(63, 208, 143, .4);
}
.on-light .highlight { background: linear-gradient(135deg, rgba(30, 138, 90, .12), rgba(30, 138, 90, .03)); border-color: rgba(30, 138, 90, .35); }
.ic {
  width: 40px; height: 40px; border-radius: 11px; background: var(--mint-soft); color: var(--c-accent);
  display: grid; place-items: center; flex: none;
}
.on-light .ic { background: rgba(30, 138, 90, .1); }
.ic.danger { background: var(--c-danger-soft); color: var(--c-danger-ink); }
.ic.warning { background: var(--c-warning-soft); color: var(--c-warning-ink); }

/* ---------- stats ---------- */
.stat { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.2vw, 40px); line-height: 1; color: var(--c-accent); font-variant-numeric: tabular-nums; }
.stat.xl { font-size: clamp(40px, 6vw, 64px); }
.stat.md { font-size: 26px; }
.stat.sm { font-size: 21px; }
.stat.plain { color: var(--c-fg); }
.stat.danger { color: var(--c-danger-ink); }
.stat.warning { color: var(--c-warning-ink); }
.stat-label { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 8px; }
.stat-sub { font-size: 15px; color: var(--c-muted); margin-top: 6px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--mint); color: var(--fg-dark); font-weight: 800; font-size: 16px; line-height: 1.2;
  padding: 14px 22px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  box-shadow: 0 0 0 6px rgba(63, 208, 143, .12); transition: filter .15s, background .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.lg { padding: 17px 28px; font-size: 17px; }
.btn.sm { padding: 9px 14px; font-size: 15px; box-shadow: none; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--c-fg); border-color: var(--c-line-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--c-hover); }
.btn.subtle { background: var(--c-hover); color: var(--c-fg); box-shadow: none; }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 0 0 6px rgba(192, 57, 43, .14); }
.btn.danger-ghost { background: transparent; color: var(--c-danger-ink); border-color: rgba(192, 57, 43, .55); box-shadow: none; }
.btn.warning { background: var(--warning); color: var(--fg-dark); box-shadow: 0 0 0 6px rgba(224, 168, 46, .14); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.sm svg { width: 18px; height: 18px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--c-line-strong); background: transparent; color: var(--c-fg); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--c-hover); }
.icon-btn svg { width: 20px; height: 20px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--c-accent); font-weight: 800; cursor: pointer; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { text-decoration: underline; }
.link-btn svg { width: 16px; height: 16px; }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(63, 208, 143, .4); background: var(--mint-soft); color: var(--c-accent);
  font-size: 15px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; line-height: 1.2;
}
.pill svg { width: 15px; height: 15px; flex: none; }
.pill.danger { border-color: rgba(192, 57, 43, .55); background: var(--c-danger-soft); color: var(--c-danger-ink); }
.pill.warning { border-color: rgba(224, 168, 46, .6); background: var(--c-warning-soft); color: var(--c-warning-ink); }
.pill.neutral { border-color: var(--c-line-strong); background: transparent; color: var(--c-muted); }
.pill.solid { background: var(--mint); color: var(--fg-dark); border-color: var(--mint); }
.pill.lg { font-size: 15px; padding: 8px 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- semáforo ---------- */
.light { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; background: var(--c-line-strong); }
.light.md { width: 22px; height: 22px; }
.light.lg { width: 44px; height: 44px; }
.light.xl { width: 64px; height: 64px; }
.light.Verde { background: var(--mint); box-shadow: 0 0 0 5px rgba(63, 208, 143, .18); }
.light.Amarelo { background: var(--warning); box-shadow: 0 0 0 5px rgba(224, 168, 46, .2); }
.light.Vermelho { background: var(--danger); box-shadow: 0 0 0 5px rgba(192, 57, 43, .22); }
.light.sm.Verde, .light.sm.Amarelo, .light.sm.Vermelho { box-shadow: none; }
.lights3 { display: inline-flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 700; }
.lights3 span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-head { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.field-label { font-size: 15px; font-weight: 800; color: var(--c-fg); }
.field-label .req { color: var(--c-danger-ink); margin-left: 2px; }
.field-hint { font-size: 15px; color: var(--c-muted); }
.field-hint.ok { color: var(--c-accent); font-weight: 700; }
.field-hint.err { color: var(--c-danger-ink); font-weight: 700; }
.input, .select, .textarea {
  width: 100%; min-width: 0; border: 1px solid var(--c-input-line); background: var(--c-input); color: var(--c-fg);
  border-radius: var(--radius-md); padding: 13px 14px; font-size: 17px; font-weight: 600; line-height: 1.3;
}
.input::placeholder, .textarea::placeholder { color: var(--c-muted); opacity: .7; font-weight: 500; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--c-accent); outline-offset: 1px; border-color: transparent; }
.input.locked { background: var(--c-seg); border-style: dashed; color: var(--c-muted); }
.textarea { resize: vertical; min-height: 84px; font-weight: 500; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 22px) 55%, calc(100% - 16px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.input-wrap .input { padding-right: 14px; }
.input-wrap:has(.open-link) .input, .input-wrap:has(.suffix) .input { padding-right: 96px; }
.input-wrap .suffix { position: absolute; right: 14px; font-size: 14px; font-weight: 800; color: var(--c-muted); pointer-events: none; }
.input-wrap .open-link { position: absolute; right: 8px; }
.money {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--c-input-line); border-radius: var(--radius-md);
  padding: 4px 14px; background: var(--c-input); min-width: 0;
}
.money:focus-within { outline: 2px solid var(--c-accent); outline-offset: 1px; border-color: transparent; }
.money .cur { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--c-accent); }
.money input {
  flex: 1 1 0; width: 0; min-width: 0; border: 0; background: transparent; color: var(--c-fg);
  font-family: var(--display); font-weight: 700; font-size: 22px; padding: 9px 0; font-variant-numeric: tabular-nums;
}
.money input:focus { outline: none; }
.money input::placeholder { color: var(--c-muted); opacity: .45; }
.money.big { padding: 6px 16px; }
.money.big .cur { font-size: 24px; }
.money.big input { font-size: clamp(26px, 3vw, 36px); }
.money.compact { padding: 2px 10px; border-radius: 10px; }
.money.compact .cur { font-size: 16px; }
.money.compact input { font-size: 17px; padding: 7px 0; }
.money .unit { font-size: 14px; font-weight: 800; color: var(--c-muted); white-space: nowrap; }
.money.locked { background: var(--c-seg); border-style: dashed; }
.reset-link { font-size: 13px; }

/* segmented (Sim/Não, Inferior/Padrão/Superior...) */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px;
  background: var(--c-seg); padding: 6px; border-radius: var(--radius-sm); border: 1px solid var(--c-line);
}
.seg button {
  border: 0; background: transparent; color: var(--c-muted); font-weight: 800; font-size: 16px;
  padding: 12px 10px; border-radius: 9px; cursor: pointer; min-height: 48px; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.seg button:hover { background: var(--c-hover); color: var(--c-fg); }
.seg button.on { background: var(--mint); color: var(--fg-dark); }
.seg button.on.danger { background: var(--danger); color: #fff; }
.seg button.on.warning { background: var(--warning); color: var(--fg-dark); }
.seg.sm button { min-height: 40px; padding: 8px; font-size: 15px; }
@media (max-width: 520px) { .seg.wrap-mobile { grid-auto-flow: row; } }

/* ajuda contextual "?" */
.help { position: relative; display: inline-flex; }
/* dentro do rótulo de um campo, o balão ocupa a largura do campo */
.field-head { position: relative; }
.field-head .help { position: static; }
.help-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--c-line-strong); background: transparent;
  color: var(--c-accent); font-weight: 800; font-size: 15px; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.help-btn:hover, .help-btn[aria-expanded="true"] { background: var(--c-accent); color: var(--c-card); border-color: var(--c-accent); }
.popover {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 40; width: min(360px, calc(100vw - 32px));
  background: var(--bg-deep); color: var(--fg); border: 1px solid rgba(63, 208, 143, .4); border-radius: 14px;
  padding: 16px; font-size: 15px; line-height: 1.5; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); font-weight: 500;
}
.popover.right { left: auto; right: 0; }
@media (max-width: 620px) {
  .help .popover { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; z-index: 75; max-height: 60vh; overflow-y: auto; }
}
.popover b { color: var(--mint); }
.popover a { color: var(--mint); display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; }
.popover a svg { width: 16px; height: 16px; }

/* ---------- abas ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--c-line); }
.tabs button {
  border: 0; background: transparent; color: var(--c-muted); font-weight: 800; font-size: 16px;
  padding: 12px 16px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 8px;
}
.tabs button:hover { color: var(--c-fg); }
.tabs button.on { color: var(--c-fg); border-bottom-color: var(--c-accent); }
.tabs .count { font-size: 13px; background: var(--c-hover); color: var(--c-fg); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.tabs button.on .count { background: var(--mint); color: var(--fg-dark); }

/* etapas da propriedade */
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stage {
  border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 16px; padding: 14px 16px;
  text-align: left; cursor: pointer; display: flex; gap: 12px; align-items: center; min-width: 0;
}
.stage:hover { border-color: rgba(63, 208, 143, .4); }
.stage .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; background: rgba(255, 255, 255, .08); color: var(--muted); font-size: 15px; }
.stage .n svg { width: 18px; height: 18px; }
.stage .t { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.1; }
.stage .s { font-size: 15px; color: var(--muted); margin-top: 3px; }
.stage.done .n { background: var(--mint); color: var(--fg-dark); }
.stage.on { border-color: var(--mint); background: var(--mint-soft); }
.stage.locked { opacity: .55; cursor: not-allowed; }
.stage.locked:hover { border-color: var(--line); }
@media (max-width: 640px) {
  .stages { grid-template-columns: 1fr; }
}
.stepline { display: inline-flex; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 700; color: var(--c-muted); }
.stepline span { display: inline-flex; align-items: center; gap: 5px; }
.stepline .ok { color: var(--c-accent); }
.stepline svg { width: 15px; height: 15px; }

/* ---------- alertas ---------- */
.alert {
  display: flex; gap: 14px; align-items: flex-start; border-radius: 16px; padding: 16px 18px;
  border: 1px solid rgba(63, 208, 143, .4); background: var(--mint-soft); color: var(--c-fg); min-width: 0;
}
.alert > svg { width: 24px; height: 24px; flex: none; color: var(--c-accent); margin-top: 1px; }
.alert .a-title { font-weight: 800; font-size: 17px; }
.alert .a-body { font-size: 15px; color: var(--c-fg); opacity: .9; margin-top: 2px; }
.alert.danger { border-color: rgba(192, 57, 43, .6); background: var(--c-danger-soft); }
.alert.danger > svg { color: var(--c-danger-ink); }
.alert.danger .a-title { color: var(--c-danger-ink); }
.alert.warning { border-color: rgba(224, 168, 46, .6); background: var(--c-warning-soft); }
.alert.warning > svg { color: var(--c-warning-ink); }
.alert.warning .a-title { color: var(--c-warning-ink); }
.alert.info { border-color: var(--c-line-strong); background: var(--c-hover); }
.alert.info > svg { color: var(--c-muted); }
.alert.big { padding: 20px 22px; }
.alert.big .a-title { font-size: 20px; font-family: var(--display); }

/* ---------- menu "…" ---------- */
.menu { position: relative; display: inline-flex; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; min-width: 260px;
  background: var(--bg-deep); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.menu-list button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; border: 0;
  color: var(--fg); font-weight: 700; font-size: 16px; padding: 12px 14px; border-radius: 10px; cursor: pointer;
}
.menu-list button:hover { background: rgba(255, 255, 255, .07); }
.menu-list button:disabled { opacity: .4; cursor: not-allowed; }
.menu-list button.danger { color: #FF8F80; }
.menu-list svg { width: 19px; height: 19px; color: var(--mint); flex: none; }
.menu-list button.danger svg { color: #FF8F80; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(2, 15, 11, .72); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; overflow-y: auto;
}
.modal {
  width: min(560px, 100%); background: var(--bg-light); color: var(--fg-dark); border-radius: 20px; padding: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.modal-title { font-family: var(--display); font-size: 24px; font-weight: 700; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
@media (max-width: 520px) {
  .modal-foot .btn { flex: 1 1 100%; }
  /* no celular o botão principal do diálogo fica sempre visível */
  .modal { padding: 20px 18px 0; }
  .modal-foot { position: sticky; bottom: 0; background: var(--bg-light); margin-inline: -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-light); z-index: 2; }
}

/* ---------- toast / salvando ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 80; display: grid; gap: 8px; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--bg-deep); color: var(--fg); border: 1px solid rgba(63, 208, 143, .5); border-radius: 14px; padding: 14px 16px; font-weight: 700; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); display: flex; gap: 10px; align-items: center; }
.toast svg { width: 20px; height: 20px; color: var(--mint); flex: none; }
.toast.danger { border-color: rgba(192, 57, 43, .7); }
.toast.danger svg { color: #FF8F80; }
.save-ind { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.save-ind.saved { color: var(--mint); }
.save-ind svg { width: 16px; height: 16px; }
/* portal de produção sem conexão: "Sem conexão: vamos tentar de novo" (clicar tenta agora); no celular, só "Sem conexão" */
.save-ind.err { color: var(--c-warning-ink); background: var(--c-warning-soft); border: 1px solid rgba(224, 168, 46, .45); border-radius: 10px;
  padding: 6px 10px; font-family: inherit; cursor: pointer; }
.save-ind.err:hover { border-color: var(--warning); }
.save-ind .save-short { display: none; }
@media (max-width: 760px) { .save-ind .save-long { display: none; } .save-ind .save-short { display: inline; } }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); padding: 12px 14px; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.r, .table th.r { text-align: right; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--c-hover); }

/* ---------- estado vazio ---------- */
.empty-state { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state .ic { width: 56px; height: 56px; border-radius: 16px; }
.empty-state .ic svg { width: 28px; height: 28px; }
.empty-state p { color: var(--c-muted); max-width: 46ch; }

/* ---------- utilidades ---------- */
.hide-mobile { }
@media (max-width: 620px) { .hide-mobile { display: none !important; } }
.only-mobile { display: none !important; }
@media (max-width: 620px) { .only-mobile { display: initial !important; } }
.nowrap { white-space: nowrap; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.break { overflow-wrap: anywhere; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.center { text-align: center; }
.ext-link { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.ext-link svg { width: 16px; height: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--c-muted); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }

/* painel escuro dentro de uma faixa clara (.on-light) */
.on-dark {
  --c-fg: var(--fg);
  --c-muted: var(--muted);
  --c-line: var(--line);
  --c-line-strong: rgba(255, 255, 255, .18);
  --c-card: var(--card);
  --c-accent: var(--mint);
  --c-input: rgba(255, 255, 255, .04);
  --c-input-line: rgba(255, 255, 255, .18);
  --c-hover: rgba(255, 255, 255, .06);
  --c-seg: rgba(255, 255, 255, .05);
  --c-danger-ink: #FF8F80;
  --c-warning-ink: #F2C55C;
  --c-danger-soft: rgba(192, 57, 43, .16);
  --c-warning-soft: rgba(224, 168, 46, .14);
  color-scheme: dark;
  color: var(--c-fg);
}

/* ---------- celular: alvos de toque, topo e avisos (revisão mobile) ---------- */
.help-btn { position: relative; }
.help-btn::before { content: ""; position: absolute; inset: -7px; } /* área de toque de 44px, círculo continua pequeno */
.link-btn, .ext-link { padding-block: 9px; margin-block: -9px; }
.money.compact input { padding: 10px 0; }
.stepline, .tabs .count, .money .unit, .save-ind { font-size: 15px; }
.toasts { pointer-events: none; }
.popover-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .08); color: var(--fg); display: grid; place-items: center; cursor: pointer; }
.popover-close svg { width: 18px; height: 18px; }
.popover { padding-right: 52px; }
@media (max-width: 760px) {
  /* no celular o topo não fica fixo: sobra espaço para os campos */
  .topwrap { position: static; }
  .nav button { min-height: 44px; }
  .viewas { font-size: 15px; }
  .viewas .wrap { padding-block: 8px; }
}
@media (max-width: 620px) {
  .toasts { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; }
}

/* listas suspensas legíveis no fundo escuro (antes a lista aberta ficava clara com texto claro) */
.select { background-color: #0A2C23; color: var(--fg); }
.select option, .select optgroup { background-color: #04170F; color: #FFFFFF; }
.on-light .select { background-color: #FFFFFF; color: var(--fg-dark); }
.on-light .select option, .on-light .select optgroup { background-color: #FFFFFF; color: #02231C; }
.on-dark .select { background-color: #0A2C23; color: var(--fg); }
.on-dark .select option { background-color: #04170F; color: #FFFFFF; }
.select:disabled { opacity: .6; }

/* topo do cliente em telas médias: com 5 itens no menu + conversa + sino, o nome sai e fica só o avatar */
@media (max-width: 1360px) { .user-chip .who { display: none; } }
@media (min-width: 761px) and (max-width: 1360px) {
  .topbar-in { gap: 12px; }
  .nav { gap: 2px; }
  .nav button { padding: 10px 10px; }
  .logo img { height: 24px; }
}
/* menu do cliente com 6 itens (.topbar-in.many, desde "Oportunidades"): no computador "Todas as propriedades" e
   "Guia de condados" ficam em duas linhas (o nome inteiro continua: "Todas" e "Guia" sozinhos não dizem nada) e o nome
   da pessoa sai (fica o avatar). Por extenso numa linha só, o topo não cabe em nenhuma largura (.wrap tem 1180 px). */
.nav .nav-2l { display: none; }
@media (min-width: 761px) {
  .topbar-in.many { gap: 12px; }
  .topbar-in.many .nav { gap: 2px; }
  .topbar-in.many .nav button { padding: 6px 10px; }
  .topbar-in.many .nav .nav-long { display: none; }
  .topbar-in.many .nav .nav-2l { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.12; text-align: left; }
  .topbar-in.many .user-chip .who { display: none; }
  .topbar-in.many .logo img { height: 24px; }
}
