/* ═══════════════════════════════════════════════════════════════════════════
   MENE PORTELLA · Automação Contas a Pagar — Tema
   Identidade visual oficial extraída de meneportella.com.br (Elementor kit):
   accent #F9B036 · preto #020201/#1D1D1B · off-white #EAE9E8 · cinza #9A9A92
   Tipografia: Oriole (títulos, fonte própria da marca) + Sora (texto)
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Oriole SemiBold';
  src: url('/assets/fonts/Oriole-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Oriole Medium';
  src: url('/assets/fonts/Oriole-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  /* marca */
  --brand-950: #020201;
  --brand-900: #131312;
  --brand-800: #1D1D1B;
  --brand-700: #252629;
  --brand-600: #3B3C3E;
  --accent-500: #F9B036;
  --accent-400: #FBC363;
  --accent-100: #FCF0DA;
  --accent-ink: #7A5410;

  /* superfícies (tema claro, derivado do off-white #EAE9E8 da marca) */
  --bg: #F2F1EF;
  --surface: #FFFFFF;
  --surface-2: #F8F7F5;
  --border: #E4E2DE;
  --border-strong: #CFCDC7;

  /* texto */
  --text: #1D1D1B;
  --text-soft: #4A4A45;
  --muted: #75756D;

  /* semânticas */
  --success: #1E7F4F;
  --success-bg: #E5F3EC;
  --warning: #A66A0E;
  --warning-bg: #FBF0DA;
  --danger: #B3372F;
  --danger-bg: #F9E8E6;
  --info: #2B6CB0;
  --info-bg: #E7F0F9;

  /* tipografia */
  --font-display: 'Oriole SemiBold', 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Sora', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Cascadia Code', 'Consolas', monospace;

  /* forma */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(20, 28, 38, .06), 0 1px 6px rgba(20, 28, 38, .05);
  --shadow-2: 0 4px 12px rgba(20, 28, 38, .08), 0 2px 4px rgba(20, 28, 38, .05);
  --shadow-3: 0 16px 40px rgba(20, 28, 38, .18);

  /* movimento */
  --t-fast: 150ms cubic-bezier(.3, .7, .4, 1);
  --t-med: 240ms cubic-bezier(.3, .7, .4, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* números tabulares para valores */
.num, td.num, .money { font-variant-numeric: tabular-nums; }

/* ═══════════════════ LOGIN ═══════════════════ */
.login { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100dvh; }
.login-brand {
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(249, 176, 54, .16), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(249, 176, 54, .10), transparent 65%),
    linear-gradient(160deg, var(--brand-900), var(--brand-950));
  color: #EAE9E8;
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
  position: relative; overflow: hidden;
}
.login-brand::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; pointer-events: none;
}
.login-brand-inner { position: relative; z-index: 1; max-width: 420px; }
.brand-logo { width: 168px; height: auto; display: block; filter: drop-shadow(0 8px 30px rgba(249, 176, 54, .25)); }
.sidebar-logo { height: 42px; width: auto; display: block; }
.monogram {
  width: 72px; height: 72px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-400), var(--accent-500));
  color: var(--brand-950);
  font-family: Georgia, serif; font-weight: 700; font-size: 30px; letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(249, 176, 54, .35);
}
.monogram.sm { width: 42px; height: 42px; font-size: 18px; border-radius: 12px; box-shadow: none; }
.brand-title { font-size: 34px; letter-spacing: 6px; margin-top: 28px; font-weight: 600; }
.brand-sub { color: #9A9A92; margin: 6px 0 0; letter-spacing: .4px; }
.brand-divider { width: 64px; height: 3px; background: var(--accent-500); border-radius: 2px; margin: 28px 0; }
.brand-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; color: #C9C8C2; }
.brand-points li { display: flex; align-items: center; gap: 12px; }
.brand-points .ic { color: var(--accent-400); }
.brand-foot { margin-top: 44px; font-size: 12.5px; color: #85847E; letter-spacing: .6px; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 36px; }
.login-card h2 { font-size: 22px; }
.login-hint { color: var(--muted); margin: 6px 0 26px; font-size: 14px; }
.login-foot { margin: 22px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.login-foot .dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); margin: 0 6px; vertical-align: middle; }

/* campos */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input, .input-wrap select {
  width: 100%; height: 44px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 14px; background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-wrap .input-ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-wrap .input-ic + input { padding-left: 42px; }
.input-wrap input:focus, .input-wrap select:focus, .control:focus {
  outline: none; border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(249, 176, 54, .22);
}
.input-wrap .icon-btn { position: absolute; right: 6px; }

/* campo de e-mail com domínio fixo */
.email-field {
  display: flex; align-items: center; height: 44px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0 12px 0 13px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.email-field:focus-within { border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(249, 176, 54, .22); }
.email-field .input-ic { color: var(--muted); margin-right: 10px; flex: none; }
.email-field input {
  flex: 1; min-width: 40px; border: none; outline: none; background: transparent;
  height: 100%; padding: 0; font: inherit;
}
.email-suffix {
  flex: none; color: var(--muted); font-size: 13.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; margin-left: 6px; user-select: none;
}
.mono { font-family: var(--font-mono); }

/* autocomplete (fornecedores, contas, centros de custo) */
.cbx { position: relative; }
.cbx .cbx-input { height: 40px; font-size: 13.5px; }
.cbx-list {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: min(340px, 90vw); max-width: 420px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow-2); z-index: 70; max-height: 300px; overflow: auto;
}
.cbx-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--border);
  padding: 9px 12px; font-size: 13px; cursor: pointer;
}
.cbx-item:last-child { border-bottom: none; }
.cbx-item:hover, .cbx-item:focus { background: var(--accent-100); }
.cbx-sub { font-size: 11.5px; color: var(--muted); }
.cbx-empty { padding: 12px 14px; font-size: 13px; color: var(--muted); }

