/* ==========================================================================
   NOVA // ERA — Gestão
   Design system premium (dark, azul da marca, sóbrio — app de dinheiro)
   Sem emojis. Ícones = SVG stroke. Tipografia Sora (display) + Inter (corpo).
   ========================================================================== */

:root {
  /* — Superfícies (quase-preto azulado, em camadas) — */
  --bg:        #080b10;
  --bg-2:      #0a0e14;
  --surface:   #10151e;
  --surface-2: #141b26;
  --surface-3: #1a2230;
  --surface-hover: #1d2634;

  /* — Linhas (baixa opacidade) — */
  --line:        rgba(148,178,208,.10);
  --line-strong: rgba(148,178,208,.18);

  /* — Marca Nova Era (azul) — */
  --brand-900: #0A0E12;
  --brand-700: #143A57;
  --brand-500: #2F6E96;
  --brand-400: #3A627C;
  --brand-300: #6FB4DD;

  /* — Acento e semântica (SEM verde/dourado/laranja) — */
  --accent:      #6FB4DD;
  --accent-2:    #2F6E96;
  --accent-ink:  #06222f;
  --accent-glow: rgba(111,180,221,.16);
  --pos:  #57B0E4;   /* entrada / receita — azul */
  --neg:  #E5646B;   /* saída / despesa — vermelho suave (não laranja) */
  --neg-soft: rgba(229,100,107,.12);
  --pos-soft: rgba(87,176,228,.12);

  /* — Texto (3 tiers) — */
  --text-1: #eef4fb;
  --text-2: rgba(223,234,247,.70);
  --text-3: rgba(200,217,236,.54);

  /* — Raio — */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* — Sombras em camadas — */
  --sh-1: 0 1px 2px rgba(0,0,0,.45), 0 1px 1px rgba(0,0,0,.30);
  --sh-2: 0 2px 4px rgba(0,0,0,.35), 0 10px 24px -8px rgba(0,0,0,.55);
  --sh-3: 0 6px 12px rgba(0,0,0,.40), 0 28px 56px -14px rgba(0,0,0,.65);
  --sh-accent: 0 8px 30px -8px rgba(47,110,150,.55);

  /* — Movimento — */
  --e-out:    cubic-bezier(.16,1,.3,1);
  --e-spring: cubic-bezier(.22,1,.36,1);

  --font-display: "Sora", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --sidebar-w: 244px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 700px at 82% -10%, rgba(47,110,150,.14), transparent 60%),
    radial-gradient(900px 600px at -8% 8%, rgba(20,58,87,.16), transparent 55%),
    var(--bg);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.tnum { font-variant-numeric: tabular-nums; }

/* brilho aurora de fundo — a assinatura de luz da marca, muito sutil */
body::before {
  content: ""; position: fixed; left: -15%; right: -15%; top: -25%; height: 65vh;
  z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(47,110,150,.20), rgba(47,110,150,.05) 55%, transparent 72%);
  filter: blur(28px); opacity: .9;
  animation: aurora 26s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; left: 40%; right: -20%; bottom: -30%; height: 60vh;
  z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(20,58,87,.22), transparent 70%);
  filter: blur(34px);
  animation: aurora2 32s ease-in-out infinite alternate;
}
@keyframes aurora { 0% { transform: translate(-6%, -4%) scale(1); } 100% { transform: translate(9%, 5%) scale(1.18); } }
@keyframes aurora2 { 0% { transform: translate(4%, 4%) scale(1.05); } 100% { transform: translate(-8%, -3%) scale(1.2); } }
.app-shell { position: relative; z-index: 1; }

/* — Scrollbar sóbria — */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-hover); background-clip: padding-box; }

/* ============================ SHELL ============================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20,27,38,.55), rgba(10,14,20,.30));
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brand-500), var(--brand-700));
  border: 1px solid rgba(111,180,221,.35);
  box-shadow: var(--sh-accent), inset 0 1px 0 rgba(255,255,255,.12);
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: #fff; letter-spacing: -.5px;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.brand-name .sep { color: var(--accent); margin: 0 1px; }
.brand-sub { font-size: 10.5px; letter-spacing: .28em; color: var(--text-3); text-transform: uppercase; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-label { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r);
  color: var(--text-2); text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer; position: relative;
  transition: background .16s var(--e-out), color .16s var(--e-out), border-color .16s;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .85; }
.nav-item:hover { background: var(--surface); color: var(--text-1); }
.nav-item.active {
  background: linear-gradient(100deg, rgba(47,110,150,.22), rgba(47,110,150,.06));
  color: #fff; border-color: rgba(111,180,221,.22);
}
.nav-item.active::before {
  content:""; position:absolute; left:-14px; top:50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 3px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav-item.active svg { opacity: 1; color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* ============================ MAIN ============================ */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(8,11,16,.86), rgba(8,11,16,.55));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 19px; }
