/* Neurazy App — cores, fontes, espaços e raios vêm de tokens.css */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  font: 400 15px/1.5 var(--font-sans);
  background: var(--surface); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
[hidden] { display: none !important; }
svg.ic { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Barras de rolagem finas, na cor do tema */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink-muted) 35%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink-muted) 35%, transparent); border-radius: var(--radius-pill); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--ink-muted) 60%, transparent); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 80; padding: 8px 16px; background: var(--lime); color: var(--night); border-radius: var(--radius-pill); }
.skip:focus { left: 8px; }

/* ---------- Estrutura ---------- */
.shell { --side-w: 248px; min-height: 100vh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side {
  position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column; gap: var(--space-6);
  padding: 20px 14px; background: var(--surface); color: var(--ink);
  border-right: 1px solid var(--line);
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 8px; min-height: 40px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.logo-mark { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink-muted); cursor: pointer;
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }

.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px;
  border-radius: 14px; text-decoration: none; white-space: nowrap; overflow: hidden;
  color: var(--ink-muted); font-weight: 600;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav a[aria-current="page"] { background: var(--violet); color: var(--ink-inverse); }

.side-foot { margin-top: auto; display: grid; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.save-status { display: flex; align-items: center; gap: 10px; min-height: 24px; font-size: .8rem; color: var(--ink-muted); padding-left: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex-shrink: 0; }
.save-status[data-state="saving"] .dot { background: var(--cyan); }
.save-status[data-state="error"] .dot { background: var(--ink); box-shadow: 0 0 0 2px var(--violet); }
.side-tools { display: flex; gap: 4px; }

/* Menu recolhido (só no computador) */
@media (min-width: 960px) {
  .side-collapsed .shell { --side-w: 76px; }
  .side-collapsed .side { padding-inline: 12px; }
  .side-collapsed .side-top { flex-direction: column; padding-left: 0; gap: 12px; }
  .side-collapsed .logo-full, .side-collapsed .nav-label { display: none; }
  .side-collapsed .logo-mark { display: block; }
  .side-collapsed .nav a { justify-content: center; padding: 0; }
  .side-collapsed .side-foot { padding-inline: 0; justify-items: center; }
  .side-collapsed .save-status { padding-left: 0; }
  .side-collapsed .side-tools { flex-direction: column; }
}

.mobilebar { display: none; }
.scrim { display: none; }
.main { padding: 40px 48px 64px; min-width: 0; outline: none; }

@media (max-width: 959px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .22s ease; }
  .side-collapse { display: none; }
  .menu-open .side { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: color-mix(in srgb, var(--night) 50%, transparent); }
  .mobilebar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20;
    padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .main { padding: 24px 16px 48px; }
}

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: 28px; }
.page-head p { color: var(--ink-muted); margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--ink-muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.back svg.ic { width: 16px; height: 16px; }
.back:hover { color: var(--violet); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px;
  padding: 0 20px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--violet); color: var(--ink-inverse);
}
.btn svg.ic { width: 18px; height: 18px; stroke-width: 2.2; }
.btn:hover { filter: brightness(1.08); }
.btn-lime { background: var(--lime); color: var(--night); }
.btn-ghost { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); filter: none; }
.btn-sm { height: 34px; padding: 0 14px; font-size: .875rem; }
.btn-link { background: none; border: 0; padding: 0; color: var(--violet); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; cursor: pointer;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-raised);
  color: var(--ink-muted); font-weight: 600; font-size: .875rem; text-decoration: none; white-space: nowrap;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* ---------- Cards ---------- */
.card { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.card + .card { margin-top: var(--space-4); }
.stack { display: grid; gap: var(--space-4); align-content: start; }
.stack > .card + .card, .grid > .card + .card, .fn-layout > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); min-height: 34px; }
.muted { color: var(--ink-muted); }
.small { font-size: .85rem; }
.empty { color: var(--ink-muted); }