/* ═══════════════════ ITENS DA NOTA (cartões, sem scroll lateral) ═══════════════════ */
.item-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: var(--surface);
  transition: border-color var(--t-fast);
}
.item-card:hover { border-color: var(--border-strong); }
.item-line1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.item-line1 .it-desc { flex: 1 1 240px; min-width: 200px; }
.item-line1 .it-qty { width: 64px; text-align: right; }
.item-line1 .it-total { width: 110px; text-align: right; font-weight: 600; }
.item-line1 .it-unit { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.item-line2 {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px 16px; margin-top: 10px;
}
@media (max-width: 900px) { .item-line2 { grid-template-columns: 1fr; } }
.item-field label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.item-field .no-cc {
  display: flex; align-items: center; height: 40px; font-size: 13px; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 12px;
}
.items-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
}

/* cabeçalho da nota em grade fixa */
.kv4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.kv4 .span2 { grid-column: span 2; }
@media (max-width: 1100px) { .kv4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kv4 { grid-template-columns: 1fr; } .kv4 .span2 { grid-column: auto; } }
.form-error { color: var(--danger); background: var(--danger-bg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; margin: 0 0 16px; }

.control {
  height: 40px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 12px; background: var(--surface); width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
select.control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2379828E' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.control:disabled { opacity: .55; background: var(--surface-2); cursor: not-allowed; }
.control[readonly] { background: var(--surface-2); }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 10px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 14.5px; letter-spacing: .2px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(160deg, var(--brand-700), var(--brand-900)); color: #EAE9E8; box-shadow: var(--shadow-1); }
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-2); }
.btn-gold { background: linear-gradient(150deg, var(--accent-400), var(--accent-500)); color: var(--brand-950); box-shadow: var(--shadow-1); }
.btn-gold:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(249, 176, 54, .4); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--brand-600); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: none; background: transparent; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--text); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════ APP SHELL ═══════════════════ */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }

.sidebar {
  background: linear-gradient(175deg, var(--brand-900), var(--brand-950));
  color: #C6C5BF; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh;
}
.sidebar-brand { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 24px 20px 18px; }
.sidebar-brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: 2.5px; font-size: 13.5px; color: #EAE9E8; }
.sidebar-brand-sub { font-size: 11.5px; color: #85847E; letter-spacing: .4px; }

.sidebar-nav { display: grid; gap: 4px; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; text-decoration: none;
  font-size: 14px; font-weight: 500; color: #A5A49C;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #EAE9E8; }
.sidebar-nav a.active { background: rgba(249, 176, 54, .14); color: var(--accent-400); position: relative; }
.sidebar-nav a.active::before { content: ''; position: absolute; left: -12px; top: 20%; bottom: 20%; width: 3px; border-radius: 2px; background: var(--accent-500); }
.sidebar-nav a.nav-cta { border: 1px dashed rgba(249, 176, 54, .45); color: var(--accent-400); }
.sidebar-nav a.nav-cta:hover { background: rgba(249, 176, 54, .12); }

.sidebar-foot { margin-top: auto; padding: 14px 16px 18px; display: grid; gap: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.ext-status { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px 12px; }
.ext-status-title { font-size: 12.5px; font-weight: 600; color: #E4E3DD; }
.ext-status-sub { font-size: 11.5px; color: #85847E; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pulse-dot.ok { background: #3DBB7C; box-shadow: 0 0 0 0 rgba(61, 187, 124, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(61, 187, 124, 0); } }

.sidebar-foot > * { min-width: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-700); color: var(--accent-400); font-weight: 700; font-size: 14px; flex: none; }
.user-chip-info { min-width: 0; flex: 1; overflow: hidden; }
.user-chip .icon-btn { flex: none; }
.user-chip-name { font-size: 13px; font-weight: 600; color: #EAE9E8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-role { font-size: 11.5px; color: #85847E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .icon-btn { color: #85847E; }
.user-chip .icon-btn:hover { background: rgba(255,255,255,.08); color: #EAE9E8; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 32px 16px; background: var(--bg);
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
}
.topbar-crumb { font-size: 12.5px; color: var(--muted); letter-spacing: .3px; }
.topbar-title { font-size: 21px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.screen-root { padding: 26px 32px 60px; max-width: 1240px; width: 100%; margin: 0 auto; animation: fadein var(--t-med) both; }
.screen-root:focus, .screen-root:focus-visible { outline: none; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ═══════════════════ BADGES / CHIPS ═══════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .2px;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.badge .ic { width: 13px; height: 13px; }
.badge-env { background: var(--brand-900); color: var(--accent-400); border-color: var(--brand-700); }
.badge-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge-gold { background: var(--accent-100); color: var(--accent-ink); border-color: transparent; }
.badge-neutral { background: #ECEDEF; color: var(--text-soft); border-color: transparent; }

/* ═══════════════════ CARDS / TILES ═══════════════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.tile::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--tile-accent, var(--brand-600)); }
.tile-label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.tile-value { font-family: var(--font-body); font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ═══════════════════ TABELAS ═══════════════════ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); padding: 12px 16px; border-bottom: 1.5px solid var(--border-strong);
  white-space: nowrap;
}
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.clickable { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-soft); }
.tbl-compact th { padding: 9px 10px; font-size: 11px; }
.tbl-compact td { padding: 9px 10px; font-size: 13.5px; }

.tbl-input { width: 100%; min-width: 90px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 0 8px; transition: border-color var(--t-fast), background var(--t-fast); }
.tbl-input:hover { border-color: var(--border-strong); }
.tbl-input:focus { outline: none; border-color: var(--accent-500); background: var(--surface); box-shadow: 0 0 0 2px rgba(249,176,54,.2); }
.tbl-input.num { text-align: right; }

/* ═══════════════════ WIZARD / STEPPER ═══════════════════ */
.stepper { display: flex; gap: 4px; margin-bottom: 26px; overflow-x: auto; padding-bottom: 2px; }
.step {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 150px;
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600;
  transition: all var(--t-med); white-space: nowrap;
}
.step .step-n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); border: 1.5px solid var(--border-strong); font-size: 12.5px;
  transition: all var(--t-med);
}
.step.current { border-color: var(--brand-700); color: var(--text); box-shadow: var(--shadow-1); }
.step.current .step-n { background: var(--brand-800); border-color: var(--brand-800); color: var(--accent-400); }
.step.done { color: var(--success); border-color: transparent; background: var(--success-bg); }
.step.done .step-n { background: var(--success); border-color: var(--success); color: #fff; }
.step .ic { width: 14px; height: 14px; }

.wizard-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
.wizard-actions .right { display: flex; gap: 10px; margin-left: auto; }

/* dropzone */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 44px 24px; text-align: center;
  color: var(--muted); transition: all var(--t-med); cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent-500); background: var(--accent-100); color: var(--accent-ink); }
.dropzone .ic { width: 34px; height: 34px; margin-bottom: 10px; }
.dropzone strong { color: var(--text); }
.dropzone .hint { font-size: 12.5px; margin-top: 6px; }

/* árvore lote→nota→item */
.split { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }
.tree { display: grid; gap: 6px; min-width: 0; }
.tree-note {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 12px 14px; cursor: pointer; transition: all var(--t-fast);
  min-width: 0; max-width: 100%; overflow: hidden;
}
.tree-note-doc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-note:hover { border-color: var(--brand-600); }
.tree-note.active { border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(249,176,54,.18); }
.tree-note-doc { font-weight: 700; font-size: 13.5px; }
.tree-note-sup { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-note-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; }

/* proposta / parcelas / contabilização */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 22px; }
.kv .k { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.kv .v { font-size: 14.5px; font-weight: 600; margin-top: 2px; }

.balance-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.balance-bar.ok { background: var(--success-bg); color: var(--success); }
.balance-bar.err { background: var(--danger-bg); color: var(--danger); }

.checklist { display: grid; gap: 10px; }
.checklist label {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: all var(--t-fast); font-size: 14px;
}
.checklist label:hover { border-color: var(--brand-600); }
.checklist input { width: 18px; height: 18px; accent-color: var(--success); margin-top: 1px; }
.checklist label:has(input:checked) { background: var(--success-bg); border-color: transparent; }

.hash-box {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink);
  background: var(--accent-100); border-radius: 8px; padding: 10px 14px;
  word-break: break-all; display: flex; gap: 10px; align-items: center;
}

/* timeline execução */
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 30px 1fr; gap: 14px; position: relative; padding-bottom: 4px; }
.tl-item .tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); border: 1.5px solid var(--border-strong); color: var(--muted);
  transition: all var(--t-med); z-index: 1;
}
.tl-dot .ic { width: 13px; height: 13px; }
.tl-line { width: 2px; flex: 1; background: var(--border); min-height: 14px; }
.tl-item:last-child .tl-line { display: none; }
.tl-body { padding: 2px 0 16px; }
.tl-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }
.tl-item.running .tl-dot { border-color: var(--info); color: var(--info); animation: tlpulse 1.2s infinite; }
.tl-item.ok .tl-dot { background: var(--success); border-color: var(--success); color: #fff; }
.tl-item.paused .tl-dot { border-color: var(--warning); color: var(--warning); }
.tl-item.blocked .tl-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
@keyframes tlpulse { 50% { box-shadow: 0 0 0 6px rgba(43,108,176,.15); } }

/* mock do navegador (screenshot simulada) */
.browser-mock { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.browser-mock-bar { display: flex; align-items: center; gap: 8px; background: var(--brand-900); padding: 8px 12px; }
.browser-mock-bar .b-dot { width: 10px; height: 10px; border-radius: 50%; }
.browser-mock-url { flex: 1; background: rgba(255,255,255,.1); color: #9A9A92; border-radius: 6px; font-size: 11.5px; padding: 4px 10px; font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-mock-body { padding: 18px; min-height: 210px; background: repeating-linear-gradient(0deg, var(--surface-2), var(--surface-2) 34px, var(--border) 34px, var(--border) 35px); position: relative; }
.mock-field { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; font-size: 12px; font-family: var(--font-mono); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.mock-field .lbl { color: var(--muted); }
.mock-field.highlight { border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(249,176,54,.25); }

/* diff intenção × readback */
.diff-ok { color: var(--success); font-weight: 600; }
.diff-bad { color: var(--danger); font-weight: 600; }
.tbl tr.row-diverge, .tbl tr.row-diverge:hover { background: var(--danger-bg); }
.result-hero { text-align: center; padding: 40px 20px 30px; }
.result-hero .big-ic { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; }
.result-hero.ok .big-ic { background: var(--success-bg); color: var(--success); }
.result-hero.warn .big-ic { background: var(--warning-bg); color: var(--warning); }
.result-hero .big-ic .ic { width: 36px; height: 36px; }
.result-hero h2 { font-size: 24px; }
.result-hero p { color: var(--muted); max-width: 520px; margin: 8px auto 0; }

/* ═══════════════════ TABS ═══════════════════ */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  border: none; background: none; padding: 10px 16px; font-weight: 600; font-size: 14px;
  color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
  transition: color var(--t-fast), border-color var(--t-fast); white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-800); border-bottom-color: var(--accent-500); }

/* ═══════════════════ MODAL ═══════════════════ */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 16, 25, .55); backdrop-filter: blur(3px); animation: fadein var(--t-fast) both; }
.modal {
  position: relative; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3); width: min(560px, 100%); max-height: 88dvh; overflow: auto;
  padding: 28px; animation: modalin var(--t-med) both;
}
@keyframes modalin { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal .modal-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ═══════════════════ TOASTS ═══════════════════ */
.toast-root { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 10px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-900); color: #EAE9E8; border-radius: 10px;
  padding: 12px 16px; box-shadow: var(--shadow-3); font-size: 14px; font-weight: 500;
  animation: toastin var(--t-med) both; max-width: 380px;
}
.toast .ic { flex: none; }
.toast.success .ic { color: #3DBB7C; }
.toast.error .ic { color: #E5766D; }
.toast.info .ic { color: var(--accent-400); }
@keyframes toastin { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastout var(--t-fast) both; }
@keyframes toastout { to { opacity: 0; transform: translateX(20px); } }

/* ═══════════════════ EMPTY / SKELETON ═══════════════════ */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .ic { width: 40px; height: 40px; margin-bottom: 10px; opacity: .6; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* utilidades */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.money { font-weight: 600; }
.text-danger { color: var(--danger); } .text-success { color: var(--success); }

/* responsivo do shell */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 90; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform var(--t-med); }
  .sidebar.open { transform: none; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .screen-root, .topbar { padding-left: 18px; padding-right: 18px; }
}