.topbar .tb-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.view { padding: 26px 28px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }
.view-enter { animation: viewFade .28s var(--e-out) both; }
@keyframes viewFade { from { opacity: 0; } to { opacity: 1; } }
.view-enter > * { animation: riseIn .5s var(--e-out) both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* botão de ajuda "?" no topo de cada aba */
.help-dot {
  width: 21px; height: 21px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text-3); font-size: 12px; font-weight: 700; font-family: var(--font-body);
  display: grid; place-items: center; cursor: pointer; line-height: 1; padding: 0;
  transition: color .16s, border-color .16s, box-shadow .16s, transform .16s;
}
.help-dot:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); transform: translateY(-1px); }
.help-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-list { display: flex; flex-direction: column; gap: 13px; margin-top: 18px; }
.help-item { display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); line-height: 1.5; }
.help-item svg { color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.help-tip { margin-top: 20px; padding: 13px 15px; border-radius: var(--r); background: var(--accent-glow); border: 1px solid rgba(111,180,221,.22); font-size: 13px; color: var(--text-2); }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-1);
  font-weight: 500; font-size: 14px; cursor: pointer;
  transition: transform .12s var(--e-spring), background .16s, border-color .16s, box-shadow .16s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  border-color: rgba(111,180,221,.35); color: #fff;
  box-shadow: var(--sh-accent), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); color: var(--text-1); }
.btn-danger { color: var(--neg); border-color: rgba(229,100,107,.28); background: var(--neg-soft); }
.btn-danger:hover { background: rgba(229,100,107,.18); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { padding: 9px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============================ CARDS ============================ */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  transition: border-color .2s var(--e-out), box-shadow .2s var(--e-out);
}
.card-pad { padding: 20px; }

/* Card herói (o número grande — faturamento) */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--brand-300) 50%, var(--accent) 80%, transparent);
  opacity: .55;
}
.hero::after {
  content: ""; position: absolute; right: -30px; top: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%); pointer-events: none;
}
.hero-num { font-family: var(--font-display); font-weight: 600; letter-spacing: -.025em; color: #fff; display: inline-block; }
.hero-num.settle { animation: settle .32s var(--e-spring); }
@keyframes settle { 0% { transform: scale(1.035); } 100% { transform: scale(1); } }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--text-3); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.col-span-2 { grid-column: span 2; }

/* — Stat cards — */
.stat {
  position: relative; overflow: hidden;
  padding: 18px 20px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--sh-2);
  transition: transform .18s var(--e-out), border-color .18s var(--e-out);
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.stat::after {
  content:""; position:absolute; inset:0; border-radius: inherit; pointer-events:none;
  background: radial-gradient(120px 60px at 90% -20%, var(--accent-glow), transparent 70%);
}
.stat .stat-label { display:flex; align-items:center; gap:8px; font-size: 12.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.stat .stat-label svg { width: 15px; height: 15px; color: var(--accent); }
.stat .stat-value { font-family: var(--font-display); font-weight: 600; font-size: 27px; margin-top: 12px; letter-spacing: -.02em; }
.stat .stat-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.stat .stat-value.pos { color: var(--pos); }
.stat .stat-value.neg { color: var(--neg); }
.delta { font-size: 12px; padding: 2px 7px; border-radius: var(--r-pill); font-weight: 500; }
.delta.up { color: var(--pos); background: var(--pos-soft); }
.delta.down { color: var(--neg); background: var(--neg-soft); }

/* ============================ TABLES / LISTS ============================ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .14s; cursor: default; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--text-2); }
.chip.pos { color: var(--pos); background: var(--pos-soft); border-color: rgba(87,176,228,.25); }
.chip.neg { color: var(--neg); background: var(--neg-soft); border-color: rgba(229,100,107,.25); }
.chip.dot::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.pay { font-size: 12px; color: var(--text-2); }

/* ============================ FORMS ============================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line-strong); color: var(--text-1);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--surface); }
.input:disabled, .select:disabled { opacity: .5; cursor: not-allowed; background: var(--surface); }
.textarea { resize: vertical; min-height: 74px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236FB4DD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* — Seleção de pagamento / opções — */
.optset { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 9px 14px; border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text-2);
  font-size: 13.5px; transition: all .14s var(--e-out);
}
.opt:hover { border-color: var(--accent); color: var(--text-1); }
.opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt.sel { background: linear-gradient(140deg, rgba(47,110,150,.35), rgba(20,58,87,.2)); border-color: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }

/* ============================ SERVICE PICKER (Nova OS) ============================ */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.svc-card {
  padding: 13px 14px; border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); position: relative;
  transition: all .14s var(--e-out);
}
.svc-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--sh-2); }
.svc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.svc-card.sel { border-color: var(--accent); background: linear-gradient(150deg, rgba(47,110,150,.22), var(--surface)); }
.svc-card .svc-name { font-size: 13.5px; font-weight: 500; }
.svc-card .svc-cat { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.svc-card .svc-price { font-family: var(--font-display); font-size: 15px; margin-top: 8px; color: var(--accent); }
.svc-card .svc-qty { position:absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items:center; font-size: 12px; font-weight: 600; background: var(--accent); color: var(--accent-ink); opacity: 0; transform: scale(.6); transition: all .16s var(--e-spring); }
.svc-card.sel .svc-qty { opacity: 1; transform: none; }

.cart { position: sticky; top: 90px; }
.cart-line { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; gap: 10px; }
.cart-line:last-of-type { border-bottom: none; }
.cart-total { display:flex; justify-content: space-between; align-items:baseline; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.cart-total .big { font-family: var(--font-display); font-size: 28px; color: #fff; }

/* ============================ EMPTY STATE ============================ */
.empty { text-align: center; padding: 54px 20px; }
.empty-ic { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); }
.empty-ic svg { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--text-3); font-size: 13.5px; max-width: 340px; margin: 0 auto 18px; }

/* ============================ MODAL ============================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,6,10,.66); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .2s var(--e-out);
}
.modal {
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  animation: modalIn .34s var(--e-spring);
}
.modal.wide { max-width: 720px; }
.modal-head { display:flex; align-items:center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* ============================ TOAST ============================ */
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { display:flex; align-items:center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--sh-3); font-size: 14px; animation: toastIn .34s var(--e-spring); }
.toast svg { width: 18px; height: 18px; }
.toast.ok svg { color: var(--pos); }
.toast.err svg { color: var(--neg); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ============================ RECIBO ============================ */
.recibo {
  background: linear-gradient(180deg, #0d131c, #0a0f16);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  padding: 26px; color: var(--text-1);
}
.recibo-head { display:flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px dashed var(--line-strong); padding-bottom: 18px; margin-bottom: 18px; }
.recibo-brand { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .04em; }
.recibo-brand .sep { color: var(--accent); }
.recibo-meta { text-align: right; font-size: 12px; color: var(--text-3); }
.recibo-line { display:flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
.recibo-total { display:flex; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 20px; }
.recibo-foot { margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; }

/* ============================ CHARTS ============================ */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--brand-300), var(--brand-500)); box-shadow: inset 0 1px 0 rgba(255,255,255,.15); transition: height .6s var(--e-out); position: relative; }
.bar-col .bar-lbl { font-size: 11px; color: var(--text-3); }
.bar-col .bar-val { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display:flex; align-items:center; justify-content: space-between; font-size: 13px; }
.legend-item .lg-left { display:flex; align-items:center; gap: 9px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* — progress meta — */
.progress { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.progress > span { display:block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--brand-300)); box-shadow: 0 0 12px var(--accent-glow); transition: width .7s var(--e-out); }

/* ============================ LOCK ============================ */
.lock { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--bg); }
.lock-box { text-align: center; width: 300px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 22px 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); transition: all .2s; }
.pin-dot.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-key { padding: 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-display); font-size: 20px; cursor: pointer; transition: all .12s; }
.pin-key:hover { background: var(--surface-hover); }
.pin-key:active { transform: scale(.95); }