.grid { display: grid; gap: var(--space-4); }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-main { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.gap-top { margin-top: var(--space-4); }

.stat { padding: 20px 24px; display: grid; gap: 6px; align-content: start; }
.stat dt { color: var(--ink-muted); font-size: .875rem; font-weight: 600; }
.stat dd { font: 700 1.8rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.stat-hl { background: var(--violet); border-color: var(--violet); color: var(--ink-inverse); }
.stat-hl dt { color: inherit; opacity: .85; }

.empty-state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 32px 16px; }
.empty-state .ic-circle { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--violet) 12%, transparent); color: var(--violet); margin-bottom: 4px; }
.empty-state h3 { font-size: 1rem; }
.empty-state p { color: var(--ink-muted); max-width: 32em; font-size: .92rem; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Pílulas ---------- */
.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: .78rem; font-weight: 600;
  background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); white-space: nowrap;
}
.pill-lime { background: var(--lime); color: var(--night); }
.pill-cyan { background: color-mix(in srgb, var(--cyan) 22%, transparent); color: var(--ink); }
.pill-night { background: var(--ink); color: var(--surface); }
.pill-line { background: transparent; border: 1px solid var(--line); color: var(--ink-muted); }

/* ---------- Formulários ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field > span, .label { font-size: .85rem; font-weight: 600; color: var(--ink-muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink);
}
.field textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--violet); outline-offset: 0; border-color: var(--violet); }
.form-grid { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.affix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.affix:focus-within { outline: 2px solid var(--violet); border-color: var(--violet); }
.affix > span { padding: 0 0 0 14px; color: var(--ink-muted); font-weight: 600; white-space: nowrap; }
.field .affix input { border: 0; outline: 0; background: transparent; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 8%, transparent); }
.option input { width: 18px; height: 18px; accent-color: var(--violet); }
.hint { font-size: .8rem; color: var(--ink-muted); }
.warn { padding: 12px 16px; border-radius: 12px; font-size: .9rem; background: color-mix(in srgb, var(--lime) 22%, var(--surface-raised)); color: var(--ink); }

/* Sim / Não e seletores em segmento */
.yn { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 12px 0; border-bottom: 1px solid var(--line); }
.yn:last-child { border-bottom: 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 6%, transparent); flex-shrink: 0; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: var(--radius-pill); cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--ink-muted); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--violet); color: var(--ink-inverse); }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line); margin-bottom: 28px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--ink-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--violet); border-color: var(--violet); }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

/* ---------- Configurações ---------- */
.set-row { display: grid; gap: 16px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.set-row:first-of-type { padding-top: 8px; }
.set-row:last-child { border-bottom: 0; }
.set-row h2 { font-size: 1.05rem; }
.set-row > div > p { color: var(--ink-muted); font-size: .9rem; margin-top: 6px; }
@media (min-width: 960px) { .set-row { grid-template-columns: 260px minmax(0, 640px); gap: 48px; } }
.item-edit { display: grid; gap: 8px; margin-bottom: 12px; }
.item-edit li { display: flex; align-items: center; gap: 8px; }
.item-edit .num { width: 24px; text-align: right; color: var(--ink-muted); font-size: .85rem; font-weight: 600; flex-shrink: 0; }
.inherit { display: grid; gap: 4px; padding: 12px 16px; margin-bottom: 12px; border-radius: 12px; background: color-mix(in srgb, var(--violet) 8%, transparent); font-size: .9rem; }

/* ---------- Funil (quadro) ---------- */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px;
  overflow-x: auto; padding-bottom: 12px; align-items: stretch; min-height: calc(100vh - 220px);
}
.col { display: flex; flex-direction: column; background: color-mix(in srgb, var(--ink) 4%, transparent); border-radius: var(--radius-lg); padding: 12px; }
.col.drop { outline: 2px dashed var(--violet); outline-offset: -2px; }
.col-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 6px 12px; min-height: 52px; align-content: flex-start; }
.col-head h2 { flex: 1 0 100%; }
.col-head h2 { font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.col-head .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink-muted); font: 600 .75rem/1 var(--font-sans); }
.col-head small { color: var(--ink-muted); font-weight: 600; white-space: nowrap; font-size: .8rem; }
.col-list { display: grid; gap: 8px; align-content: start; flex: 1; }
.col-empty { display: grid; place-items: center; min-height: 120px; border: 1px dashed var(--line); border-radius: 16px; color: var(--ink-muted); font-size: .85rem; text-align: center; padding: 12px; }
.deal {
  display: block; text-decoration: none; background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; cursor: grab;
}
.deal:hover { border-color: var(--violet); }
.deal.dragging { opacity: .5; }
.deal strong { display: block; font-family: var(--font-display); font-weight: 600; }
.deal .muted { font-size: .85rem; }
.deal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; font-size: .8rem; }
.deal-meta .pill { white-space: normal; height: auto; min-height: 24px; }

