/* Alvori Gestão · estilos. Mobile-first; a partir de 900px vira layout de desktop com menu lateral. */
:root {
  --navy: #121A4A; --navy-2: #1C2563; --orange: #FF7424; --orange-d: #E45F12; --cream: #FFF8EE;
  --sun: linear-gradient(90deg, #FFD43B, #FF8A26 55%, #F2461E);
  --bg: #F5F3EE; --surface: #FFFFFF; --surface-2: #FBFAF7; --line: #E7E2D8; --ink: #121A4A; --ink-2: #3A4170;
  --muted: #6B7090; --focus: #FF7424;
  --ok: #1F9D63; --ok-bg: #E3F5EC; --warn: #B07A00; --warn-bg: #FFF3D1; --bad: #C8352B; --bad-bg: #FDE8E6;
  --info: #3355CC; --info-bg: #E8EDFF; --neutral-bg: #EEEDF3;
  --r: 16px; --r-sm: 9px; --shadow: 0 1px 2px rgba(18,26,74,.05), 0 8px 24px -8px rgba(18,26,74,.10);
  --shadow-up: 0 2px 4px rgba(18,26,74,.06), 0 16px 32px -12px rgba(18,26,74,.20);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --nav-h: 64px; --side-w: 240px;
  --ease: cubic-bezier(.22,1,.36,1);
  /* gráficos: cores validadas (daltonismo e contraste) para receita/despesa; grade discreta */
  --s-rec: #2F44C9; --s-desp: #F26A1B; --grade: #ECE8DF; --hover: rgba(18,26,74,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #0C1130; --surface: #141B42; --surface-2: #18204D; --line: #263064; --ink: #F3F1EC; --ink-2: #C9CCE6;
    --muted: #8E94B8; --ok-bg: #123A2C; --warn-bg: #3A2F0E; --bad-bg: #43171A; --info-bg: #1B2A66; --neutral-bg: #222A5A;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-up: 0 2px 4px rgba(0,0,0,.3), 0 16px 32px -12px rgba(0,0,0,.55);
    --s-rec: #6373E6; --s-desp: #E8661C; --grade: #222B5C; --hover: rgba(255,255,255,.05); color-scheme: dark;
  }
}
:root[data-tema="escuro"] {
  --bg: #0C1130; --surface: #141B42; --surface-2: #18204D; --line: #263064; --ink: #F3F1EC; --ink-2: #C9CCE6;
  --muted: #8E94B8; --ok-bg: #123A2C; --warn-bg: #3A2F0E; --bad-bg: #43171A; --info-bg: #1B2A66; --neutral-bg: #222A5A;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-up: 0 2px 4px rgba(0,0,0,.3), 0 16px 32px -12px rgba(0,0,0,.55);
  --s-rec: #6373E6; --s-desp: #E8661C; --grade: #222B5C; --hover: rgba(255,255,255,.05); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 800; } h2 { font-size: 17px; font-weight: 700; } h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-escuro { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .so-claro { display: none; } :root:not([data-tema="claro"]) .so-escuro { display: inline-block; } }
:root[data-tema="escuro"] .so-claro { display: none; } :root[data-tema="escuro"] .so-escuro { display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell */
.app { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top)); background: var(--navy); color: #fff; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--sun); opacity: .9; }
.topbar .logo { height: 22px; display: block; }
.topbar .sp { flex: 1; }
.main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.page-head h1 { flex: 1; min-width: 180px; letter-spacing: -0.02em; }
.page-head h1::after { content: ""; display: block; width: 32px; height: 3px; margin-top: 6px; border-radius: 3px; background: var(--sun);
  transform-origin: left; animation: crescerX .7s .1s var(--ease) backwards; }
.page-head > .grow { flex: 1 1 220px; min-width: 0; }
@media (max-width: 699px) { .page-head > .grow { flex-basis: calc(100% - 56px); } .page-head h1 { font-size: 20px; } }

.sidebar { display: none; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none;
  font-size: 11px; font-weight: 600; color: var(--muted); transition: color .2s; -webkit-tap-highlight-color: transparent; }
.bottomnav a.on { color: var(--orange-d); }
.bottomnav svg, .sidebar svg { width: 22px; height: 22px; }
.bottomnav svg { box-sizing: content-box; padding: 3px 14px; border-radius: 999px; transition: background .25s var(--ease), transform .25s var(--ease); }
.bottomnav a.on svg { background: rgba(255,116,36,.15); }
.bottomnav a:active svg { transform: scale(.92); }

@media (min-width: 900px) {
  .app { padding-bottom: 0; padding-left: var(--side-w); }
  .bottomnav { display: none; }
  .topbar { display: none; }
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); padding: 20px 14px;
    background: radial-gradient(160% 34% at 50% 112%, rgba(255,138,38,.30), rgba(242,70,30,.08) 45%, transparent 70%), var(--navy);
    color: #fff; z-index: 25; }
  .sidebar nav a { transition: background .2s, color .2s, box-shadow .25s var(--ease); }
  .sidebar nav a svg { transition: transform .25s var(--ease); }
  .sidebar nav a:hover svg { transform: translateX(2px); }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
  .sidebar .brand img { height: 26px; }
  .sidebar .brand span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #C9CCE6; font-weight: 700; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 10px;
    text-decoration: none; color: #C9CCE6; font-weight: 600; }
  .sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .sidebar nav a.on { background: rgba(255,116,36,.16); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
  .sidebar .foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(201,204,230,.15); font-size: 13px; color: #C9CCE6; }
  .main { padding: 28px 32px 48px; }
}

/* ---------- cards e grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
@media (min-width: 900px) { .card { padding: 18px 20px; } }
a.card, .card.click { cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
a.card:hover, .card.click:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
a.card:active, .card.click:active { transform: translateY(0) scale(.99); }
.card-sub { font-size: 12px; color: var(--muted); margin: -8px 0 12px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { flex: 1; }
.grid { display: grid; gap: 12px; } .grid > * { min-width: 0; }
@media (min-width: 900px) { .grid { gap: 14px; } }
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.two { grid-template-columns: 1fr; } @media (min-width: 1100px) { .two { grid-template-columns: 1fr 1fr; } }
.tres { grid-template-columns: 1fr; } @media (min-width: 760px) { .tres { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1320px) { .tres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mini-desp .mini { color: var(--s-desp); }
.kpi { padding: 14px 16px; }
.kpi { position: relative; overflow: hidden; }
.kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1200px) { .kpi .v { font-size: 25px; } }
@media (max-width: 380px) { .kpi .v { font-size: 19px; } }
.kpi .l { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi.accent { background: radial-gradient(90% 80% at 105% 125%, rgba(255,138,38,.42), rgba(242,70,30,.12) 50%, transparent 75%), var(--navy);
  color: #fff; border-color: var(--navy); }
.kpi .medidor { margin-top: 8px; }
.kpi.accent .l { color: #C9CCE6; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent .hint { color: #C9CCE6; }

/* ---------- botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, transform .15s var(--ease), box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { box-shadow: 0 4px 14px -4px rgba(255,116,36,.55); }
@media (max-width: 899px) { .page-head .so-desk { display: none; } }
@media (max-width: 599px) { .page-head .btn .rot { display: none; } .page-head .btn:has(.rot) { padding: 0 11px; } }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #121A4A; }
.btn.primary:hover { background: var(--orange-d); border-color: var(--orange-d); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 40px; padding: 0; }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .55; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(255,116,36,.18); }
.check { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.search { position: relative; flex: 1; min-width: 180px; max-width: 420px; }
.search .input { padding-left: 38px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- selos */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--neutral-bg); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); } .b-info { background: var(--info-bg); color: var(--info); }
.b-orange { background: rgba(255,116,36,.14); color: var(--orange-d); }