/* ============================ UTIL ============================ */
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--text-3); }
.sec-muted { color: var(--text-2); }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-r { text-align: right; }
.hide { display: none !important; }
.page-title { font-family: var(--font-display); font-size: 22px; margin-bottom: 4px; }
.page-sub { color: var(--text-3); font-size: 13.5px; margin-bottom: 22px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(150deg, var(--brand-500), var(--brand-700)); color:#fff; font-weight: 600; font-size: 14px; font-family: var(--font-display); flex: 0 0 auto; }
.list-item { display:flex; align-items:center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 500; font-size: 14.5px; }
.li-sub { font-size: 12.5px; color: var(--text-3); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 3px; }
.seg button { padding: 7px 14px; border-radius: var(--r-sm); border: none; background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; transition: all .14s; }
.seg button.on { background: var(--surface-3); color: #fff; box-shadow: var(--sh-1); }

/* botão flutuante (novo cliente) — acima da barra mobile */
.fab-cli { position: fixed; right: 28px; bottom: 28px; z-index: 50; box-shadow: var(--sh-3); }
@media (max-width: 900px) { .fab-cli { bottom: 84px; right: 16px; } }

/* mobile bottom nav (hidden on desktop) */
.mobile-nav { display: none; }

/* ============================ RESPONSIVO ============================ */
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: auto; }
  .view { padding: 20px 16px 96px; }
  .topbar { padding: 14px 16px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: linear-gradient(180deg, rgba(10,14,20,.85), rgba(8,11,16,.98));
    backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0));
    justify-content: space-around;
  }
  .mobile-nav a { display:flex; flex-direction: column; align-items:center; gap: 4px; color: var(--text-3); text-decoration: none; font-size: 11px; padding: 4px 8px; min-height: 44px; justify-content: center; border-radius: var(--r-sm); }
  .mobile-nav a svg { width: 22px; height: 22px; }
  .mobile-nav a.active { color: var(--accent); }
}
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }
@media (max-width: 380px) {
  .btn { padding: 12px 16px; min-height: 44px; }
  .nav-item { min-height: 44px; }
  .view { padding: 18px 12px 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  body::before, body::after { animation: none !important; }
}

/* ============================ PRINT (recibo A4) ============================ */
.print-area { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body { background: #fff !important; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  .print-recibo { color: #0A0E12; font-family: "Inter", system-ui, sans-serif; max-width: 720px; margin: 0 auto; }
  .print-recibo .pr-band { background: #143A57; height: 6px; border-radius: 3px; margin-bottom: 18px; }
  .print-recibo .pr-brand { font-family: "Sora", sans-serif; font-weight: 700; font-size: 24px; letter-spacing: .03em; color: #143A57; }
  .print-recibo .pr-brand .sep { color: #2F6E96; }
  .print-recibo .pr-slogan { color: #2F6E96; font-size: 12px; margin-top: 2px; }
  .print-recibo .pr-meta { font-size: 12px; color: #3A627C; }
  .print-recibo h2 { font-family: "Sora", sans-serif; font-size: 15px; color: #143A57; margin: 22px 0 8px; border-bottom: 1px solid #d4e0ec; padding-bottom: 5px; }
  .print-recibo table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .print-recibo th { text-align: left; color: #2F6E96; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 4px; border-bottom: 1px solid #d4e0ec; }
  .print-recibo td { padding: 8px 4px; border-bottom: 1px solid #eef3f8; font-variant-numeric: tabular-nums; }
  .print-recibo .pr-num { text-align: right; }
  .print-recibo .pr-total { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 14px 18px; background: #EAF3FA; border: 1px solid #6FB4DD; border-radius: 10px; }
  .print-recibo .pr-total .lbl { font-family: "Sora", sans-serif; font-weight: 600; color: #143A57; }
  .print-recibo .pr-total .val { font-family: "Sora", sans-serif; font-weight: 700; font-size: 26px; color: #143A57; font-variant-numeric: tabular-nums; }
  .print-recibo .pr-sign { margin-top: 48px; display: flex; justify-content: space-between; gap: 40px; }
  .print-recibo .pr-sign > div { flex: 1; border-top: 1px solid #9db4c9; padding-top: 6px; text-align: center; font-size: 11px; color: #3A627C; }
  .print-recibo .pr-foot { margin-top: 26px; text-align: center; font-size: 10.5px; color: #7089a0; }
}