/* ---------- Listas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: color-mix(in srgb, var(--violet) 5%, transparent); }
td a { font-weight: 600; text-decoration: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--space-4); }
.search { position: relative; flex: 1; max-width: 360px; min-width: 220px; }
.search svg.ic { position: absolute; left: 14px; top: 12px; color: var(--ink-muted); }
.search .input { padding-left: 42px; }
.toolbar select.input { width: auto; }

.items { display: grid; }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.item-main strong { font-weight: 600; }
.item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.item-main a, td a { text-decoration: none; color: inherit; }
.item-main a:hover, td a:hover { color: var(--violet); }
.item-main .muted a { color: var(--ink); font-weight: 600; }
.item .icon-btn { width: 36px; height: 36px; }
.money { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.card-more { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; font-weight: 600; font-size: .875rem; color: var(--violet); text-decoration: none; }
.card-more:hover { text-decoration: underline; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-muted); font: 600 .8rem/1 var(--font-sans); }

.prop-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* Funil: visão em formato de funil. Cada etapa é um trapézio (clip-path); clicar filtra a lista ao lado. */
.fn-layout { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 1100px) { .fn-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.fn { display: grid; gap: 4px; }
.fn-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; align-items: center; }
.fn-seg {
  height: 60px; width: 100%; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: color-mix(in srgb, var(--violet) var(--tone), var(--surface-raised)); color: var(--ink);
  font: inherit; transition: filter .15s ease, background-color .15s ease;
}
.fn-seg.is-strong { color: var(--ink-inverse); }
.fn-seg:hover { filter: brightness(1.06) saturate(1.1); }
.fn-seg b { font: 700 1.35rem/1 var(--font-display); }
.fn-seg span { font-weight: 600; font-size: .9rem; white-space: nowrap; }
.fn-seg[aria-pressed="true"] { background: var(--lime); color: var(--night); }
.fn-seg:focus-visible { outline: none; filter: brightness(1.1); background: var(--lime); color: var(--night); }
.fn-meta { display: grid; gap: 2px; text-align: right; font-size: .85rem; }
.fn-meta b { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.fn-meta small { color: var(--ink-muted); font-size: .78rem; white-space: nowrap; }
.fn-lost { margin-top: 16px; }
.fn-list { display: grid; gap: 8px; }
.fn-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px;
  text-decoration: none; color: var(--ink); background: var(--surface-raised);
}
.fn-card:hover { border-color: var(--violet); }
.fn-card.is-late { border-color: var(--ink); }
.fn-card .who-ini { width: 36px; height: 36px; font-size: .8rem; }
.fn-card-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fn-card-main strong { font-weight: 600; }
.fn-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.who-ini { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); font: 700 .7rem/1 var(--font-sans); flex-shrink: 0; }
@media (max-width: 640px) {
  .fn-row { grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; }
  .fn-seg { height: 52px; gap: 6px; }
  .fn-seg b { font-size: 1.1rem; }
  .fn-seg span { font-size: .78rem; }
  .fn-card { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .fn-seg { transition: none; } }

/* Pagamentos */
.pay-status { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-muted); }
.pay-status svg.ic { width: 18px; height: 18px; }
.pay-status.is-paid { background: var(--lime); color: var(--night); }
.pay-status.is-paid svg.ic { stroke-width: 2.6; }
.item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; flex-shrink: 0; width: 140px; }
.pay-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-muted); }
.pay-total b { color: var(--ink); font-family: var(--font-display); margin-left: 6px; }
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px 16px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 16px; color: var(--ink-muted);
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--violet); color: var(--violet); }
.dropzone.has-file { border-style: solid; border-color: var(--violet); background: color-mix(in srgb, var(--violet) 6%, transparent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-text { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

/* Painel: grade 2×2, cards da mesma linha com a mesma altura */
.dash { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.dash > .card { margin: 0; display: flex; flex-direction: column; }
.dash > .card > .card-more { margin-top: auto; }
.dash > .card > .bars { flex: 1; align-content: space-between; }
@media (min-width: 1100px) { .dash { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.item-date { flex-shrink: 0; width: 44px; height: 48px; display: grid; place-content: center; text-align: center; line-height: 1.1; border-radius: 12px; background: color-mix(in srgb, var(--violet) 10%, transparent); }
.item-date b { display: block; font: 700 1.1rem/1 var(--font-display); color: var(--violet); }
.item-date span { font-size: .7rem; color: var(--ink-muted); text-transform: uppercase; font-weight: 600; }
.item.done .item-main strong { text-decoration: line-through; color: var(--ink-muted); }
.group-title { font: 600 .75rem/1 var(--font-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); margin: 24px 0 4px; }
.group-title:first-child { margin-top: 0; }

.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 128px 1fr 28px; gap: 12px; align-items: center; font-size: .875rem; }
.bar-track { height: 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 7%, transparent); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--violet); }
.bar b { text-align: right; }

.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--violet); }
.timeline li:last-child { border-left-color: transparent; }
.timeline time { display: block; font-size: .8rem; color: var(--ink-muted); }

.suggest { border: 2px solid var(--violet); }
.suggest h3 { font-size: 1.3rem; margin: 10px 0 6px; }

/* ---------- Painel lateral (formulários) ---------- */
.drawer {
  inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; height: 100dvh; max-height: 100dvh;
  width: min(480px, 100vw); max-width: 100vw; background: var(--surface-raised); color: var(--ink);
  box-shadow: -24px 0 48px color-mix(in srgb, var(--night) 20%, transparent);
}
.drawer[open] { animation: drawer-in .24s ease-out; }
.drawer::backdrop { background: color-mix(in srgb, var(--night) 45%, transparent); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer form { display: flex; flex-direction: column; min-height: 100%; }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 24px 24px 20px; background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.drawer-head p { color: var(--ink-muted); font-size: .9rem; margin-top: 4px; }
.drawer-body { flex: 1; display: grid; gap: 18px; align-content: start; padding: 24px; }
.drawer-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 24px; background: var(--surface-raised); border-top: 1px solid var(--line); }
.drawer-foot .left { margin-right: auto; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface); font-weight: 600;
  transition: opacity .2s, transform .2s; z-index: 90; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Entrada ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6) var(--space-4); background: var(--surface); color: var(--ink); }
