/* ============================================================
   ARCANJO — estilos da plataforma (usa tokens.css)
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  font-feature-settings: 'cv02','cv03','cv04','tnum';
  transition: background var(--d), color var(--d);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ---------- SPLASH ---------- */
#splash {
  position: fixed; inset: 0; z-index: 999; background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s6); transition: opacity .5s ease, visibility .5s;
}
#splash.gone { opacity: 0; visibility: hidden; }
.splash-mark { display: flex; align-items: center; gap: var(--s3); }
.splash-name { font-size: 26px; font-weight: 300; letter-spacing: .32em; text-transform: uppercase; color: var(--text); }
.splash-name b { font-weight: 600; color: var(--brand); }
.splash-sub { color: var(--muted); font-size: var(--t-xs); letter-spacing: .24em; text-transform: uppercase; }
.splash-bar { width: 190px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 0; background: var(--brand); animation: fill 1.4s ease forwards; }
@keyframes fill { to { width: 100%; } }

/* ---------- LAYOUT ---------- */
#app { display: none; height: 100vh; }
#app.on { display: grid; grid-template-columns: var(--sidebar) 1fr; }

/* ---------- SIDEBAR ---------- */
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.brand {
  height: var(--topbar); flex-shrink: 0; display: flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s5); border-bottom: 1px solid var(--border);
}
.brand-txt { font-size: 14.5px; font-weight: 300; letter-spacing: .2em; text-transform: uppercase; }
.brand-txt b { font-weight: 600; color: var(--brand); }
.nav { flex: 1; overflow-y: auto; padding: var(--s3) var(--s3); }
.nav-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .15em; color: var(--faint); padding: var(--s4) var(--s2) 6px; font-weight: 650; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: var(--t-md); font-weight: 450;
  transition: background var(--d-fast), color var(--d-fast); position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; background: var(--brand); border-radius: 0 3px 3px 0; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item span:not(.nav-badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 650; background: var(--surface-3); color: var(--text-2); padding: 1px 6px; border-radius: var(--r-full); }
.nav-item.active .nav-badge { background: var(--brand); color: var(--brand-ink); }

.sidebar-foot { padding: var(--s3); border-top: 1px solid var(--border); }
.plan-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 11px 12px; }
.plan-card .t { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.plan-card .v { font-size: var(--t-md); font-weight: 650; color: var(--brand); margin-top: 2px; }
.plan-card .meter { height: 4px; background: var(--surface-3); border-radius: 4px; margin-top: 9px; overflow: hidden; }
.plan-card .meter i { display: block; height: 100%; width: 68%; background: var(--brand); border-radius: 4px; }
.plan-card .c { font-size: 10.5px; color: var(--faint); margin-top: 6px; }

/* ---------- MAIN / TOPBAR ---------- */
.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar); flex-shrink: 0; border-bottom: 1px solid var(--border);
  background: var(--bg-2); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s5);
}
.search-box { flex: 1; max-width: 440px; position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--faint); }
.search-box input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 11px 8px 34px; color: var(--text); font-size: var(--t-sm); outline: none;
  transition: border-color var(--d-fast), background var(--d-fast);
}
.search-box input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-tint); }
.search-box input::placeholder { color: var(--faint); }
.kbd { position: absolute; right: 9px; font-size: 10px; color: var(--faint); border: 1px solid var(--border-2); border-radius: var(--r-xs); padding: 1px 5px; }

.top-right { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.city-pick { display: flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 11px; font-size: var(--t-sm); color: var(--text-2); }
.city-pick select { background: none; border: none; color: var(--text); font-size: var(--t-sm); outline: none; cursor: pointer; font-weight: 500; }
.icon-btn {
  width: 33px; height: 33px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface-2); transition: var(--d-fast); position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-3); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--neg); border: 1.5px solid var(--surface-2); }
.avatar { width: 33px; height: 33px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-size: 11.5px; font-weight: 650; color: var(--brand-ink); }

.view { flex: 1; overflow-y: auto; }
.view.nopad { overflow: hidden; }
.pad { padding: var(--s6) var(--s8) var(--s12); }

