/* Kit visual · tokens, base e componentes.
   Troque as cores do :root (e dos blocos de tema claro) para mudar a identidade do painel inteiro.
   Tema: segue o sistema; force com <html data-theme="dark|light">. */
:root {
  --bg: #050D1A;
  --bg2: #0A1A30;
  --panel: rgba(14, 34, 61, .58);
  --panel-solid: #0C1F38;
  --panel-hi: rgba(36, 158, 226, .08);
  --line: rgba(148, 163, 184, .13);
  --line2: rgba(148, 163, 184, .24);
  --text: #E8F1FB;
  --muted: #94A3B8;
  --faint: #5E708A;
  --navy: #0F2744;
  --petrol: #135C7B;
  --sky: #249EE2;
  --cyan: #00AEEF;
  --royal: #2858E8;
  --pos: #2DD4A4;
  --neg: #FF6B7A;
  --warn: #F4B400;
  --violet: #8B7CF6;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .7);
  --radius: 20px;
  --side: rgba(6, 16, 32, .78);
  --input: rgba(4, 12, 26, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F2F6FB; --bg2: #E6EEF8; --panel: rgba(255,255,255,.78); --panel-solid: #FFFFFF; --panel-hi: rgba(0,174,239,.06);
    --line: rgba(15,39,68,.09); --line2: rgba(15,39,68,.17); --text: #0F2744; --muted: #52637B; --faint: #94A3B8;
    --pos: #0E9F78; --neg: #E04A5A; --warn: #C98F00; --shadow: 0 24px 50px -30px rgba(15,39,68,.35);
    --side: rgba(255,255,255,.82); --input: rgba(255,255,255,.9); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F2F6FB; --bg2: #E6EEF8; --panel: rgba(255,255,255,.78); --panel-solid: #FFFFFF; --panel-hi: rgba(0,174,239,.06);
  --line: rgba(15,39,68,.09); --line2: rgba(15,39,68,.17); --text: #0F2744; --muted: #52637B; --faint: #94A3B8;
  --pos: #0E9F78; --neg: #E04A5A; --warn: #C98F00; --shadow: 0 24px 50px -30px rgba(15,39,68,.35);
  --side: rgba(255,255,255,.82); --input: rgba(255,255,255,.9); color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Source Sans 3", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 600px at 88% -12%, rgba(0,174,239,.16), transparent 60%),
    radial-gradient(900px 520px at -12% 112%, rgba(40,88,232,.18), transparent 60%);
}
h1, h2, h3, h4, .num, .lex { font-family: Lexend, system-ui, sans-serif; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
svg { display: block; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#bg3d { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s; }
#app { position: relative; z-index: 1; min-height: 100vh; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 30px; height: 36px; }
.brand b { font: 700 20px/1 Lexend, sans-serif; letter-spacing: .14em; }
.brand small { display: block; font: 500 9.5px/1 Lexend, sans-serif; letter-spacing: .32em; color: var(--muted); margin-top: 5px; }
.grad { background: linear-gradient(100deg, var(--cyan), var(--royal) 55%, var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; border-radius: 12px;
  padding: 10px 16px; font-weight: 600; background: var(--panel-hi); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line2); white-space: nowrap; transition: background .2s, box-shadow .2s;
}
.btn:hover { background: rgba(0,174,239,.14); }
.btn.primary { background: linear-gradient(120deg, var(--cyan), var(--royal)); color: #fff; box-shadow: 0 10px 30px -12px rgba(0,174,239,.8); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-hi); }
.btn.danger { color: var(--neg); }
.btn.sm { padding: 6px 10px; font-size: 13.5px; border-radius: 10px; }
.btn.icon { padding: 8px; }
.btn:focus-visible, .field input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.field input, .field select, .field textarea, .search input {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--input); outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0,174,239,.15); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--cyan); }
.search { position: relative; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 36px; min-width: 220px; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--input); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 6px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { color: var(--text); }
.seg .seg-pill { position: absolute; top: 3px; bottom: 3px; border-radius: 9px; background: linear-gradient(120deg, rgba(0,174,239,.25), rgba(40,88,232,.25)); box-shadow: inset 0 0 0 1px rgba(0,174,239,.35); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line2); color: var(--muted); white-space: nowrap; }
.chip.pos { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); box-shadow: none; }
.chip.neg { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); box-shadow: none; }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); box-shadow: none; }
.chip.cy { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); box-shadow: none; }
.chip.vi { color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); box-shadow: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.2fr minmax(340px, 420px); align-items: center; gap: 48px; padding: 48px clamp(20px, 6vw, 96px); }
.login-hero h1 { font-size: clamp(42px, 6.4vw, 88px); line-height: .98; font-weight: 700; margin: 34px 0 20px; letter-spacing: -.035em; }
.login-hero p { color: var(--muted); font-size: 18px; max-width: 520px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-stat { padding: 12px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px); }
.hero-stat b { font: 600 20px Lexend, sans-serif; display: block; }
.hero-stat span { font-size: 12.5px; color: var(--muted); }
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); box-shadow: var(--shadow); }
.login-card { padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.login-card h2 { font-size: 22px; }
.login-card .note { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.login-card .err { color: var(--neg); font-size: 13.5px; min-height: 18px; }
.login-card .btn.primary { justify-content: center; padding: 13px; font-size: 16px; }

/* ---------- hub ---------- */
.hub { min-height: 100vh; padding: 28px clamp(20px, 5vw, 72px) 60px; display: flex; flex-direction: column; }
.hub-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub h1 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.05; margin: 9vh 0 10px; letter-spacing: -.03em; max-width: 820px; }
.hub .lead { color: var(--muted); font-size: 17px; }
.mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 40px; perspective: 1200px; }
.mod { position: relative; padding: 24px; min-height: 270px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text); transform-style: preserve-3d; overflow: hidden; }
.mod::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(0,174,239,.16), transparent 45%); opacity: 0; transition: opacity .3s; }
.mod:hover::after { opacity: 1; }
.mod .mod-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, rgba(0,174,239,.25), rgba(40,88,232,.18)); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(0,174,239,.3); }
.mod .mod-ico .ico { width: 22px; height: 22px; }
.mod h3 { font-size: 22px; margin-top: 6px; }
.mod p { color: var(--muted); font-size: 14.5px; }
.mod .mod-viz { margin-top: auto; height: 64px; }
.mod .mod-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--muted); }
.mod .go { color: var(--cyan); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.mod.locked { opacity: .45; cursor: not-allowed; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: var(--side); backdrop-filter: blur(20px); display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.side .brand { padding: 0 8px 14px; }
.side .brand small { letter-spacing: .2em; font-size: 8.5px; }
.mod-sw { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 2px 6px; border-radius: 14px; background: var(--input); box-shadow: inset 0 0 0 1px var(--line); }
.mod-sw a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 700; transition: background .2s, color .2s; }
.mod-sw a:hover { color: var(--text); }
.mod-sw a.on { color: var(--text); background: linear-gradient(140deg, rgba(0,174,239,.25), rgba(40,88,232,.2)); box-shadow: inset 0 0 0 1px rgba(0,174,239,.35); }
.mod-sw a.on .ico { color: var(--cyan); }
.side { overflow-y: auto; }
.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav h6 { font: 600 10.5px Lexend, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; transition: color .2s; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); }
.nav a.on .ico { color: var(--cyan); }
.nav a .badge { margin-left: auto; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--neg); color: #fff; }
.nav-glow { position: absolute; left: 0; right: 0; height: 40px; border-radius: 12px; background: linear-gradient(100deg, rgba(0,174,239,.2), rgba(40,88,232,.08)); box-shadow: inset 0 0 0 1px rgba(0,174,239,.28); z-index: 0; pointer-events: none; }
.nav-glow::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font: 700 13px Lexend, sans-serif; background: linear-gradient(140deg, var(--petrol), var(--royal)); color: #fff; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: var(--faint); }