.login-box { width: min(400px, 100%); display: grid; gap: var(--space-6); }
.login-box form { display: grid; gap: var(--space-4); }
.login-box h1 { font-size: 1.6rem; }
.login-box p { color: var(--ink-muted); }
.login-box .btn { width: 100%; }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.login-error { color: var(--ink); background: color-mix(in srgb, var(--violet) 22%, transparent); padding: 10px 14px; border-radius: 12px; font-size: .9rem; }

/* ---------- Proposta (página para o cliente) ---------- */
.doc-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); max-width: 820px; margin-inline: auto; }
.doc-bar .back { margin: 0; }
.doc-warn { max-width: 820px; margin: 0 auto var(--space-4); }
.doc { max-width: 820px; margin: 0 auto; background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.doc-top { position: relative; isolation: isolate; overflow: hidden; background: var(--surface); color: var(--ink); padding: 40px; }
.doc-top .dots { position: absolute; inset: 0; z-index: -1; opacity: .18; color: var(--violet); }
.doc-top .logo { width: 150px; height: auto; }
.doc-top h1 { margin-top: 32px; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); }
.doc-top p { margin-top: 8px; color: var(--ink-muted); }
.doc-body { padding: 40px; display: grid; gap: 32px; }
.doc-pack { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-pack h2 { font-size: 1.6rem; }
.checklist { display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--violet) 14%, transparent); }
.checklist li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 8px; height: 5px; border-left: 2px solid var(--violet); border-bottom: 2px solid var(--violet); transform: rotate(-45deg); }
.price-box { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .price-box { grid-template-columns: 1fr 1fr; } }
.price { border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.price-main { border: 2px solid var(--violet); }
.price span { font-size: .85rem; color: var(--ink-muted); font-weight: 600; }
.price b { display: block; font: 700 1.7rem/1.2 var(--font-display); margin-top: 4px; }
.price small { color: var(--ink-muted); }
.terms { display: grid; gap: 8px; color: var(--ink-muted); font-size: .92rem; }
.terms strong { color: var(--ink); }
.doc-foot {
  display: grid; gap: 24px; align-items: center; padding: 32px 40px;
  background: var(--surface); color: var(--ink);
}
@media (min-width: 720px) { .doc-foot { grid-template-columns: auto 1fr; gap: 40px; } }
.doc-foot-brand { display: flex; align-items: center; gap: 14px; }
.doc-foot-brand strong { display: block; font: 700 1.1rem/1.2 var(--font-display); text-transform: lowercase; letter-spacing: -0.02em; }
.doc-foot-brand span { color: var(--ink-muted); font-size: .9rem; }
.doc-contacts { display: grid; gap: 10px 24px; }
@media (min-width: 560px) { .doc-contacts { grid-template-columns: repeat(2, minmax(0, max-content)); justify-content: end; } }
.doc-contacts a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: .92rem; color: var(--ink); }
.doc-contacts a:hover { color: var(--violet); }
.doc-contacts svg.ic { width: 18px; height: 18px; color: var(--violet); }

