/* ============================================================
   VALIDA CORBAN — Identity Layer  v2026070601
   Última camada de CSS. Visual claro premium: papel-quente,
   IBM Plex Sans + IBM Plex Mono (números), azul #1e50a2 na
   marca, verde reservado a dinheiro, sidebar navy fixa.
   Preserva 100% dos ids/funções do app (só re-skin).
   ============================================================ */

/* ── 1 · TOKENS (claro = padrão) ────────────────────────────── */
:root {
  --bg:            #f7f6f3;
  --bg-subtle:     #f7f6f3;
  --panel:         #ffffff;
  --panel-bg:      #ffffff;
  --surface-0:     #ffffff;
  --surface-1:     #faf9f6;
  --surface-2:     #f2f0ea;
  --input-bg:      #faf9f6;
  --row-bg:        #faf9f6;
  --border:        #e8e6e1;
  --border-hover:  #d9d7d0;
  --border-strong: #dcdad3;
  --text:          #1f2430;
  --text-2:        #4a5060;
  --text-secondary:#4a5060;
  --text-tertiary: #5c6270;
  --text-muted:    #8a909c;
  --muted:         #4a5060;
  --accent:        #1e50a2;
  --accent-hover:  #16407f;
  --accent-2:      #1e50a2;
  --accent-dim:    #eef3fa;
  --accent-line:   #d5e2f5;
  --accent-glow:   0 0 0 3px rgba(30,80,162,0.15);
  --accent-rgb:    30, 80, 162;
  --money:         #178f57;
  --money-deep:    #137347;
  --money-dim:     #eaf5ee;
  --money-line:    #cdebd8;
  --gold:          #b8790a;
  --gold-deep:     #9a6b3f;
  --gold-soft:     #f9efd9;
  --danger:        #c94a44;
  --danger-soft:   #fae9e8;
  --warning:       #b8790a;
  --info:          #1e50a2;
  --success:       #178f57;
  --orange:        #b8790a;
  --shadow-sm:     0 1px 2px rgba(31,36,48,0.04);
  --shadow-md:     0 2px 10px rgba(31,36,48,0.06);
  --shadow-lg:     0 12px 40px rgba(31,36,48,0.10);
  --r-sm: 9px; --r-md: 11px; --r-lg: 14px; --r-pill: 999px;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "IBM Plex Sans", "Inter", system-ui, sans-serif;
  --side: #0f1b2e;
}

html[data-theme="dark"] {
  --bg:            #0e1420;
  --bg-subtle:     #0e1420;
  --panel:         #161d2b;
  --panel-bg:      #161d2b;
  --surface-0:     #161d2b;
  --surface-1:     #1b2433;
  --surface-2:     #222c3d;
  --input-bg:      #1b2433;
  --row-bg:        #182030;
  --border:        #26303f;
  --border-hover:  #33404f;
  --border-strong: #33404f;
  --text:          #eef2f7;
  --text-2:        #c2c9d6;
  --text-secondary:#c2c9d6;
  --text-tertiary: #a3abbb;
  --text-muted:    #9aa2b2;
  --muted:         #c2c9d6;
  --accent:        #5b8def;
  --accent-hover:  #77a0f2;
  --accent-2:      #5b8def;
  --accent-dim:    rgba(91,141,239,0.14);
  --accent-line:   rgba(91,141,239,0.30);
  --accent-glow:   0 0 0 3px rgba(91,141,239,0.18);
  --accent-rgb:    91, 141, 239;
  --money:         #3ecf8e;
  --money-deep:    #3ecf8e;
  --money-dim:     rgba(62,207,142,0.12);
  --money-line:    rgba(62,207,142,0.30);
  --gold:          #e8b84b;
  --gold-deep:     #e8b84b;
  --gold-soft:     rgba(232,184,75,0.14);
  --danger:        #ef6b64;
  --danger-soft:   rgba(239,107,100,0.14);
  --warning:       #e8b84b;
  --success:       #3ecf8e;
  --shadow-sm:     none;
  --shadow-md:     0 2px 10px rgba(0,0,0,0.35);
  --shadow-lg:     0 20px 50px rgba(0,0,0,0.5);
}

/* ── 2 · TIPOGRAFIA ─────────────────────────────────────────── */
body {
  font-family: var(--sans) !important;
  font-size: 14px;
  letter-spacing: 0 !important;
  -webkit-font-smoothing: antialiased;
  background-image: none !important;
  color: var(--text) !important;
}
h1, h2, h3, .main-header h1 { font-family: inherit !important; letter-spacing: -0.01em !important; }
.main-header h1 { font-size: 22px !important; font-weight: 700 !important; }
.main-header p { color: var(--text-muted) !important; font-size: 13px !important; }
/* Números em mono (assinatura Valida Corban) */
.tnum, .lote-counter span, .lote-table td.num, .lote-table td:nth-child(1),
.resumo-val, .rx-count, .dense td.num, .money, .money-hero, .money-large,
#simTroco, #cntTroco, #loteFiltroCount, #rx_count {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
}

/* ── 3 · CARDS / PANELS ─────────────────────────────────────── */
.panel, section.panel, div.panel {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-sm) !important;
}
.panel:hover { box-shadow: var(--shadow-sm) !important; transform: none !important; }
.panel > h2 {
  font-size: 15px !important; font-weight: 600 !important;
  letter-spacing: 0 !important; display: flex; align-items: center; gap: 9px;
  color: var(--text) !important;
}
.panel > h2 svg { color: var(--text-muted) !important; }
.screen-header h1 { font-size: 21px !important; font-weight: 700 !important; letter-spacing: -0.01em !important; }
.screen-sub { color: var(--text-muted) !important; font-size: 13px !important; }
.section-label, .sidebar-section-label, legend {
  font-family: var(--sans) !important;
  font-size: 11px !important; font-weight: 600 !important;
  letter-spacing: 0.05em !important; text-transform: uppercase !important;
  color: var(--text-muted) !important;
}