.main { padding: 22px clamp(16px, 2.4vw, 34px) 70px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.top .crumb { font-size: 12.5px; color: var(--faint); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.top h1 { font-size: 28px; line-height: 1.15; }
.top .grow { flex: 1; }
.comp { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.comp b { min-width: 128px; text-align: center; font: 600 14px Lexend, sans-serif; }
.kbd { font: 600 11px Lexend, sans-serif; padding: 2px 6px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line2); color: var(--faint); }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.card { grid-column: span 12; position: relative; padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); min-width: 0; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(500px circle at var(--mx, -100px) var(--my, -100px), rgba(0,174,239,.07), transparent 40%); }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h3 { font-size: 16px; font-weight: 600; }
.card-h .sub { font-size: 13px; color: var(--faint); }
.card-h .grow { flex: 1; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.pos-t { color: var(--pos); } .neg-t { color: var(--neg); } .warn-t { color: var(--warn); }

.kpi { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.kpi .lbl { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .val { font: 600 clamp(22px, 2.2vw, 30px)/1.15 Lexend, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 55%; height: 56px; opacity: .9; pointer-events: none; }

.chart { width: 100%; position: relative; }
.chart svg text { font-family: "Source Sans 3", sans-serif; fill: var(--muted); font-size: 12px; }
.chart .axis line, .chart .gridl { stroke: var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.tip { position: fixed; z-index: 100; pointer-events: none; padding: 10px 12px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 13px; min-width: 150px; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.tip.on { opacity: 1; transform: none; }
.tip b { font-family: Lexend, sans-serif; font-weight: 600; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; }

/* insights */
.insights { display: flex; flex-direction: column; gap: 10px; }
.insight { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line); }
.insight .ii { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.insight p { font-size: 14px; line-height: 1.4; }
.insight p b { font-weight: 700; }

/* lists & tables */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 12.5px; color: var(--faint); }
.datebox { width: 44px; text-align: center; border-radius: 10px; padding: 4px 0; background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line); flex: none; }
.datebox b { display: block; font: 600 16px/1.1 Lexend, sans-serif; }
.datebox span { font-size: 10.5px; text-transform: uppercase; color: var(--faint); letter-spacing: .08em; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tb td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tb tr:hover td { background: var(--panel-hi); }
.tb td.r, .tb th.r { text-align: right; }
.tb .desc b { display: block; font-weight: 600; }
.tb .desc span { font-size: 12.5px; color: var(--faint); }
.status-btn { cursor: pointer; border: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.sumstrip { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.sumstrip b { font: 600 17px Lexend, sans-serif; color: var(--text); display: block; }
.empty { text-align: center; padding: 30px; color: var(--faint); }

/* clientes */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ccard { padding: 16px; border-radius: 16px; background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .2s; }
.ccard:hover { box-shadow: inset 0 0 0 1px rgba(0,174,239,.45); }
.ccard .nm { font-weight: 700; font-size: 15px; line-height: 1.25; }
.ccard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ccard .hon { font: 600 18px Lexend, sans-serif; color: var(--text); }
.pend { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); margin-bottom: 10px; }
.pend .grow { flex: 1; font-size: 14px; }
.pend .diff { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pend .diff s { color: var(--neg); } .pend .diff ins { color: var(--pos); text-decoration: none; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { border-radius: 16px; background: var(--input); box-shadow: inset 0 0 0 1px var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 280px; transition: box-shadow .2s, background .2s; }
.kcol.over { box-shadow: inset 0 0 0 2px var(--cyan); background: rgba(0,174,239,.06); }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 6px; font-weight: 700; font-size: 13.5px; }
.kcol-h .n { margin-left: auto; font-size: 12px; color: var(--faint); }
.kcol-h .sum { display: block; font-size: 12px; color: var(--faint); font-weight: 600; }
.kcard { padding: 12px; border-radius: 13px; background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line2), 0 6px 18px -12px rgba(0,0,0,.6); cursor: grab; touch-action: none; user-select: none; display: flex; flex-direction: column; gap: 6px; }
.kcard:active { cursor: grabbing; }
.kcard .nm { font-weight: 700; font-size: 14px; line-height: 1.25; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.kcard.dragging { box-shadow: 0 0 0 2px var(--cyan), 0 30px 50px -20px rgba(0,0,0,.6); z-index: 50; }

/* recuperação */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper i { width: 22px; height: 6px; border-radius: 4px; background: var(--line2); }
.stepper i.on { background: linear-gradient(90deg, var(--cyan), var(--royal)); }

/* modal */
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(2, 8, 18, .55); backdrop-filter: blur(6px); }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 24px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.7); }
.modal h2 { font-size: 21px; margin-bottom: 4px; }
.modal .msub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }

/* toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.toast .ico { color: var(--pos); }

/* command palette */
.cmdk { width: min(620px, 100%); align-self: start; margin-top: 12vh; background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 20px; overflow: hidden; box-shadow: 0 40px 100px -30px rgba(0,0,0,.7); }
.cmdk input { width: 100%; border: 0; outline: 0; background: transparent; padding: 18px 20px; font-size: 17px; border-bottom: 1px solid var(--line); }
.cmdk .res { max-height: 50vh; overflow: auto; padding: 8px; }
.cmdk .it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.cmdk .it.on { background: var(--panel-hi); box-shadow: inset 0 0 0 1px rgba(0,174,239,.35); }
.cmdk .it .k { margin-left: auto; font-size: 12px; color: var(--faint); }
.cmdk .grp { font: 600 10.5px Lexend, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 4px; }

.three-host { position: relative; height: 320px; border-radius: 14px; overflow: hidden; cursor: grab; }
.three-host:active { cursor: grabbing; }
.three-host canvas { display: block; width: 100% !important; height: 100% !important; }
.hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--faint); pointer-events: none; }

@media (max-width: 1180px) {
  .c3 { grid-column: span 6; } .c4, .c5, .c7, .c8 { grid-column: span 12; } .c6 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side .brand { padding: 0 8px 0 0; } .side .brand small { display: none; }
  .nav, #navTabs { display: flex; flex-direction: row; } .nav h6, .nav-glow { display: none; }
  .mod-sw { margin: 0 8px 0 0; flex: none; } .mod-sw a span { display: none; }
  .nav a { padding: 8px 10px; white-space: nowrap; } .nav a.on { background: var(--panel-hi); }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; } .side-foot .who { display: none; }
}
@media (max-width: 640px) {
  .c3 { grid-column: span 12; }
  .form-grid { grid-template-columns: 1fr; }
  .search input { min-width: 0; }
  .comp b { min-width: 100px; }
  .top .kbd { display: none; }
  .top h1 { font-size: 24px; }
  .hub h1 { margin-top: 5vh; }
  .login-hero h1 { margin: 22px 0 14px; font-size: 11.5vw; }
  .login { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- medidores, situação e financeiro ---------- */
.pr-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.meter { margin: 0 0 12px; }
.meter-h { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.meter-h span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.ico-xs { width: 13px; height: 13px; vertical-align: -2px; display: inline-block; }
.sit-bar { display: flex; height: 16px; border-radius: 9px; overflow: hidden; gap: 2px; margin-bottom: 10px; }
.sit-bar i { display: block; min-width: 4px; cursor: pointer; }
.tb tr.done td { opacity: .62; }
.tb tr.done td:first-child { opacity: 1; }
input.baixa { width: 18px; height: 18px; accent-color: var(--pos); cursor: pointer; }
select.st-sel { padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line2); background: var(--input); font-size: 13px; }

/* =====================================================================
   Componentes extras do kit (vindos dos módulos do WJR 360)
   ===================================================================== */

/* barra empilhada */
.k-stack { display: flex; height: 16px; border-radius: 9px; overflow: hidden; gap: 2px; }
.k-stack i { display: block; min-width: 4px; cursor: pointer; }

/* trilha de meta com marcos */
.k-trail { position: relative; padding: 8px 0 58px; }
.k-trail-bar { position: relative; height: 10px; border-radius: 6px; background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line); }
.k-trail-bar i { display: block; height: 100%; border-radius: 6px; }
.k-trail-dot { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--panel-solid); border: 3px solid var(--cyan); box-shadow: 0 0 0 6px color-mix(in srgb, var(--cyan) 20%, transparent); animation: k-pulso 2s infinite; }
.k-trail-m { position: absolute; top: 4px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 12px; text-align: center; white-space: nowrap; }
.k-trail-m:first-of-type { transform: none; align-items: flex-start; }
.k-trail-m:last-of-type { transform: translateX(-100%); align-items: flex-end; }
.k-trail-m span { width: 2px; height: 18px; background: var(--line2); margin-bottom: 4px; }
.k-trail-m b { font: 600 14px Lexend, sans-serif; }
@keyframes k-pulso { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--cyan) 6%, transparent); } }