@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .side, .mobilebar, .doc-bar, .doc-warn, .skip, .toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .doc { border: 0; max-width: none; }
  .doc-top, .doc-foot, .pill-lime, .price-main { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .side { transition: none; }
  .drawer[open] { animation: none; }
}

/* ---------- Celular ---------- */
.tabbar { display: none; }
@media (max-width: 959px) {
  .main { padding: 20px 16px 104px; }
  .mobilebar-new { margin-left: auto; color: var(--violet); }
  .tabbar {
    display: flex; justify-content: space-around; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface-raised); border-top: 1px solid var(--line);
  }
  .tabbar a {
    flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px;
    color: var(--ink-muted); text-decoration: none; font-size: .7rem; font-weight: 600;
  }
  .tabbar a[aria-current="page"] { color: var(--violet); background: color-mix(in srgb, var(--violet) 10%, transparent); }
  .toast { bottom: 92px; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .card { padding: 18px; border-radius: 20px; }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat dt { font-size: .78rem; }
  .stat dd { font-size: 1.25rem; }
  .page-head { margin-bottom: 20px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1 1 auto; }
  .page-head .actions > .field { flex-basis: 100%; }
  .tabs a { padding: 10px 12px; }

  /* Lista de clientes: tabela vira cartões */
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  td { padding: 0; border: 0; }
  td:first-child { flex: 1 0 100%; }
  td:has(> .muted:only-child) { display: none; }
  td:last-child { margin-left: auto; font-family: var(--font-display); font-weight: 600; }
  td[colspan] { flex-basis: 100%; }

  /* Linhas com valor e ações (pagamentos) quebram em duas */
  .item:has(.item-actions) { flex-wrap: wrap; }
  .item:has(.item-actions) .item-main { flex: 1 1 calc(100% - 52px); }
  .item:has(.item-actions) .money { margin-left: 50px; }
  .item-actions { width: auto; margin-left: auto; }
  .pay-total { flex-direction: column; align-items: flex-start; }

  .set-row { padding: 20px 0; }
  .doc-top, .doc-body { padding: 24px; }
  .doc-foot { padding: 24px; }
}