/* ---------- PAGE HEAD ---------- */
.page-head { display: flex; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s5); }
.page-head h1 { font-size: var(--t-h2); font-weight: 650; letter-spacing: -.02em; }
.page-head p { color: var(--muted); font-size: var(--t-md); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: var(--s2); flex-shrink: 0; }

/* ---------- BOTÕES ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 600; transition: var(--d-fast);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); box-shadow: var(--sh-1);
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-ink); }
.btn.ai { background: var(--ai); color: #fff; border-color: var(--ai); }
.btn.ai:hover { background: var(--ai-2); border-color: var(--ai-2); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 10px; font-size: var(--t-xs); }

/* ---------- GRID / CARDS ---------- */
.grid { display: grid; gap: var(--s4); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1340px) { .g4 { grid-template-columns: repeat(2, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.card-h { padding: 13px var(--s4); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s2); }
.card-h h3 { font-size: var(--t-md); font-weight: 650; }
.card-h .sub { font-size: var(--t-xs); color: var(--muted); }
.card-h .r { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.card-b { padding: var(--s4); }

/* KPI */
.kpi { padding: var(--s4); }
.kpi .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.kpi .val { font-size: 25px; font-weight: 650; margin-top: 7px; letter-spacing: -.03em; }
.kpi .delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 650; margin-top: 6px; }
.kpi .delta.up { color: var(--pos); } .kpi .delta.dn { color: var(--neg); } .kpi .delta.nt { color: var(--muted); }
.kpi .spark { margin-top: 10px; }

/* ---------- TABELA ---------- */
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  font-weight: 650; text-align: left; padding: 9px var(--s4); border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--surface-2);
}
tbody td { padding: 11px var(--s4); border-bottom: 1px solid var(--border); font-size: var(--t-md); }
tbody tr { transition: background var(--d-fast); cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td.r, th.r { text-align: right; }
td.r, td .num, td.mono { white-space: nowrap; }

/* ---------- PILLS ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 650; padding: 3px 9px; border-radius: var(--r-full); white-space: nowrap; }
.pill.brand { background: var(--brand-tint); color: var(--brand); }
.pill.gold  { background: var(--gold-tint); color: var(--gold); }
.pill.ai    { background: var(--ai-tint); color: var(--ai); }
.pill.pos   { background: var(--pos-tint); color: var(--pos); }
.pill.neg   { background: var(--neg-tint); color: var(--neg); }
.pill.warn  { background: var(--warn-tint); color: var(--warn); }
.pill.mute  { background: var(--surface-3); color: var(--text-2); }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- SCORE ---------- */
.score-ring { position: relative; display: inline-grid; place-items: center; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .n { position: absolute; font-weight: 650; letter-spacing: -.03em; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.score-ring .n small { font-size: 9px; font-weight: 650; color: var(--muted); letter-spacing: .1em; margin-top: 3px; text-transform: uppercase; }

.score-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 2px 7px; border-radius: var(--r-xs); font-size: var(--t-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-a { background: var(--pos-tint); color: var(--pos); }
.sc-b { background: var(--brand-tint); color: var(--brand); }
.sc-c { background: var(--warn-tint); color: var(--warn); }
.sc-d { background: var(--neg-tint); color: var(--neg); }

.factor { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 11px; padding: 7px 0; }
.factor .fl { font-size: var(--t-sm); color: var(--text-2); }
.factor .fb { height: 6px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.factor .fb i { display: block; height: 100%; border-radius: var(--r-full); background: var(--brand); transition: width .8s var(--e-out); }
.factor .fv { font-size: var(--t-sm); font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- MAPA ---------- */
.map-wrap { display: grid; grid-template-columns: 292px 1fr; height: 100%; }
.map-panel { border-right: 1px solid var(--border); background: var(--bg-2); overflow-y: auto; }
.mp-sec { border-bottom: 1px solid var(--border); padding: var(--s4) var(--s4); }
.mp-sec h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 650; margin-bottom: 11px; }
.layer { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: var(--t-sm); color: var(--text-2); cursor: pointer; transition: color var(--d-fast); }
.layer:hover { color: var(--text); }
.layer .sw { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.toggle { margin-left: auto; width: 32px; height: 18px; border-radius: var(--r-full); background: var(--surface-3); position: relative; transition: background var(--d); flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); box-shadow: var(--sh-1); transition: var(--d); }
.toggle.on { background: var(--brand); }
.toggle.on::after { left: 16.5px; }

.basemap-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bm { padding: 7px 4px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); font-size: var(--t-xs); color: var(--text-2); text-align: center; transition: var(--d-fast); font-weight: 500; }
.bm:hover { border-color: var(--border-2); }
.bm.on { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); font-weight: 650; }

.map-canvas { position: relative; }
#leaflet { position: absolute; inset: 0; background: var(--surface-2); }
.leaflet-container { background: var(--surface-2) !important; font-family: var(--sans) !important; }
.leaflet-control-attribution { background: var(--surface) !important; color: var(--faint) !important; font-size: 9.5px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text-2) !important; border-color: var(--border) !important; }
.leaflet-control-zoom a:hover { background: var(--surface-2) !important; color: var(--text) !important; }

.map-float { position: absolute; z-index: 500; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 11px var(--s4); box-shadow: var(--sh-3); }
.map-legend { bottom: 20px; left: 16px; }
.map-legend .t { font-size: 10px; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.map-legend .it { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--text-2); padding: 2.5px 0; }
.map-legend .it i { width: 10px; height: 10px; border-radius: 3px; }
.map-stats { top: 16px; right: 16px; display: flex; gap: var(--s5); }
.map-stats .s .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.map-stats .s .v { font-size: var(--t-h3); font-weight: 650; margin-top: 1px; letter-spacing: -.02em; }

.trn-tip { background: var(--surface) !important; border: 1px solid var(--border-2) !important; border-radius: var(--r) !important; color: var(--text) !important; box-shadow: var(--sh-3) !important; padding: 9px 12px !important; font-family: var(--sans) !important; }
.trn-tip::before { display: none !important; }
.trn-tip .tt-n { font-size: var(--t-sm); font-weight: 650; }
.trn-tip .tt-m { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.trn-tip .tt-r { display: flex; gap: 12px; margin-top: 7px; font-size: var(--t-xs); }
.trn-tip .tt-r b { color: var(--brand); }

.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 408px; z-index: 600;
  background: var(--bg-2); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform var(--d-slow) var(--e-out);
  overflow-y: auto; box-shadow: var(--sh-4);
}
.drawer.open { transform: translateX(0); }
.drawer-h { padding: var(--s4); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.drawer-h .x { position: absolute; top: 14px; right: 14px; color: var(--muted); font-size: 18px; line-height: 1; }
.drawer-h .x:hover { color: var(--text); }

/* ---------- FILTROS ---------- */
.filters { display: grid; grid-template-columns: 254px 1fr; gap: var(--s4); }
.filter-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); align-self: start; position: sticky; top: 0; box-shadow: var(--sh-1); }
.f-sec { padding: 13px var(--s4); border-bottom: 1px solid var(--border); }
.f-sec:last-child { border-bottom: none; }
.f-sec h5 { font-size: 10px; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); font-weight: 650; margin-bottom: 10px; }
.f-row { display: flex; gap: 7px; margin-bottom: 8px; }
.inp {
  width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  padding: 7px 9px; color: var(--text); font-size: var(--t-sm); outline: none;
  transition: border-color var(--d-fast), box-shadow var(--d-fast); font-variant-numeric: tabular-nums;
}
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.inp::placeholder { color: var(--faint); }
select.inp { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: var(--t-xs); padding: 4px 10px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); transition: var(--d-fast); font-weight: 500; }
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }

.range-lbl { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--text-2); margin-bottom: 7px; }
input[type=range] { width: 100%; -webkit-appearance: none; height: 4px; background: var(--surface-3); border-radius: 4px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--brand); cursor: pointer; box-shadow: var(--sh-2); border: 2px solid var(--surface); }

/* ---------- CARD DE TERRENO ---------- */
.trn-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s4); display: grid; grid-template-columns: 1fr auto; gap: var(--s4);
  transition: var(--d-fast); cursor: pointer; box-shadow: var(--sh-1);
}
.trn-card:hover { border-color: var(--brand-line); box-shadow: var(--sh-3); transform: translateY(-1px); }
.trn-card .tn { font-size: 14.5px; font-weight: 650; }
.trn-card .tl { font-size: var(--t-sm); color: var(--muted); margin-top: 2px; }
.trn-card .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.trn-card .mts { display: flex; gap: var(--s5); margin-top: 11px; flex-wrap: wrap; }
.trn-card .mt .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 650; }
.trn-card .mt .v { font-size: var(--t-md); font-weight: 650; margin-top: 1px; }
.trn-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.trn-right .pr { font-size: var(--t-h3); font-weight: 650; letter-spacing: -.02em; }
.trn-right .pm { font-size: var(--t-xs); color: var(--muted); text-align: right; }