/* cronômetro em anel (conic-gradient) */
.k-timer { --sz: 64px; --p: 0deg; --c: var(--pos); width: var(--sz); height: var(--sz); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) var(--p), var(--panel-hi) 0); transition: background .4s; position: relative; }
.k-timer::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel-solid); }
.k-timer span { position: relative; font: 600 calc(var(--sz) / 4.6) Lexend, sans-serif; color: var(--c); }

/* status que cicla ao clicar */
.k-status { border: 0; cursor: pointer; padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: 12.5px; transition: background .2s, color .2s; }
.k-status[data-s="0"] { background: var(--panel-hi); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); }
.k-status[data-s="1"] { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.k-status[data-s="2"] { background: color-mix(in srgb, var(--neg) 16%, transparent); color: var(--neg); }
.k-status[data-s="3"] { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px dashed var(--line2); text-decoration: line-through; }

/* passos em segmentos */
.k-steps { display: flex; gap: 4px; }
.k-steps i { flex: 1; height: 6px; border-radius: 4px; background: var(--line2); }
.k-steps i.on { background: linear-gradient(90deg, var(--cyan), var(--royal)); }
.k-steps i.now { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

/* faixa rolante (ticker) */
.k-ticker { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 12px; background: var(--input); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; font-size: 13px; }
.k-ticker > b { color: var(--cyan); flex: none; font-family: Lexend, sans-serif; }
.k-ticker .k-tk { display: flex; gap: 36px; white-space: nowrap; animation: k-tk 30s linear infinite; }
.k-ticker:hover .k-tk { animation-play-state: paused; }
@keyframes k-tk { to { transform: translateX(-50%); } }

/* relógio de prazo (ponteiro girando) */
.k-clock { --c: var(--cyan); width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--c); position: relative; flex: none; }
.k-clock::before, .k-clock::after { content: ""; position: absolute; left: 50%; bottom: 50%; width: 2px; border-radius: 2px; background: var(--c); transform-origin: bottom center; }
.k-clock::before { height: 13px; margin-left: -1px; animation: k-gira 4s linear infinite; }
.k-clock::after { height: 9px; margin-left: -1px; animation: k-gira 48s linear infinite; }
.k-clock.vencido { --c: var(--neg); animation: k-pisca 1.4s infinite; }
.k-clock.perto { --c: var(--warn); }
.k-clock.ok { --c: var(--pos); }
@keyframes k-gira { to { transform: rotate(360deg); } }
@keyframes k-pisca { 50% { opacity: .35; } }

/* cartão com farol (verde / amarelo / vermelho) */
.k-farol { --fc: var(--pos); position: relative; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s, transform .3s; overflow: hidden; }
.k-farol.y { --fc: var(--warn); } .k-farol.r { --fc: var(--neg); }
.k-farol::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--fc) 18%, transparent), transparent 60%); }
.k-farol:hover { border-color: color-mix(in srgb, var(--fc) 70%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fc) 45%, transparent), 0 22px 44px -20px color-mix(in srgb, var(--fc) 60%, transparent); transform: translateY(-2px); }
.k-farol:hover::after { opacity: 1; }
.k-farol .luz { position: absolute; top: 16px; right: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 12px var(--fc); }
.k-farol small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.k-farol b { display: block; font: 600 24px Lexend, sans-serif; margin: 4px 0; }
.k-farol span { font-size: 12px; color: var(--faint); }