/* ---------- listas: tabela no desktop, cartões no celular */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; cursor: pointer; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.item:active { transform: scale(.99); }
.item:hover { border-color: var(--ink-2); }
.item .t { font-weight: 700; } .item .s { font-size: 13px; color: var(--muted); }
.item .right { margin-left: auto; text-align: right; flex: none; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; }
.only-desk { display: none; } @media (min-width: 900px) { .only-desk { display: block; } .only-mob { display: none; } table.only-desk { display: table; } }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------- kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(82%, 1fr); gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
@media (min-width: 700px) { .kanban { grid-auto-columns: minmax(270px, 1fr); } }
@media (min-width: 900px) { .kanban { margin: 0; padding-left: 0; padding-right: 0; } }
.col { scroll-snap-align: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
  display: flex; flex-direction: column; min-height: 220px; max-height: calc(100dvh - 210px); }
.col.over { border-color: var(--orange); box-shadow: inset 0 0 0 2px rgba(255,116,36,.25); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.col-head h3 { flex: 1; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.col-head .n { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 8px; }
.col-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; padding: 2px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: grab;
  box-shadow: 0 1px 1px rgba(18,26,74,.04); animation: subir .35s var(--ease) backwards;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, opacity .2s; }
@media (hover: hover) { .kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: var(--ink-2); } }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard .t { font-weight: 700; font-size: 14px; }
.kcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.kcard .move { margin-top: 8px; }
.kcard .move select { min-height: 32px; font-size: 13px; padding: 4px 8px; }
@media (hover: hover) and (pointer: fine) { .kcard .move { display: none; } }
.prio-urgente { border-left: 4px solid var(--bad); } .prio-alta { border-left: 4px solid var(--orange); }
.prio-media { border-left: 4px solid #C9CCE6; } .prio-baixa { border-left: 4px solid var(--line); }

/* ---------- progresso, gráficos, status */
.bar { height: 8px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--sun); border-radius: 999px; transform-origin: left;
  animation: crescerX .9s var(--ease) both; }