/* ── 4 · BOTÕES ─────────────────────────────────────────────── */
.btn, button.btn, label.btn {
  font-family: inherit !important; font-weight: 600 !important; font-size: 13px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--panel) !important; color: var(--text-2) !important;
  padding: 9px 16px !important;
  box-shadow: none !important;
  transition: all .13s ease !important;
}
.btn:hover { border-color: var(--border-hover) !important; background: var(--surface-1) !important; color: var(--text) !important; }
.btn:active { transform: translateY(1px); }
.btn-primary, button.btn-primary, .btn.btn-primary {
  background: var(--accent) !important; color: #fff !important; border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25) !important;
}
.btn-primary:hover, button.btn-primary:hover { background: var(--accent-hover) !important; }
.btn-ghost, button.btn-ghost, .btn.btn-ghost { background: transparent !important; border-color: transparent !important; color: var(--text-2) !important; }
.btn-ghost:hover, button.btn-ghost:hover { color: var(--text) !important; background: var(--surface-1) !important; }
.btn-danger, button.btn-danger, .btn.btn-danger { background: var(--danger-soft) !important; color: var(--danger) !important; border-color: transparent !important; }
.btn-danger:hover, button.btn-danger:hover { filter: brightness(0.98); }
.btn-sm, button.btn-sm { padding: 6px 12px !important; font-size: 12px !important; }

/* ── 5 · CAMPOS ─────────────────────────────────────────────── */
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
select, textarea {
  font-family: inherit !important; font-size: 13px !important;
  background: var(--input-bg) !important; color: var(--text) !important;
  border: 1px solid var(--border-strong) !important; border-radius: 10px !important;
  transition: border-color .13s, box-shadow .13s !important;
}
input:focus, select:focus, textarea:focus {
  outline: none !important; border-color: var(--accent) !important;
  box-shadow: var(--accent-glow) !important; background: var(--panel) !important;
}
label { font-weight: 600; color: var(--text-2); font-size: 12.5px; }
::placeholder { color: var(--text-muted); }