/* gaveta lateral */
.k-drawer-bg { position: fixed; inset: 0; z-index: 90; background: rgba(2, 8, 18, .5); backdrop-filter: blur(4px); }
.k-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(460px, 100%); padding: 24px; overflow: auto; background: var(--panel-solid); border-left: 1px solid var(--line2); box-shadow: -30px 0 80px -30px rgba(0,0,0,.6); }

/* assinatura à mão */
.k-sig { width: 100%; height: 150px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line2); touch-action: none; cursor: crosshair; display: block; }

/* quadradinho de nota (A/B/C) */
.k-nota { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font: 700 13px Lexend, sans-serif; }
.k-nota.a { background: color-mix(in srgb, var(--pos) 18%, transparent); color: var(--pos); }
.k-nota.b { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }
.k-nota.c { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

/* chave liga/desliga */
.k-switch { position: relative; width: 42px; height: 24px; border-radius: 99px; border: 0; cursor: pointer; background: var(--line2); transition: background .25s; flex: none; }
.k-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.k-switch[aria-pressed="true"] { background: var(--pos); }
.k-switch[aria-pressed="true"]::after { transform: translateX(18px); }

/* área de soltar arquivos */
.k-drop { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; border: 1.5px dashed color-mix(in srgb, var(--cyan) 45%, var(--line2)); background: color-mix(in srgb, var(--cyan) 5%, transparent); cursor: pointer; transition: background .2s, border-color .2s; }
.k-drop.over { background: color-mix(in srgb, var(--cyan) 14%, transparent); border-color: var(--cyan); }
.k-drop .ico { width: 26px; height: 26px; color: var(--cyan); }