.viz { position: relative; width: 100%; outline-offset: 4px; touch-action: pan-y; }
.viz svg { display: block; overflow: visible; }
.viz .grade { stroke: var(--grade); stroke-width: 1; }
.viz .base { stroke: var(--line); stroke-width: 1; }
.viz .eixo { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .eixo.forte { fill: var(--ink); font-weight: 700; }
.viz .prev { opacity: .34; }
.viz .faixa-hover { fill: var(--hover); }
.viz .alvo { fill: transparent; cursor: crosshair; }
.viz .linha { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viz .linha.tracejada { stroke-dasharray: 5 4; opacity: .8; animation: aparecer .8s .4s both; }
.viz .area { opacity: .10; animation: aparecer .9s .3s both; }
.viz .cursor { stroke: var(--muted); stroke-width: 1; }
.viz .ref { stroke: var(--warn); stroke-width: 1; opacity: .6; }
.viz .ponta, .viz .marca { stroke: var(--surface); stroke-width: 2; }
.viz .valor-final { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; animation: aparecer .5s .9s both; }
.viz .cresce { transform-box: fill-box; transform-origin: 50% 100%; animation: crescerY .75s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 35ms); }
.viz .tracar, .mini .tracar { stroke-dasharray: 1; animation: tracar 1.1s cubic-bezier(.4,0,.2,1) both; }
.viz-vazio { position: absolute; inset: 0 0 26px 44px; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.dica { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 9px 11px; border-radius: 10px;
  background: var(--navy); color: #fff; box-shadow: 0 10px 30px rgba(12,17,48,.28); font-size: 12px; animation: aparecer .12s ease; }
.dica.esq { transform: translateX(-100%); }
.dica-t { font-weight: 700; color: #C9CCE6; margin-bottom: 4px; text-transform: capitalize; }
.dica-l { display: flex; align-items: center; gap: 8px; line-height: 1.7; white-space: nowrap; }
.dica-l b { font-size: 13px; }
.dica-l span { color: #C9CCE6; }
.dica-l i { width: 12px; height: 3px; border-radius: 2px; background: var(--cor); flex: none; }
.dica-l i.claro { opacity: .45; } .dica-l i.tracejada { background: repeating-linear-gradient(90deg, var(--cor) 0 4px, transparent 4px 6px); }
.dica-l i.ponto { width: 8px; height: 8px; border-radius: 50%; }
:root[data-tema="escuro"] .dica { background: #232C66; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .dica { background: #232C66; } }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--cor); }
.legenda .sw.claro { opacity: .38; }
.legenda .sw.linha { width: 14px; height: 2px; border-radius: 2px; }
.legenda .sw.tracejada { width: 14px; height: 2px; background: repeating-linear-gradient(90deg, var(--cor) 0 4px, transparent 4px 6px); }
.legenda .sw.ponto { border-radius: 50%; }
.ver-tabela { margin-top: 10px; font-size: 13px; }
.ver-tabela summary { cursor: pointer; color: var(--muted); font-weight: 600; width: max-content; }
.ver-tabela summary:hover { color: var(--ink); }
.tbl-scroll { overflow-x: auto; margin-top: 8px; }
.tbl-scroll .tbl td, .tbl-scroll .tbl th { padding: 6px 10px; white-space: nowrap; }

.barras { display: flex; flex-direction: column; gap: 10px; container-type: inline-size; }
.barra-l { display: grid; grid-template-columns: minmax(96px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.barra-l .rot { display: flex; flex-direction: column; min-width: 0; color: var(--ink-2); font-weight: 600; }
.barra-l .nota { font-size: 11px; color: var(--muted); font-weight: 500; }
.barra-l .trilho { display: flex; gap: 2px; height: 10px; transform-origin: left; animation: crescerX .8s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms); }
.barra-l .trilho i { display: block; height: 100%; background: var(--cor); min-width: 2px; transition: filter .15s; }
.barra-l .trilho i:last-child { border-radius: 0 4px 4px 0; }
.barra-l .trilho .prev { opacity: .34; }
.barra-l:hover .trilho i { filter: brightness(1.08) saturate(1.1); }
.barra-l .val { min-width: 64px; text-align: right; font-size: 13px; }
@container (max-width: 440px) {
  .barra-l { grid-template-columns: 1fr auto; grid-template-areas: "rot val" "trilho trilho"; row-gap: 5px; }
  .barra-l .rot { grid-area: rot; flex-direction: row; gap: 6px; align-items: baseline; } .barra-l .val { grid-area: val; }
  .barra-l .trilho { grid-area: trilho; }
}

.mini { margin-top: 8px; height: 34px; color: var(--s-rec); }
.mini svg { display: block; overflow: visible; }
.mini .linha { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.mini .area { opacity: .08; }
.mini .ponta { fill: var(--orange); stroke: var(--surface); stroke-width: 2; animation: aparecer .4s 1s both; }
.kpi.accent .mini { color: #C9CCE6; } .kpi.accent .mini .ponta { stroke: var(--navy); }

.faixa-wrap { min-width: 0; }
.faixa { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 22px; }
.faixa i { border-radius: 3px; background: var(--ok); opacity: .85; transform-origin: bottom; animation: crescerY .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 18ms); transition: opacity .15s, transform .15s; }
.faixa i:hover { opacity: 1; transform: scaleY(1.15); }
.faixa i.lento { background: #E0A100; } .faixa i.offline { background: var(--bad); } .faixa i.vazio { background: var(--neutral-bg); opacity: 1; }
.faixa-eixo { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.sis-linha { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) 70px; gap: 14px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; }
.sis-linha:last-child { border-bottom: 0; }
.sis-linha:hover .faixa i { opacity: 1; }
@media (max-width: 560px) { .sis-linha { grid-template-columns: minmax(0, 1fr) 64px; } .sis-linha .faixa-wrap { grid-column: 1 / -1; grid-row: 2; } }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.online { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); } .dot.lento { background: #E0A100; box-shadow: 0 0 0 4px var(--warn-bg); }
.dot.offline { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px var(--bad-bg); } }
.sys-grid { grid-template-columns: 1fr; } @media (min-width: 700px) { .sys-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .sys-grid { grid-template-columns: repeat(3, 1fr); } }
.checklist .et { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.checklist .et input { width: 20px; height: 20px; accent-color: var(--orange); flex: none; }
.checklist .et.ok span { text-decoration: line-through; color: var(--muted); }
.timeline .ev { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .ev .when { flex: none; width: 74px; font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; border: 0; background: none; padding: 10px 12px; font-weight: 700; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--orange); }

/* ---------- modal (folha no celular) e avisos */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(12,17,48,.45); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease; }
.modal { width: 100%; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 18px 16px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: up .2s cubic-bezier(.22,1,.36,1); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { flex: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@media (min-width: 700px) { .overlay { align-items: center; } .modal { max-width: 640px; border-radius: 18px; padding: 22px; } }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(24px); opacity: .6; } }
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { padding: 12px 14px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow); font-weight: 600;
  animation: up .2s ease; } .toast.erro { background: var(--bad); }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 35; width: 56px; height: 56px;
  border-radius: 18px; border: 0; background: var(--orange); color: var(--navy); box-shadow: 0 8px 24px rgba(255,116,36,.4); cursor: pointer; }
.fab svg { width: 26px; height: 26px; } @media (min-width: 900px) { .fab { display: none; } }
.offline-banner { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: 13px; font-weight: 700; padding: 6px; }

/* ---------- login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.login::after { content: ""; position: absolute; left: 50%; bottom: -170px; width: 380px; height: 380px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 50% 30%, #FFD43B, #FF8A26 55%, #F2461E); opacity: .9;
  box-shadow: 0 0 120px 30px rgba(255,138,38,.25); animation: nascer 1.8s var(--ease) backwards; }
.login .box { animation: subir .7s .25s var(--ease) backwards; }
.login::before { content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 12px; background: var(--sun); z-index: 1; }
.login .box { position: relative; z-index: 2; width: min(100%, 400px); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 28px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login .box img { height: 30px; margin-bottom: 18px; }
.login .box p { color: var(--muted); margin: 6px 0 18px; }

/* ---------- movimento leve: entrada das telas, cartões em sequência, carregamento */
.rota { animation: entrar .4s var(--ease) backwards; }
.rota .stack > *, .rota .grid > *, .rota .list > * { animation: subir .5s var(--ease) backwards; }
.rota .stack > :nth-child(2), .rota .grid > :nth-child(2), .rota .list > :nth-child(2) { animation-delay: 40ms; }
.rota .stack > :nth-child(3), .rota .grid > :nth-child(3), .rota .list > :nth-child(3) { animation-delay: 80ms; }
.rota .stack > :nth-child(4), .rota .grid > :nth-child(4), .rota .list > :nth-child(4) { animation-delay: 120ms; }
.rota .stack > :nth-child(5), .rota .grid > :nth-child(5), .rota .list > :nth-child(5) { animation-delay: 160ms; }
.rota .stack > :nth-child(6), .rota .grid > :nth-child(6), .rota .list > :nth-child(6) { animation-delay: 200ms; }
.rota .stack > :nth-child(n+7), .rota .grid > :nth-child(n+7), .rota .list > :nth-child(n+7) { animation-delay: 240ms; }
.skel { display: grid; gap: 12px; }
.skel i { display: block; height: 76px; border-radius: var(--r); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%; border: 1px solid var(--line); animation: brilho 1.4s ease-in-out infinite; }
.skel i:nth-child(2) { height: 220px; } .skel i:nth-child(3) { height: 120px; }
.toast { animation: toastIn .35s var(--ease) backwards; }

@keyframes entrar { from { opacity: 0; transform: translateY(6px); } }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } }
@keyframes aparecer { from { opacity: 0; } }
@keyframes crescerY { from { transform: scaleY(0); } }
@keyframes crescerX { from { transform: scaleX(0); } }
@keyframes tracar { from { stroke-dashoffset: 1; } }
.girando { display: inline-flex; animation: girar .9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes brilho { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes nascer { from { transform: translate(-50%, 110px); opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- compositor de proposta (catálogo à esquerda, proposta à direita) */
.modal:has(.compositor) { max-width: 1180px; }
.compositor h3 { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 8px; }
.comp-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.comp-grid > * { min-width: 0; }
.comp-cat { display: flex; flex-direction: column; gap: 10px; order: 2; }
.comp-cat .search { max-width: none; }
@media (min-width: 980px) {
  .comp-grid { grid-template-columns: minmax(300px, 380px) 1fr; }
  .comp-cat { order: 0; border-right: 1px solid var(--line); padding-right: 18px; }
}
.pacotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pacote { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px;
  transition: border-color .15s var(--ease), transform .15s var(--ease); }
.pacote:hover { border-color: var(--orange); transform: translateY(-1px); }
.cat-lista { display: flex; flex-direction: column; gap: 6px; max-height: 46dvh; overflow: auto; padding-right: 2px; }
.cat-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.cat-item:hover { background: var(--surface-2); border-color: var(--ink-2); }
.cat-item .mais { flex: none; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--cream);
  color: var(--orange-d); }
.cat-item .mais svg { width: 16px; height: 16px; }
.linhas { display: flex; flex-direction: column; gap: 8px; }
.linha { display: grid; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  grid-template-columns: 1fr 1fr auto; grid-template-areas: "nome nome nome" "q p a" "v v v"; animation: subir .25s var(--ease); }
.linha.ajuste { border-style: dashed; }
.linha .l-nome { grid-area: nome; display: flex; flex-direction: column; gap: 3px; }
.linha .l-q { grid-area: q; } .linha .l-p { grid-area: p; } .linha .l-a { grid-area: a; display: flex; }
.linha .l-v { grid-area: v; text-align: right; }
.linha label { display: flex; flex-direction: column; gap: 3px; }
.linha .input { min-height: 36px; padding: 6px 10px; }
@media (min-width: 700px) {
  .linha { grid-template-columns: 1fr 86px 118px 112px auto; grid-template-areas: "nome q p v a"; }
  .linha .l-v { align-self: center; padding-top: 14px; }
}
.totais { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 6px;
  background-image: radial-gradient(70% 120% at 100% 120%, rgba(255,138,38,.35), transparent 70%); }
.totais > div { display: flex; justify-content: space-between; gap: 12px; }
.totais .tiny.muted { color: #C9CCE6; }
.totais .total { border-top: 1px solid rgba(255,255,255,.18); padding-top: 8px; font-size: 18px; }
.totais .aviso { display: block; background: rgba(255,212,59,.16); color: #FFE7A3; border-radius: 8px; padding: 6px 10px; font-size: 13px; }

/* ---------- tabela de preços */
.classes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.classe { display: flex; gap: 12px; align-items: flex-start; }
.classe .sigla { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  background: var(--navy); color: #fff; box-shadow: inset 0 -3px 0 var(--orange); }
.regras { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.refs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ref { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ref span { font-size: 12px; color: var(--muted); } .ref b { font-size: 18px; }
.ref.destaque { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: inset 0 -3px 0 var(--orange); }
.ref.destaque span { color: #C9CCE6; }
.pendente { border-color: var(--orange); background: var(--cream); color: var(--navy); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.preco-linha { display: inline-flex; align-items: center; gap: 6px; }
.preco-linha .input { width: 112px; min-height: 34px; padding: 5px 8px; text-align: right; }
.pendente .btn { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- aviso de versão nova (botão Atualizar) */
.atualizacao { position: fixed; z-index: 55; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--navy); color: #fff;
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 34px -10px rgba(12,17,48,.55); animation: subir .35s var(--ease); }
.atualizacao .tiny { color: #C9CCE6; display: block; }
.atualizacao .sol-ponto { flex: none; width: 12px; height: 12px; border-radius: 999px; background: var(--sun); box-shadow: 0 0 0 4px rgba(255,138,38,.18); }
@media (min-width: 900px) { .atualizacao { left: auto; right: 20px; bottom: 20px; max-width: 420px; } }
.list .item .btn .rot { display: none; }          /* lista do celular: anexar só com o ícone */
.sys-valores { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- rascunhos, IA e ações de campo nos formulários ---------- */
.rascunho-aviso { background: var(--surface-2, rgba(255,116,36,.08)); border: 1px solid var(--line); border-left: 3px solid var(--orange);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--orange); font: inherit; text-decoration: underline; cursor: pointer; }
.ia-painel { display: flex; flex-direction: column; gap: 8px; padding: 12px; margin-bottom: 12px; border: 1px dashed var(--orange); border-radius: 10px; }
.campo-acao { position: relative; display: flex; flex-direction: column; min-width: 0; }
.campo-acao.full { grid-column: 1 / -1; }
.campo-acao > .field { margin: 0; }
.field .acao, .campo-acao > .acao { align-self: flex-start; margin-top: 4px; min-height: 28px; font-size: 12px; color: var(--orange); }
h2.secao { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; }
.nowrap { white-space: nowrap; }

/* ---------- cobrança, notas, banco e alertas ---------- */
.pix-box { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin: 10px 0; }
.pix-box .qr { width: 150px; height: 150px; background: #fff; padding: 6px; border-radius: 8px; flex: none; }
.pix-box .qr svg { width: 100%; height: 100%; }
.pix-codigo { display: block; word-break: break-all; font-size: 11px; margin: 6px 0; padding: 8px; border-radius: 6px; background: var(--surface-2, rgba(0,0,0,.05)); }
pre.xml { max-height: 50vh; overflow: auto; font-size: 11px; padding: 10px; border-radius: 8px; background: var(--surface-2, rgba(0,0,0,.05));
  white-space: pre-wrap; word-break: break-all; }
.candidatos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.candidatos .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banco-item { align-items: flex-start; }
.alertas .alerta { text-decoration: none; color: inherit; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.alertas .alerta:last-child { border-bottom: 0; }
.alertas .alerta b { max-width: 45%; }
@media (max-width: 599px) { .alertas .alerta { flex-wrap: wrap; } .alertas .alerta b { max-width: 100%; } }