/* ── 6 · SIDEBAR (navy fixa nos dois temas) ─────────────────── */
.app-sidebar {
  background: var(--side) !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
}
.sidebar-brand { border-bottom: 1px solid rgba(255,255,255,0.07) !important; }
.sidebar-brand-logo {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
.sidebar-brand-logo svg { width: 24px !important; height: 24px !important; }
.sidebar-brand-name { font-weight: 700 !important; letter-spacing: 0.03em !important; color: #ffffff !important; font-size: 15px !important; }
.sidebar-brand-sub { color: #e8b84b !important; font-weight: 700 !important; letter-spacing: 0.18em !important; text-transform: uppercase !important; font-size: 10.5px !important; }
.sidebar-section-label { color: #617b9c !important; }
.sidebar-item {
  border-radius: 9px !important; font-weight: 500 !important; font-size: 13.5px !important;
  color: #9fb0c8 !important; position: relative; border: 0 !important;
  border-left: 2.5px solid transparent !important;
}
.sidebar-item .icon, .sidebar-item svg { color: currentColor !important; }
.sidebar-item:hover { background: rgba(255,255,255,0.05) !important; color: #ffffff !important; }
.sidebar-item.active {
  background: rgba(255,255,255,0.11) !important; color: #ffffff !important; font-weight: 600 !important;
  border-left: 2.5px solid #5b8def !important;
}
.sidebar-item.active::before { display: none !important; }
.sidebar-item.danger { color: #e58e88 !important; }
.sidebar-item.danger:hover { background: rgba(201,74,68,0.16) !important; color: #ffb3ad !important; }
.sidebar-user { border-top: 1px solid rgba(255,255,255,0.07) !important; }
.sidebar-user-name { color: #eaf0f7 !important; }
.sidebar-user-role { color: #8ba0bd !important; }
.sidebar-user-avatar { background: #1e50a2 !important; color: #fff !important; }

/* ── 7 · LOTE / KPIs / progresso ────────────────────────────── */
.nx-step {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 8px; background: var(--accent-dim); color: var(--accent);
  font-family: var(--mono); font-weight: 600; font-size: 12.5px; flex-shrink: 0;
}
.nx-adv { border: 1px solid var(--border); border-radius: var(--r-md); margin-top: 12px; }
.nx-adv > summary {
  cursor: pointer; user-select: none; padding: 10px 14px;
  font-weight: 600; font-size: 12.5px; color: var(--text-2);
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.nx-adv > summary::-webkit-details-marker { display: none; }
.nx-adv > summary::after { content: "▾"; margin-left: auto; color: var(--text-muted); transition: transform .2s; }
.nx-adv[open] > summary::after { transform: rotate(180deg); }
.nx-adv > .nx-adv-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.nx-adv .lote-config { margin-top: 10px; }

.lote-upload-area {
  border: 1.5px dashed var(--border-strong) !important; border-radius: var(--r-md) !important;
  background: var(--surface-1) !important; padding: 16px !important;
}
.lote-upload-area:hover, .lote-upload-area.drag-over { border-color: var(--accent) !important; background: var(--accent-dim) !important; }

.lote-bar-outer {
  height: 8px !important; border-radius: 999px !important;
  background: var(--surface-2) !important; overflow: hidden;
}
.lote-bar-fill {
  border-radius: 999px !important;
  background: var(--accent) !important;
  transition: width .5s cubic-bezier(.2,.8,.2,1) !important;
}

.lote-counters {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 12px !important; margin: 14px 0 !important;
}
.lote-counter {
  background: var(--panel) !important; border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important; box-shadow: none !important;
  padding: 14px 16px !important; display: flex !important; flex-direction: column-reverse !important;
  gap: 4px !important; align-items: flex-start !important;
}
.lote-counter span { font-size: 23px !important; font-weight: 600 !important; letter-spacing: -0.02em; line-height: 1.05; }
.lote-counter small {
  font-size: 12px !important; font-weight: 500 !important; letter-spacing: 0;
  text-transform: none; color: var(--text-muted) !important;
}
.lote-counter.found span { color: var(--money-deep) !important; }
.lote-counter.notfound span { color: var(--text-tertiary) !important; }
.lote-counter.err span { color: var(--danger) !important; }
.lote-counter.pending span { color: var(--accent) !important; }
.lote-counter.troco span { color: var(--gold) !important; }
html[data-theme="dark"] .lote-counter.troco span { color: #b48be6 !important; }

/* ── 8 · FILTRO INTELIGENTE ─────────────────────────────────── */
#loteFiltroInteligente {
  border: 1px solid var(--border) !important; border-radius: var(--r-lg) !important;
  background: var(--panel); overflow: hidden; margin: 14px 0;
}
#loteFiltroInteligente > summary {
  cursor: pointer; user-select: none; list-style: none;
  padding: 14px 18px; font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; gap: 9px; background: var(--surface-1); color: var(--text);
}
#loteFiltroInteligente > summary::-webkit-details-marker { display: none; }
#loteFiltroInteligente > summary::after { content: "▾"; margin-left: auto; color: var(--text-muted); transition: transform .2s; }
#loteFiltroInteligente[open] > summary::after { transform: rotate(180deg); }
#loteFiltroInteligente .nx-fi-body { padding: 14px 18px; border-top: 1px solid var(--border); }
#loteFiltroInteligente .nx-fi-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
#loteFiltroInteligente .nx-fi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; align-items: start; }
#loteFiltroInteligente fieldset {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; min-width: 0; background: var(--surface-1); margin: 0;
}
#loteFiltroInteligente .fi-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 7px 0; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
#loteFiltroInteligente .fi-row input[type=number] { width: 74px; padding: 6px 8px !important; font-size: 12.5px !important; }
#loteFiltroInteligente .fi-row input[type=text] { flex: 1; min-width: 90px; padding: 6px 8px !important; font-size: 12.5px !important; }
#loteFiltroInteligente .fi-row select { padding: 6px 8px !important; font-size: 12.5px !important; }
#loteFiltroInteligente #loteFiltroCount { font-weight: 600; color: var(--text-muted); font-size: 12.5px; }
#loteFiltroInteligente #loteFiltroCount.fi-zero { color: var(--danger) !important; }
/* Pastilhas do filtro: PORT (contrato para portar) e NOVO (margem livre).
   São irmãs do contador, não filhas: dentro dele herdariam a fonte mono da
   regra .tnum e "port"/"novo" sairiam com cara de número. */
#loteFiltroInteligente > summary > .lm-chip { font-size: 11px; font-weight: 600; }
#loteFiltroInteligente > summary > .lm-chip.fi-port b { color: var(--money-deep); }
#loteFiltroInteligente > summary > .lm-chip.fi-novo b { color: var(--accent); }

/* ── 9 · TABELAS ────────────────────────────────────────────── */
.lote-table-wrap { border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; }
.lote-table { border-collapse: collapse !important; }
.lote-table th {
  font-family: var(--sans) !important;
  font-size: 11px !important; font-weight: 600 !important; letter-spacing: 0.04em !important;
  text-transform: uppercase !important; color: var(--text-muted) !important;
  background: var(--surface-1) !important; border-bottom: 1px solid var(--border) !important;
  padding: 11px 14px !important; text-align: left; white-space: nowrap;
}
.lote-table td { border-bottom: 1px solid var(--border) !important; padding: 11px 14px !important; font-size: 13px !important; }
.lote-table tbody tr:hover { background: var(--surface-1) !important; }
.lote-table tbody tr:last-child td { border-bottom: none !important; }

/* ── 10 · SIMULADOR INDIVIDUAL (resumo → KPIs) ──────────────── */
.resumo-fin {
  background: transparent !important; border: 0 !important; padding: 0 !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; gap: 12px !important;
}
.resumo-item {
  background: var(--panel) !important; border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important; padding: 15px 18px !important;
  flex-direction: column-reverse !important; gap: 6px !important;
}
.resumo-label {
  font-family: var(--sans) !important; font-size: 11px !important; letter-spacing: 0.04em !important;
  text-transform: uppercase; color: var(--text-muted) !important;
}
.resumo-val { font-size: 24px !important; font-weight: 600 !important; letter-spacing: -0.02em !important; color: var(--text) !important; }
.resumo-fin .resumo-item:nth-child(5) {
  border-color: var(--money-line) !important; border-left: 4px solid var(--money) !important;
  background: var(--money-dim) !important;
}
.resumo-fin .resumo-item:nth-child(5) .resumo-val { color: var(--money-deep) !important; }
.resumo-fin .resumo-item:nth-child(5) .resumo-label { color: var(--money-deep) !important; }

.sim-step.active .sim-step-num { background: var(--accent) !important; color: #fff !important; box-shadow: none !important; }
.sim-step.active .sim-step-label { color: var(--text) !important; font-weight: 600 !important; }
.sim-step-label { font-size: 13px !important; }

/* dinheiro sempre verde */
.money, .money-hero, .money-large, #cntTroco, #simTroco { color: var(--money-deep) !important; }
#simTroco { font-size: 28px !important; font-weight: 600 !important; letter-spacing: -0.02em !important; }

/* ── 11 · ACABAMENTO ────────────────────────────────────────── */
.lote-result-header h2 { font-size: 16px !important; font-weight: 600 !important; }
.toast { border-radius: var(--r-md) !important; box-shadow: var(--shadow-md) !important; }
.chip, .badge { border-radius: 20px !important; font-weight: 600 !important; }
::selection { background: var(--accent-dim); }
*:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }

/* ════════════════════════════════════════════════════════════════
   12 · TOP-BAR VALIDA CORBAN  (título + busca + live + sino + user)
   ════════════════════════════════════════════════════════════════ */
/* Sidebar levemente mais larga + esconde header/user legados */
.app-sidebar { width: 244px !important; }
.main-header { display: none !important; }
.sidebar-user { display: none !important; }
#pulseFooter { display: none !important; } /* redundante com o card "Conexão RVX ativa" */
.tab-content > .screen-header { display: none !important; } /* título vive na top-bar */

.sidebar-foot-actions { display: flex; gap: 4px; }
.sidebar-foot-actions .sidebar-item { flex: 1; justify-content: center; font-size: 12.5px !important; padding: 8px 6px !important; }

/* Card "Conexão RVX ativa" no rodapé da sidebar */
.vc-rvx {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 11px; padding: 11px 13px; margin-bottom: 10px;
}
.vc-rvx-top { display: flex; align-items: center; gap: 8px; color: #eaf0f7; font-weight: 600; font-size: 12px; }
.vc-rvx-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d17f; box-shadow: 0 0 0 0 rgba(52,209,127,0.6); animation: vcPulse 2s infinite; flex-shrink: 0; }
.vc-rvx-sub  { color: #8ba0bd; font-size: 11px; margin-top: 5px; font-family: var(--mono); letter-spacing: .01em; }
.vc-rvx-sub2 { color: #617b9c; font-size: 10.5px; margin-top: 2px; }
@keyframes vcPulse { 0% { box-shadow: 0 0 0 0 rgba(52,209,127,0.55);} 70% { box-shadow: 0 0 0 6px rgba(52,209,127,0);} 100% { box-shadow: 0 0 0 0 rgba(52,209,127,0);} }

/* Barra superior fixa */
.vc-topbar {
  position: sticky; top: 0; z-index: 40;
  margin: -28px -36px 26px; padding: 0 36px;
  height: 64px; display: flex; align-items: center; gap: 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.vc-topbar-left { display: flex; flex-direction: column; justify-content: center; min-width: 190px; }
.vc-topbar-left h1 { margin: 0 !important; font-size: 16px !important; font-weight: 600 !important; color: var(--text) !important; letter-spacing: -0.01em; }
.vc-topbar-left p  { margin: 2px 0 0 !important; font-size: 12px !important; color: var(--text-muted) !important; }

.vc-topbar-search { flex: 1; max-width: 420px; position: relative; display: flex; align-items: center; }
.vc-topbar-search svg { position: absolute; left: 13px; color: var(--text-muted); pointer-events: none; }
.vc-topbar-search input {
  width: 100%; height: 38px; padding: 0 14px 0 36px !important;
  background: var(--surface-1) !important; border: 1px solid var(--border) !important; border-radius: var(--r-pill) !important;
  font-size: 13px !important;
}
.vc-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.vc-live {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--money-dim); color: var(--money-deep);
  border: 1px solid var(--money-line); border-radius: var(--r-pill);
  padding: 6px 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.vc-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--money); animation: vcPulse 2s infinite; }
.vc-icon-btn {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); cursor: pointer;
}
.vc-icon-btn:hover { background: var(--surface-1); color: var(--text); }
.vc-icon-btn svg { width: 17px; height: 17px; }
.vc-bell-dot { position: absolute; top: 8px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.vc-user { display: flex; align-items: center; gap: 9px; padding-left: 6px; }
.vc-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.vc-user-meta { line-height: 1.2; }
.vc-user-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.vc-user-role { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════
   13 · DASHBOARD
   ════════════════════════════════════════════════════════════════ */
#tab-dashboard { display: flex; flex-direction: column; gap: 18px; }

.dash-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-hero-text h1 { margin: 0 0 4px !important; font-size: 24px !important; font-weight: 700 !important; color: var(--text) !important; letter-spacing: -0.02em; }
.dash-hero-text p  { margin: 0 !important; color: var(--text-muted) !important; font-size: 13.5px !important; }
.dash-cta { display: inline-flex; align-items: center; gap: 8px; }
.dash-quick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: -4px; }
.dash-quick-btn { display: inline-flex; align-items: center; gap: 8px; }
.dash-demo-note { font-size: 11.5px; color: var(--text-muted); font-style: italic; }

.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.dash-kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.dash-kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.dash-kpi-value { font-family: var(--mono) !important; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin: 8px 0 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.dash-kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); }
.dash-kpi-delta.up   { background: var(--money-dim); color: var(--money-deep); }
.dash-kpi-delta.flat { background: var(--surface-2); color: var(--text-muted); }

.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: stretch; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.dash-card-head h2 { margin: 0 !important; font-size: 14px !important; font-weight: 600 !important; color: var(--text) !important; }
.dash-card-note { font-size: 11.5px; color: var(--text-muted); }
.dash-link { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0; }
.dash-link:hover { text-decoration: underline; }

.dash-chart { padding: 20px 22px !important; }
.dash-bars { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding-top: 6px; }
.dash-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.dash-bar span { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--accent-line); transition: height .6s cubic-bezier(.2,.8,.2,1); }
.dash-bar.is-current span { background: var(--accent); }
.dash-bar small { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }

.dash-meta {
  background: linear-gradient(150deg, #0f4a2e 0%, #0a3a24 100%);
  border-radius: var(--r-lg); padding: 22px; color: #fff;
  display: flex; flex-direction: column; justify-content: center;
}
.dash-meta-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #9bc8ab; }
.dash-meta-value { font-size: 30px; font-weight: 700; margin: 8px 0 14px; font-family: var(--mono); letter-spacing: -0.02em; }
.dash-meta-goal { font-size: 16px; color: #9bc8ab; font-weight: 500; }
.dash-meta-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.16); overflow: hidden; }
.dash-meta-bar i { display: block; height: 100%; border-radius: 999px; background: #34d17f; }
.dash-meta-note { margin-top: 12px; font-size: 12px; color: #bfe0cc; }

.dash-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.dash-stat { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface-1); }
.dash-stat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-bottom: 8px; }
.dash-stat-dot.viavel { background: var(--money); } .dash-stat-dot.sem { background: #9298a4; } .dash-stat-dot.rev { background: var(--gold); } .dash-stat-dot.none { background: var(--danger); }
.dash-stat-label { font-size: 12px; color: var(--text-muted); }
.dash-stat-value { font-family: var(--mono) !important; font-size: 24px; font-weight: 600; color: var(--text); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.dash-stat-sub { font-size: 11.5px; color: var(--text-muted); }

.dash-cli { display: flex; flex-direction: column; gap: 2px; }
.dash-cli strong { font-size: 13px; font-weight: 600; color: var(--text); }
.dash-cli span { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); }
.dash-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill); }
.dash-tag.inss { background: var(--accent-dim); color: var(--accent); }
.dash-tag.clt  { background: #efeafc; color: #6d4bb8; }
html[data-theme="dark"] .dash-tag.clt { background: rgba(141,110,220,0.18); color: #b9a3e8; }
.dash-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 11px; border-radius: var(--r-pill); }
.dash-pill.viavel { background: var(--money-dim); color: var(--money-deep); }
.dash-pill.sem    { background: var(--surface-2); color: var(--text-muted); }
.dash-pill.rev    { background: var(--gold-soft); color: var(--gold); }
.dash-recent .lote-table td { vertical-align: middle; }

/* Responsivo */
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .vc-topbar { margin: -18px -18px 18px; padding: 0 18px; height: auto; min-height: 58px; gap: 12px; flex-wrap: wrap; }
  .vc-topbar-search { order: 3; max-width: none; flex-basis: 100%; }
  .vc-topbar-left { min-width: 0; }
  .vc-user-meta { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   14 · PARITY DAS TELAS INTERNAS — mata resquícios do visual antigo
   ════════════════════════════════════════════════════════════════ */
/* Barra de acento teal antiga nos títulos dos cards (polish.css) — removida */
.panel > h2::before { display: none !important; }
.panel > h2 { padding-left: 0 !important; font-weight: 600 !important; }
#previewPanel > h2::before { display: none !important; }

/* Extração (rvx-extract.js) — remove glow/gradiente do tema dark, deixa limpo */
#rvxExtractRoot .rxp-sum::after { display: none !important; }
#rvxExtractRoot .rxp-sum { background: var(--money-dim) !important; border-radius: var(--r-md) !important; border: 1px solid var(--money-line) !important; }
#rvxExtractRoot .rx-count { color: var(--money-deep) !important; font-family: var(--mono) !important; }
#rvxExtractRoot .rxp-sum-lbl { color: var(--money-deep) !important; }
#rvxExtractRoot .rxp-head h2 { font-size: 21px !important; font-weight: 700 !important; letter-spacing: -0.02em !important; color: var(--text) !important; }
#rvxExtractRoot .rxp-cta {
  background: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25) !important;
  font-weight: 600 !important; border-radius: 10px !important;
}
#rvxExtractRoot .rxp-cta:hover { background: var(--accent-hover) !important; }
#rvxExtractRoot .rxp-card { box-shadow: var(--shadow-sm) !important; }
html[data-theme="dark"] #rvxExtractRoot .rxp-card { background: var(--panel) !important; }

/* "Por enquanto": só a SIMULAÇÃO, sem a proposta/PNG gerada (pedido do dono 06/07).
   Removível: basta apagar este bloco. */
#previewPanel, #btnGerar { display: none !important; }
#simStepper > li:nth-last-child(-n+2) { display: none !important; } /* tira o passo "Gerar proposta" + separador */

/* Proposta (preview + PNG que vai pro cliente) — marca Valida Corban navy+dourado */
#simulador .sim-header {
  background:
    radial-gradient(ellipse 80% 100% at 92% 18%, rgba(255,255,255,0.07) 0%, transparent 55%),
    linear-gradient(135deg, #14243c 0%, #0a1524 100%) !important;
}
#simulador .sim-brand span { color: #e8b84b !important; letter-spacing: 4px !important; }
#simulador .sim-sub { color: #9fb0c8 !important; }

/* ── Cenários Qualibank (painel novo — substitui o cálculo antigo) ── */
#margemLivreSimPanel { display: none !important; } /* motor antigo — substituído pelos 2 cenários */
.qs-panel h2 svg { color: var(--money-deep) !important; }
.qs-margem { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; margin: 14px 0 18px; }
.qs-mg { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 14px; display: flex; flex-direction: column; gap: 3px; }
.qs-mg span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.qs-mg b { font-size: 17px; color: var(--text); }
.qs-mono { font-family: var(--mono) !important; font-variant-numeric: tabular-nums; }
.qs-dim { color: var(--text-muted); font-weight: 400; }

.qs-contrato { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; background: var(--panel); }
.qs-ct-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--divider, var(--border)); }
.qs-ct-nome { font-weight: 600; font-size: 14px; color: var(--text); }
.qs-ct-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-muted); }
.qs-ct-meta b { color: var(--text); font-weight: 600; }
.qs-aviso { color: var(--gold); font-weight: 600; }

.qs-mg-ok b { color: var(--money-deep) !important; }
.qs-mg-neg b { color: var(--danger) !important; }
.qs-alerta-neg { margin: -6px 0 16px; padding: 10px 14px; border: 1px solid var(--danger); border-left-width: 4px; border-radius: var(--r-md); background: var(--danger-soft); color: var(--text); font-size: 12.5px; line-height: 1.5; }
.qs-mg-sim b { color: var(--gold) !important; font-family: var(--sans) !important; }
.qs-mg-nao b { color: var(--text-muted) !important; font-family: var(--sans) !important; }

/* Tabela unificada por contrato (taxa = eixo comum, PortPura | Port+Refin) */
.qs-tablewrap { overflow-x: auto; }
.qs-uni { width: 100%; border-collapse: collapse; min-width: 720px; }
.qs-uni th { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.qs-uni th:first-child { text-align: left; }
.qs-uni td { font-size: 12.5px; padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--divider, var(--border)); white-space: nowrap; }
.qs-uni td:first-child { text-align: left; }
.qs-uni td:nth-child(4), .qs-uni td:nth-child(7), .qs-uni thead tr:nth-child(2) th:nth-child(4), .qs-uni thead tr:nth-child(2) th:nth-child(7) { text-align: center; }
.qs-uni td:nth-child(5), .qs-uni thead tr:nth-child(2) th:nth-child(5) { border-left: 1px solid var(--border); }
.qs-uni tbody tr:last-child td { border-bottom: 0; }
.qs-uni tbody tr:hover { background: var(--surface-1); }
.qs-grp th { border-bottom: 0; padding-bottom: 3px; text-align: center; font-size: 11px; letter-spacing: .04em; }
.qs-g-pura { color: var(--accent) !important; border-bottom: 2px solid var(--accent-line) !important; }
.qs-g-refin { color: var(--money-deep) !important; border-bottom: 2px solid var(--money-line) !important; }
.qs-tx { font-family: var(--mono) !important; font-weight: 600; color: var(--text); }
.qs-uni tr.qs-no td, .qs-uni tr.qs-no .qs-tx { color: var(--text-muted); }
.qs-neg { color: var(--danger) !important; }

/* DESTAQUE verde neon POR CENÁRIO (24/07/2026): a primeira tabela que fecha em
   cada lado — PortPura e Port+Refin marcadas INDEPENDENTEMENTE, porque podem cair
   em tabelas diferentes. Pinta só as células daquele cenário, não a linha toda. */
.qs-uni tbody td.qs-hl {
  background: rgba(0, 230, 118, 0.14) !important;
  font-weight: 700;
  color: var(--text) !important;   /* vence o cinza de tr.qs-no */
}
.qs-uni tbody tr:hover td.qs-hl { background: rgba(0, 230, 118, 0.2) !important; }
/* barra neon na 1ª célula de cada bloco destacado */
.qs-uni tbody td.qs-hl:nth-child(2),
.qs-uni tbody td.qs-hl:nth-child(5) { box-shadow: inset 3px 0 0 #00e676; }
.qs-melhor-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: var(--r-pill, 999px);
  background: #00e676; color: #06301b; font-size: 9px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; vertical-align: middle;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.55);
}
html[data-theme="dark"] .qs-uni tbody td.qs-hl { background: rgba(0, 230, 118, 0.17) !important; }

/* ── ROTEIRO OPERACIONAL reprova (30/07/2026): vermelho neon ──────────────
   A matemática fecha mas o banco NÃO porta (Facta <12 pagas, taxa pós red.
   <0,90%, saldo mín...). A tabela continua visível (referência), mas o card
   grita em vermelho pro operador não tentar comprar o que não faz. */
.qs-contrato.qs-ct-blocked {
  border: 1px solid rgba(255, 45, 85, 0.45);
  border-left: 4px solid #ff2d55;
  border-radius: 10px;
  box-shadow: inset 4px 0 0 rgba(255, 45, 85, 0.15), 0 0 14px rgba(255, 45, 85, 0.22);
  padding-left: 10px;
}
.qs-contrato.qs-ct-blocked .qs-tablewrap { opacity: 0.72; }
.qs-contrato.qs-ct-blocked .qs-tablewrap:hover { opacity: 1; }
/* chip do dado que causou a reprovação (parcela/pagas/taxa pós red.) */
.qs-ct-meta .qs-chip-no,
.qs-ct-meta .qs-chip-no b {
  color: #ff2d55 !important;
  text-shadow: 0 0 8px rgba(255, 45, 85, 0.45);
}
/* banner com o motivo do roteiro */
.qs-roteiro-no {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 8px 0 10px; padding: 8px 12px;
  background: rgba(255, 45, 85, 0.10);
  border: 1px solid rgba(255, 45, 85, 0.35);
  border-radius: 8px;
}
.qs-roteiro-tag {
  flex-shrink: 0; padding: 2px 9px; border-radius: var(--r-pill, 999px);
  background: #ff2d55; color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.6);
}
.qs-roteiro-txt { font-size: 12px; font-weight: 600; color: var(--text); }
html[data-theme="dark"] .qs-roteiro-no { background: rgba(255, 45, 85, 0.14); }
html[data-theme="dark"] .qs-roteiro-no .qs-roteiro-txt { color: #ffb3c1; }

/* ══ PAINEL ANIMADO DO LOTE (04/08/2026) ══════════════════════════
   Motion design: spring na barra, count-up nos números, pulso no que
   muda. Degrada para CSS puro se o Motion One não carregar. */
.lm-panel {
  padding: 14px 16px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1, rgba(127,127,127,.04));
  transition: border-color .3s ease, box-shadow .3s ease;
}
.lm-panel.lm-ativo {
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 0 0 1px rgba(13,148,136,.08), 0 4px 18px rgba(13,148,136,.10);
}
.lm-panel.lm-pausado { border-color: rgba(255, 176, 32, .5); }
.lm-panel.lm-fim     { border-color: rgba(0, 230, 118, .45); box-shadow: 0 0 0 1px rgba(0,230,118,.10); }

.lm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lm-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text); }

/* bolinha que pulsa enquanto roda */
.lm-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.lm-ativo .lm-pulse   { background: #0d9488; animation: lmPulse 1.4s ease-in-out infinite; }
.lm-pausado .lm-pulse { background: #ffb020; animation: lmPulse 1s ease-in-out infinite; }
.lm-fim .lm-pulse     { background: #00e676; box-shadow: 0 0 10px rgba(0,230,118,.6); }
@keyframes lmPulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(13,148,136,.45); }
  50%      { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(13,148,136,0); }
}

.lm-taxa { display: flex; align-items: baseline; gap: 5px; }
.lm-taxa b { font-size: 17px; font-weight: 700; color: #0d9488; font-variant-numeric: tabular-nums; }
.lm-fim .lm-taxa b { color: #00a152; }
.lm-taxa small { font-size: 10.5px; color: var(--text-muted); }

.lm-numeros { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.lm-contagem { display: flex; align-items: baseline; gap: 7px; }
.lm-contagem b { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.lm-de   { font-size: 12.5px; color: var(--text-muted); }
.lm-pct  { font-size: 15px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lm-ativo .lm-pct { color: #0d9488; }
.lm-fim .lm-pct   { color: #00a152; }

/* barra com brilho correndo enquanto processa */
.lm-bar { position: relative; overflow: hidden; }
/* Transição CURTA de propósito: o progresso agora chega em fluxo contínuo
   (uma consulta por vez), então a barra deve ACOMPANHAR o job, não correr
   atrás dele. Com curva longa/overshoot ela ficava sempre atrasada em relação
   ao número — a animação parecia desconectada da tarefa (relato de 04/08).
   Precisa de !important: a regra base da barra (~linha 247) também usa. */
.lm-bar .lote-bar-fill { transition: width .22s cubic-bezier(.33, .9, .35, 1) !important; }
@media (prefers-reduced-motion: reduce) { .lm-bar .lote-bar-fill { transition: none !important; } }
.lm-shine { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.lm-ativo .lm-shine {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  animation: lmShine 1.6s linear infinite;
}
@keyframes lmShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.lm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lm-chip {
  font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill, 999px);
  background: var(--surface-2, rgba(127,127,127,.10)); color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 4px;
}
.lm-chip b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; display: inline-block; }
.lm-chip.ok b { color: #00a152; }
.lm-chip.nf b { color: var(--text-muted); }
.lm-chip.er b { color: #e5484d; }
.lm-chip.eta  { margin-left: auto; font-style: italic; }

/* fallback do pulso quando o Motion One não está disponível */
@keyframes lmBump { 0%,100% { transform: scale(1); } 40% { transform: scale(1.18); } }
.lm-bump { animation: lmBump .42s ease-out; }

.lm-legenda { margin-top: 6px; font-size: 11.5px; }

@media (prefers-reduced-motion: reduce) {
  .lm-pulse, .lm-shine, .lm-bump { animation: none !important; }
}

/* Nº do contrato ao lado do nome do banco (03/08/2026) */
.qs-ct-num {
  margin-left: 8px; padding: 1px 7px; border-radius: var(--r-pill, 999px);
  background: var(--surface-2, rgba(127,127,127,.12));
  color: var(--text-muted); font-size: 10.5px; font-weight: 600;
  font-family: var(--font-mono, ui-monospace, monospace); letter-spacing: .01em;
  vertical-align: middle; white-space: nowrap;
}

/* Contrato que PASSA no roteiro — verde, espelho do vermelho */
.qs-contrato.qs-ct-ok {
  border: 1px solid rgba(0, 230, 118, 0.35);
  border-left: 4px solid #00e676;
  border-radius: 10px;
  box-shadow: inset 4px 0 0 rgba(0, 230, 118, 0.12), 0 0 12px rgba(0, 230, 118, 0.15);
  padding-left: 10px;
}
.qs-roteiro-ok {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 8px 0 10px; padding: 7px 12px;
  background: rgba(0, 230, 118, 0.09);
  border: 1px solid rgba(0, 230, 118, 0.30);
  border-radius: 8px;
}
.qs-roteiro-tag-ok {
  flex-shrink: 0; padding: 2px 9px; border-radius: var(--r-pill, 999px);
  background: #00e676; color: #06301b; font-size: 10px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.55);
}
html[data-theme="dark"] .qs-roteiro-ok { background: rgba(0, 230, 118, 0.12); }
html[data-theme="dark"] .qs-roteiro-ok .qs-roteiro-txt { color: #a8f5c9; }

/* ── DIVISÓRIA entre os dois blocos (PortPura | Port+Refin) ───────────────
   As duas "planilhas" ficam lado a lado; sem uma linha clara o olho se perde. */
.qs-uni td:nth-child(5), .qs-uni th:nth-child(5) {
  border-left: 2px solid var(--text-muted) !important;
}
.qs-uni thead tr.qs-grp th:nth-child(3) { border-left: 2px solid var(--text-muted); }
/* separador leve entre a coluna Taxa e o bloco da PortPura */
.qs-uni td:nth-child(2), .qs-uni th:nth-child(2) { border-left: 1px solid var(--border); }
.qs-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); }
.qs-badge.sim { background: var(--money-dim); color: var(--money-deep); }
.qs-badge.nao { background: var(--surface-2); color: var(--text-muted); }
.qs-motivo { display: block; font-size: 9px; color: var(--danger); font-weight: 600; margin-top: 1px; white-space: normal; }

/* Esconder proposta legada + resumo antigo (35%+cartões, não bate com a calc nova) */
#legacyPropBlock, #resumoFin { display: none !important; }
.login-logo { background: #0f1b2e !important; }
.login-title span { color: #b8790a !important; }

/* Modo ESCURO: legibilidade dos cinzas (linhas "Não" e badges não somem) */
html[data-theme="dark"] .qs-uni tr.qs-no td,
html[data-theme="dark"] .qs-uni tr.qs-no .qs-tx { color: var(--text-2) !important; }
html[data-theme="dark"] .qs-uni th { color: #aab2c0 !important; }
html[data-theme="dark"] .qs-dim { color: #9aa2b2 !important; }
html[data-theme="dark"] .qs-badge.nao { background: rgba(255,255,255,0.11); color: #d0d6e0 !important; }
html[data-theme="dark"] .qs-mg span, html[data-theme="dark"] .qs-ct-meta { color: #a8b0be !important; }
html[data-theme="dark"] .dash-kpi-label, html[data-theme="dark"] .dash-stat-label,
html[data-theme="dark"] .dash-card-note, html[data-theme="dark"] .lote-counter small { color: #a8b0be !important; }

/* ══ 20 · VISIBILIDADE DE AÇÕES (07/08/2026) ═══════════════════
   Os botões secundários herdavam --text-2 sobre painel branco e
   sumiam no meio do conteúdo; o lápis de ajuste vinha com
   opacity .38 e ninguém achava. Ação que não se vê não é usada. */
.btn, button.btn, label.btn {
  color: var(--text) !important;
  border-color: var(--border-hover) !important;
  box-shadow: var(--shadow-sm) !important;
}
.btn:hover, button.btn:hover, label.btn:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-dim) !important;
}
.btn-primary:hover, button.btn-primary:hover { color: #fff !important; background: var(--accent-hover) !important; }
.btn-danger:hover, button.btn-danger:hover { color: var(--danger) !important; background: var(--danger-soft) !important; border-color: var(--danger) !important; }
.btn-ghost, button.btn-ghost, .btn.btn-ghost { box-shadow: none !important; }
.btn-ghost:hover, button.btn-ghost:hover { background: var(--accent-dim) !important; color: var(--accent) !important; }

/* Lápis de ajuste: vira um botãozinho azul, sempre legível */
.qs-edit, .rf-edit-btn {
  opacity: 1 !important;
  color: var(--accent) !important;
  background: var(--accent-dim) !important;
  border: 1px solid var(--accent-line) !important;
  border-radius: 6px !important;
  padding: 1px 5px !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  transition: background .12s, border-color .12s !important;
}
.qs-edit:hover, .rf-edit-btn:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
html[data-theme="dark"] .qs-edit, html[data-theme="dark"] .rf-edit-btn { border-color: rgba(91,141,239,0.42) !important; }

/* ══ 21 · MARGEM LIVRE (07/08/2026) ════════════════════════════
   Bloco de empréstimo novo dentro da Simulação Qualibank. */
.ml-bloco {
  margin: 14px 0 18px;
  padding: 14px 16px 12px;
  border: 1px solid var(--money-line);
  border-left: 3px solid var(--money);
  border-radius: var(--r-md);
  background: var(--money-dim);
}
.ml-titulo {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--money-deep);
}
/* Os três números da conversa com o cliente, grandes e lado a lado. */
.ml-grade {
  display: flex; align-items: flex-start; gap: 30px;
  flex-wrap: wrap; margin-top: 12px;
}
.ml-item { display: flex; flex-direction: column; gap: 4px; }
.ml-item-fim { margin-left: auto; align-items: flex-end; text-align: right; }
.ml-rot {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-muted);
}
.ml-val {
  font-family: var(--mono); font-size: 20px; font-weight: 600;
  color: var(--text); display: flex; align-items: center; gap: 7px; line-height: 1.2;
}
.ml-val .qs-edit { font-size: 13px !important; padding: 2px 7px !important; }
.ml-dinheiro { font-size: 27px; font-weight: 700; color: var(--money-deep); }
.ml-sub { font-size: 11px; color: var(--text-muted); }
.ml-aprox { font-size: 15px; color: var(--warning); font-weight: 700; align-self: flex-start; }
.ml-nota {
  margin-top: 12px; font-size: 11.5px; line-height: 1.45;
  color: var(--gold-deep); background: var(--gold-soft);
  border-radius: var(--r-sm); padding: 7px 10px;
}
html[data-theme="dark"] .ml-bloco { background: rgba(23,143,87,0.09); border-color: rgba(23,143,87,0.28); }
html[data-theme="dark"] .ml-titulo, html[data-theme="dark"] .ml-dinheiro { color: #4ec98a !important; }
html[data-theme="dark"] .ml-nota { background: rgba(184,121,10,0.14); color: #e0b667 !important; }
@media (max-width: 620px) {
  .ml-grade { gap: 18px; }
  .ml-item-fim { margin-left: 0; align-items: flex-start; text-align: left; }
}

/* Selo de origem da margem: IN100 (azul) e extrato (verde) se distinguem
   do "ajustada" laranja, que é digitação do operador. */
.qs-editado.qs-fonte-in100 {
  background: var(--accent-dim) !important; color: var(--accent) !important;
  border-color: var(--accent-line) !important;
}
.qs-editado.qs-fonte-ext {
  background: var(--money-dim) !important; color: var(--money-deep) !important;
  border-color: var(--money-line) !important;
}
html[data-theme="dark"] .qs-editado.qs-fonte-in100 { color: #7ea9f5 !important; border-color: rgba(91,141,239,0.4) !important; }
html[data-theme="dark"] .qs-editado.qs-fonte-ext { color: #4ec98a !important; border-color: rgba(23,143,87,0.4) !important; }

/* ── ESCOLHA DE CLIENTE POR TELEFONE ─────────────────────────────────
   Um número pode atender mais de uma pessoa. Só aparece quando há mais
   de um dono — com um só, a consulta segue direto. */
.tel-escolha { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.tel-escolha .tel-escolha-tit {
  font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px;
}
.tel-escolha .tel-escolha-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-1); color: var(--text); font-size: 13px;
  transition: border-color .15s, background .15s;
}
.tel-escolha .tel-escolha-item:hover { border-color: var(--accent); background: var(--surface-2); }
.tel-escolha .tel-escolha-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tel-escolha .tel-escolha-nome { font-weight: 600; }
.tel-escolha .tel-escolha-cpf {
  font-family: var(--mono); font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