/* ---------- SIMULADOR ---------- */
.sim { display: grid; grid-template-columns: 348px 1fr; gap: var(--s4); align-items: start; }
.sim-field { margin-bottom: var(--s3); }
.sim-field label { display: block; font-size: var(--t-xs); color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.sim-out { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.sim-out .o { background: var(--surface); padding: 14px var(--s4); }
.sim-out .o .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.sim-out .o .v { font-size: 21px; font-weight: 650; margin-top: 6px; letter-spacing: -.03em; }
.sim-out .o .v.g { color: var(--brand); }
.sim-out .o .v.p { color: var(--pos); }
.sim-out .o .v.n { color: var(--neg); }
.sim-out .o .s { font-size: 10.5px; color: var(--faint); margin-top: 3px; }

.verdict { border-radius: var(--r-lg); padding: var(--s4) 18px; display: flex; gap: var(--s4); align-items: center; border: 1px solid; margin-bottom: var(--s4); }
.verdict.go   { background: var(--pos-tint);  border-color: var(--pos); }
.verdict.hold { background: var(--warn-tint); border-color: var(--warn); }
.verdict.no   { background: var(--neg-tint);  border-color: var(--neg); }
.verdict .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 18px; font-weight: 700; color: #fff; }
.verdict.go .ic { background: var(--pos); } .verdict.hold .ic { background: var(--warn); } .verdict.no .ic { background: var(--neg); }
.verdict .t { font-size: var(--t-lg); font-weight: 650; }
.verdict .d { font-size: var(--t-md); color: var(--text-2); margin-top: 2px; }

/* ---------- KANBAN ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(216px,1fr)); gap: var(--s3); }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; }
.kcol-h { padding: 11px 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s2); }
.kcol-h .n { font-size: var(--t-sm); font-weight: 650; }
.kcol-h .c { margin-left: auto; font-size: 10.5px; color: var(--muted); background: var(--surface-3); padding: 1px 7px; border-radius: var(--r-full); font-weight: 650; }
.kcol-b { padding: 10px; display: flex; flex-direction: column; gap: 9px; min-height: 120px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 11px; cursor: grab; transition: var(--d-fast); box-shadow: var(--sh-1); }
.kcard:hover { border-color: var(--brand-line); box-shadow: var(--sh-2); transform: translateY(-1px); }
.kcard .n { font-size: var(--t-sm); font-weight: 650; }
.kcard .m { font-size: var(--t-xs); color: var(--muted); margin-top: 3px; }
.kcard .f { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.kcard .val { font-size: var(--t-sm); font-weight: 700; color: var(--brand); }
.kav { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 9.5px; font-weight: 650; color: var(--text-2); margin-left: auto; }

/* ---------- RELATÓRIOS ---------- */
.rep-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); transition: var(--d-fast); cursor: pointer; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sh-1); }
.rep-card:hover { border-color: var(--brand-line); box-shadow: var(--sh-3); transform: translateY(-2px); }
.rep-ic { width: 38px; height: 38px; border-radius: var(--r); display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.rep-card h4 { font-size: var(--t-md); font-weight: 650; }
.rep-card p { font-size: var(--t-sm); color: var(--muted); line-height: 1.45; }
.rep-card .meta { font-size: var(--t-xs); color: var(--faint); margin-top: auto; display: flex; align-items: center; gap: 6px; }

.doc-preview { background: #fff; border-radius: var(--r-sm); aspect-ratio: 1/1.414; padding: 16px; color: #111; font-size: 6.5px; line-height: 1.45; overflow: hidden; box-shadow: var(--sh-3); border: 1px solid var(--border); }
.doc-preview .dh { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid #0B4F71; padding-bottom: 6px; }
.doc-preview .dt { font-size: 9px; font-weight: 700; letter-spacing: .16em; color: #0D1826; }
.doc-preview .dt b { color: #0B4F71; }
.doc-preview h5 { font-size: 11px; margin: 10px 0 3px; letter-spacing: -.01em; }
.doc-preview .dl { color: #777; font-size: 6px; }
.doc-preview .dbar { height: 3.5px; background: #EEE; border-radius: 3px; margin: 3px 0; }
.doc-preview .dbar i { display: block; height: 100%; background: #0B4F71; border-radius: 3px; }
.doc-preview .dgrid { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 8px 0; }
.doc-preview .dbox { border: .6px solid #DDD; border-radius: 3px; padding: 4px; }
.doc-preview .dbox .k { color: #888; font-size: 5px; text-transform: uppercase; letter-spacing: .08em; }
.doc-preview .dbox .v { font-size: 8px; font-weight: 700; margin-top: 1px; }
.doc-preview .dline { height: 3px; background: #F0F0F0; border-radius: 2px; margin-bottom: 3px; }

/* ---------- MARKETPLACE ---------- */
.mkt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; transition: var(--d-fast); box-shadow: var(--sh-1); }
.mkt-card:hover { border-color: var(--brand-line); box-shadow: var(--sh-3); transform: translateY(-2px); }
.mkt-img { height: 130px; position: relative; overflow: hidden; }
.mkt-img .ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,20,32,.05), rgba(10,20,32,.72)); }
.mkt-img .bd { position: absolute; top: 10px; left: 10px; }
.mkt-img .ar { position: absolute; bottom: 9px; left: 12px; font-size: var(--t-sm); font-weight: 650; color: #fff; }
.mkt-b { padding: 13px var(--s4); }

/* ---------- MISC ---------- */
.hr { height: 1px; background: var(--border); margin: var(--s4) 0; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 7.5px 0; border-bottom: 1px solid var(--border); font-size: var(--t-sm); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.muted { color: var(--muted); }
.tiny { font-size: var(--t-xs); }

.alert { display: flex; gap: 11px; padding: 12px var(--s4); border-radius: var(--r); background: var(--warn-tint); border: 1px solid var(--warn); font-size: var(--t-sm); color: var(--text-2); }
.alert .ic { color: var(--warn); flex-shrink: 0; }
.alert .ic svg { width: 16px; height: 16px; }
.alert b { color: var(--warn); }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: var(--s5); }
.tab { padding: 9px 14px; font-size: var(--t-md); color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--d-fast); }
.tab:hover { color: var(--text-2); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }

/* superfície de IA — sempre visualmente distinta */
.ai-box { background: var(--ai-tint); border: 1px solid var(--ai-line); border-radius: var(--r-lg); padding: var(--s4) 18px; }
.ai-box .h { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--ai); }
.ai-box .h svg { width: 15px; height: 15px; }
.ai-box .h .t { font-size: var(--t-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.ai-box p { font-size: var(--t-md); line-height: 1.55; color: var(--text-2); }
.ai-box p + p { margin-top: 8px; }
.ai-box b { color: var(--text); font-weight: 650; }

.demo-flag {
  position: fixed; bottom: 14px; right: 16px; z-index: 800; background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--r-full); padding: 6px 13px;
  font-size: 10.5px; color: var(--muted); letter-spacing: .05em; display: flex; align-items: center; gap: 7px;
  box-shadow: var(--sh-2);
}
.demo-flag i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: blink 2.2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }

.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  #app.on { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sim, .filters, .map-wrap { grid-template-columns: 1fr; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .sim-out { grid-template-columns: repeat(2,1fr); }
  .kanban { grid-template-columns: repeat(2, minmax(200px,1fr)); }
}
