/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* VoltOS Design System — Dark theme from voltos-v2 prototype */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  --amber: #F59E0B;
  --amber-light: #FCD34D;
  --amber-dim: rgba(245,158,11,.12);
  --amber-glow: rgba(245,158,11,.25);
  --emerald: #10B981;
  --emerald-dim: rgba(16,185,129,.1);
  --rose: #F43F5E;
  --rose-dim: rgba(244,63,94,.1);
  --sky: #38BDF8;
  --sky-dim: rgba(56,189,248,.1);
  --violet: #8B5CF6;
  --bg: #080B14;
  --bg2: #0D1120;
  --bg3: #111729;
  --bg4: #161E35;
  --bg5: #1C2640;
  --line: #1E2A45;
  --line2: #263450;
  --muted: #8896B3;
  --muted2: #4A5A7A;
  --muted3: #2A3555;
  --text: #EDF0FF;
  --fw: 'Bricolage Grotesque', sans-serif;
  --mono: 'Fira Code', monospace;
  --nav-w: 252px;
  --top-h: 58px;
  --r: 8px;
  --r2: 12px;
  --r3: 18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--fw);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ── */
.shell { display: flex; height: 100vh; overflow: hidden; }
.shell--collapsed .main-area { margin-left: 0; }
.main-area { flex: 1 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.page-root { display: flex; flex-direction: column; flex: 1 1; min-height: 0; }
.page-content { flex: 1 1; overflow-y: auto; padding: 24px 28px; min-height: 0; }

/* ═══════════════════════════════════════════════════
   SIDEBAR v2 — Enterprise collapsible navigation
   ═══════════════════════════════════════════════════ */
:root {
  --sb-w: 252px;
  --sb-w-collapsed: 60px;
  --sb-transition: .2s cubic-bezier(.4,0,.2,1);
}
.sb {
  width: var(--sb-w); min-width: var(--sb-w); height: 100vh;
  background: var(--bg2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: width var(--sb-transition), min-width var(--sb-transition);
  position: relative; z-index: 50;
  overflow: hidden;
}
.sb::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, transparent, var(--amber), var(--emerald), transparent);
  opacity: .3; z-index: 1;
}
.sb--collapsed { width: var(--sb-w-collapsed); min-width: var(--sb-w-collapsed); }

/* ── Header ── */
.sb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 12px; border-bottom: 1px solid var(--line); min-height: 56px;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  overflow: hidden; white-space: nowrap;
}
.sb-logo {
  width: 32px; height: 32px; min-width: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--amber), #E07B00);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #000;
  box-shadow: 0 0 0 1px rgba(245,158,11,.25), 0 3px 12px rgba(245,158,11,.3);
}
.sb-brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.4px; color: var(--text); }
.sb-brand-sub { font-size: 9.5px; color: var(--muted2); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.sb-brand-text { display: flex; flex-direction: column; gap: 0; }
.sb-toggle {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg3); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.sb-toggle:hover { background: var(--bg4); color: var(--text); border-color: var(--line2); }
.sb--collapsed .sb-toggle { transform: rotate(0); }
.sb:not(.sb--collapsed) .sb-toggle { transform: rotate(180deg); }

/* ── Search button ── */
.sb-search-btn {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 8px 4px; padding: 7px 10px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--bg3);
  color: var(--muted); cursor: pointer; font-size: 12.5px;
  transition: all .15s; width: calc(100% - 16px);
  overflow: hidden; white-space: nowrap;
}
.sb-search-btn:hover { border-color: var(--line2); background: var(--bg4); color: var(--text); }
.sb-search-label { flex: 1 1; text-align: left; }
.sb-kbd {
  font-size: 9px; font-family: var(--mono); padding: 2px 5px;
  border-radius: 4px; border: 1px solid var(--line2);
  background: var(--bg4); color: var(--muted2); white-space: nowrap;
}
.sb--collapsed .sb-search-btn { justify-content: center; padding: 7px; }

/* ── Tenant ── */
.sb-tenant {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; margin: 4px 8px; font-size: 11.5px; color: var(--muted);
  overflow: hidden; white-space: nowrap;
}
.sb-tenant-dot {
  width: 6px; height: 6px; min-width: 6px; border-radius: 50%;
  background: var(--emerald); box-shadow: 0 0 6px var(--emerald);
}
.sb-tenant-name { font-weight: 500; color: var(--text); }
.sb-tenant-badge {
  font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 3px;
  background: var(--amber); color: #000; margin-left: auto;
}

/* ── Navigation ── */
.sb-nav { flex: 1 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 8px; }
.sb-group { margin-bottom: 12px; }
.sb-group-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9px; font-weight: 700; color: var(--muted3);
  text-transform: uppercase; letter-spacing: .1em;
  padding: 6px 8px 4px; cursor: pointer; border-radius: 4px;
  transition: color .15s; border: none; background: none; width: 100%;
}
.sb-group-label:hover { color: var(--muted); }
.sb-group-label svg { transition: transform .2s; opacity: .5; }
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: var(--r);
  font-size: 13px; font-weight: 400; color: var(--muted);
  transition: all .15s; position: relative; margin-bottom: 1px;
  text-decoration: none; overflow: hidden; white-space: nowrap;
}
.sb-item:hover { background: var(--bg3); color: var(--text); }
.sb-item--active { background: var(--amber-dim); color: var(--amber); font-weight: 600; }
.sb-item--active::before {
  content: ''; position: absolute; left: 0; top: 18%; height: 64%; width: 2.5px;
  border-radius: 0 2px 2px 0; background: var(--amber);
}
.sb-item-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; min-width: 20px; opacity: .6;
}
.sb-item--active .sb-item-icon { opacity: 1; }
.sb-item-label { overflow: hidden; text-overflow: ellipsis; }
.sb-badge {
  margin-left: auto; font-size: 9px; font-family: var(--mono);
  padding: 1px 5px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg4); color: var(--muted);
}
.sb-badge--alert { background: rgba(244,63,94,.12); color: var(--rose); border-color: rgba(244,63,94,.25); }

/* Collapsed nav */
.sb--collapsed .sb-nav { padding: 4px 6px; }
.sb--collapsed .sb-item { justify-content: center; padding: 8px; }
.sb--collapsed .sb-group { margin-bottom: 4px; }
.sb--collapsed .sb-group + .sb-group { border-top: 1px solid var(--line); padding-top: 4px; }

/* ── Tooltip (collapsed mode) ── */
.sb-tooltip-wrap { position: relative; }
.sb-tooltip {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--bg4); color: var(--text); border: 1px solid var(--line2);
  white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity .15s; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.sb-tooltip-wrap:hover .sb-tooltip { opacity: 1; }

/* ── Footer / User ── */
.sb-footer { padding: 8px 8px; border-top: 1px solid var(--line); }
.sb-user {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: var(--r);
  cursor: pointer; border: none; background: none; width: 100%;
  color: var(--text); transition: background .15s;
}
.sb-user:hover { background: var(--bg3); }
.sb-avatar {
  width: 30px; height: 30px; min-width: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sky), var(--violet)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.sb--collapsed .sb-avatar { width: 28px; height: 28px; min-width: 28px; font-size: 10px; }
.sb-user-info { flex: 1 1; text-align: left; overflow: hidden; }
.sb-user-name { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-role { font-size: 9.5px; color: var(--muted2); }
.sb--collapsed .sb-user { justify-content: center; }
.sb-user > svg { opacity: .4; flex-shrink: 0; }

/* ── Mobile ── */
.sb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 99;
  animation: fadeIn .15s;
}
.sb-mobile-trigger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 48;
  width: 40px; height: 40px; border-radius: var(--r);
  background: var(--bg2); border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
@media (max-width: 768px) {
  .sb { position: fixed; left: 0; top: 0; transform: translateX(-100%); z-index: 100; }
  .sb--mobile-open { transform: translateX(0); }
  .sb--collapsed { width: var(--sb-w); min-width: var(--sb-w); }
  .sb-mobile-trigger { display: flex; }
  .main-area { margin-left: 0 !important; }
}

/* ═══════════════════════════════════════════════════
   COMMAND PALETTE — Global search (Ctrl+K)
   ═══════════════════════════════════════════════════ */
.cmd-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh; z-index: 200;
  animation: fadeIn .12s;
}
.cmd-palette {
  width: 560px; max-width: 92vw; max-height: 480px;
  background: var(--bg2); border: 1px solid var(--line2);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
  display: flex; flex-direction: column;
  animation: slideUp .15s;
}
.cmd-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.cmd-input {
  flex: 1 1; background: none; border: none; outline: none;
  font-size: 15px; color: var(--text); font-family: inherit;
}
.cmd-input::placeholder { color: var(--muted2); }
.cmd-results {
  flex: 1 1; overflow-y: auto; padding: 6px;
  max-height: 340px;
}
.cmd-result {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r);
  cursor: pointer; border: none; background: none; width: 100%;
  text-align: left; color: var(--text); transition: background .1s;
}
.cmd-result:hover, .cmd-result--active { background: var(--bg3); }
.cmd-result--active { outline: 1px solid var(--amber-dim); }
.cmd-result-icon { color: var(--muted); display: flex; align-items: center; }
.cmd-result-text { flex: 1 1; }
.cmd-result-label { font-size: 13.5px; font-weight: 500; }
.cmd-result-group { font-size: 10.5px; color: var(--muted2); margin-left: 8px; }
.cmd-result-path { font-size: 10px; color: var(--muted3); font-family: var(--mono); }
.cmd-empty { padding: 24px; text-align: center; color: var(--muted2); font-size: 13px; }
.cmd-hint { padding: 24px; text-align: center; color: var(--muted3); font-size: 12.5px; }
.cmd-section-label {
  font-size: 9px; font-weight: 700; color: var(--muted3);
  text-transform: uppercase; letter-spacing: .1em;
  padding: 10px 12px 4px;
}
.cmd-type-badge {
  font-size: 8.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; flex-shrink: 0;
  background: var(--bg4); color: var(--muted2); border: 1px solid var(--line);
}
.cmd-type-uc { background: rgba(56,189,248,.1); color: #38BDF8; border-color: rgba(56,189,248,.25); }
.cmd-type-fatura { background: rgba(245,158,11,.1); color: #F59E0B; border-color: rgba(245,158,11,.25); }
.cmd-type-usina { background: rgba(16,185,129,.1); color: #10B981; border-color: rgba(16,185,129,.25); }
.cmd-type-usuario { background: rgba(139,92,246,.1); color: #8B5CF6; border-color: rgba(139,92,246,.25); }
.cmd-highlight {
  background: rgba(245,158,11,.25); color: var(--amber);
  border-radius: 2px; padding: 0 1px;
}
.cmd-spinner {
  width: 16px; height: 16px; border: 2px solid var(--line2);
  border-top-color: var(--amber); border-radius: 50%;
  animation: spin .6s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cmd-footer {
  display: flex; gap: 16px; padding: 10px 16px;
  border-top: 1px solid var(--line); font-size: 10px; color: var(--muted2);
}
@keyframes slideUp { from { transform: translateY(10px); opacity: .8; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Legacy compat: keep old .sidebar class working for pages that reference it ── */
.sidebar { display: none; }

/* ── Topbar ── */
.topbar {
  height: var(--top-h); min-height: var(--top-h);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 22px; gap: 12px;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1 1; min-width: 0; }
.topbar-actions { display: flex; gap: 8px; }
.bc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
  flex: 1 1;
}
.bc span { color: var(--muted2); }
.bc strong { color: var(--text); font-weight: 600; }
.bc .sep { color: var(--muted3); }
.bc-home { cursor: pointer; color: var(--muted2); }
.bc-home:hover { color: var(--text); }
.top-right { display: flex; align-items: center; gap: 8px; }
.top-badge {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  border: 1px solid var(--line2);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.top-badge:hover { background: var(--bg3); }
.badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  min-width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid var(--bg2);
  padding: 0;
  font-size: 0;
}

/* ── Cards / KPIs ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-gap: 16px; gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r2);
  padding: 18px 20px;
}
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.kpi-val { font-size: 28px; font-weight: 800; letter-spacing: -.8px; line-height: 1; }
.kpi-unit { font-size: 14px; font-weight: 500; }
.kpi-sub { font-size: 11.5px; color: var(--muted2); margin-top: 4px; }

/* ── Tables ── */
.tbl-wrap { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; padding: 12px 16px; font-size: 11px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg3); border-bottom: 1px solid var(--line);
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.tbl tr.hover-row:hover td { background: var(--bg3); }
.row-clickable { cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: none; background: var(--bg3);
  color: var(--text); transition: all .13s;
  font-family: var(--fw);
  letter-spacing: -.1px;
  white-space: nowrap;
}
.btn:hover { background: var(--bg4); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--amber); color: #0A0700; box-shadow: 0 0 0 1px rgba(245,158,11,.4), 0 4px 16px rgba(245,158,11,.25); }
.btn-primary:hover { background: var(--amber-light); box-shadow: 0 0 0 1px rgba(245,158,11,.5), 0 6px 24px rgba(245,158,11,.35); transform: translateY(-1px); }
.btn-green { background: var(--emerald); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.25); }
.btn-green:hover { background: var(--emerald); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,.35); }
.btn-ghost { background: transparent; border: 1px solid var(--line2); color: var(--muted); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--line2); }
.btn-danger { background: var(--rose-dim); color: var(--rose); border-color: rgba(244,63,94,.3); }
.btn-danger:hover { background: rgba(244,63,94,.2); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-ico { font-size: 13px; line-height: 1; display: inline-flex; align-items: center; }
.btn-ico-svg {
  width: 13px;
  height: 13px;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Forms ── */
.fg { margin-bottom: 16px; }
.fg label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .03em; }
.fi {
  width: 100%; padding: 10px 14px; border-radius: var(--r);
  background: var(--bg3); border: 1px solid var(--line);
  color: var(--text); font-size: 13.5px; font-family: var(--fw);
  transition: border-color .15s;
}
.fi:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.fi::placeholder { color: var(--muted2); }
select.fi { -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; }

/* ── Status badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-ok { background: var(--emerald-dim); color: var(--emerald); }
.badge-warn { background: var(--amber-dim); color: var(--amber); }
.badge-err { background: var(--rose-dim); color: var(--rose); }
.badge-info { background: var(--sky-dim); color: var(--sky); }
.badge-muted { background: var(--bg4); color: var(--muted); }

/* ── Section / Cards ── */
.section { margin-bottom: 28px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r2);
  padding: 20px 24px;
}
.card-title { font-size: 14px; font-weight: 700; }

/* ── Toasts ── */
.toast-container { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r2);
  background: var(--bg3); border: 1px solid var(--line2);
  font-size: 13px; color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  animation: slideIn .3s ease-out;
  max-width: 380px;
  min-width: 260px;
  pointer-events: all;
}
.toast.ok { border-left: 3px solid var(--emerald); }
.toast.warn { border-left: 3px solid var(--amber); }
.toast.err { border-left: 3px solid var(--rose); }
.toast-ico { font-size: 16px; line-height: 1; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted2);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state .title { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 100; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ── Alert strip ── */
.alert { padding: 12px 16px; border-radius: var(--r); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--rose-dim); border: 1px solid rgba(244,63,94,.2); color: var(--rose); }
.alert-success { background: var(--emerald-dim); border: 1px solid rgba(16,185,129,.2); color: var(--emerald); }
.alert-warn { background: var(--amber-dim); border: 1px solid rgba(245,158,11,.2); color: var(--amber); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r3);
  padding: 28px 32px; width: 100%; max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.uc-preview { max-height: 42vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.uc-preview-sec { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg3); padding: 10px; }
.uc-preview-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--amber); margin-bottom: 8px; }
.uc-preview-row { display: grid; grid-template-columns: 140px 1fr 44px; grid-gap: 8px; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); align-items: center; }
.uc-preview-row:last-child { border-bottom: none; }
.uc-preview-key { font-size: 11px; color: var(--muted2); text-transform: capitalize; }
.uc-preview-val { font-size: 12px; color: var(--text); font-family: var(--mono); }
.uc-preview-meta { font-size: 11px; color: var(--emerald); text-align: right; font-weight: 700; }

/* ── Utilities ── */
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.w-full { width: 100%; }
.sticky-top-0 { position: -webkit-sticky; position: sticky; top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 12px; gap: 12px; }
.grid-main-side { display: grid; grid-template-columns: 1fr 340px; grid-gap: 18px; gap: 18px; }
.flex-gap-5 { display: flex; gap: 5px; }
.flex-gap-8 { display: flex; gap: 8px; }
.flex-col-gap-6 { display: flex; flex-direction: column; gap: 6px; }
.flex-col-gap-8 { display: flex; flex-direction: column; gap: 8px; }
.flex-col-gap-14 { display: flex; flex-direction: column; gap: 14px; }
.text-muted { color: var(--muted); }
.text-muted-2 { color: var(--muted2); }
.text-rose { color: var(--rose); }
.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-sky { color: var(--sky); }
.text-mono { font-family: var(--mono); }
.text-11 { font-size: 11px; }
.text-12 { font-size: 12px; }
.fw-400 { font-weight: 400; }
.fw-700 { font-weight: 700; }
.line-through { text-decoration: line-through; }
.center-y { display: flex; align-items: center; }
.center-between { display: flex; align-items: center; justify-content: space-between; }
.justify-center { justify-content: center; }
.link-btn {
  background: none;
  border: none;
  color: var(--sky);
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--fw);
  padding: 0;
}
.nav-link { text-decoration: none; }
.tag-10 { font-size: 10px; }
.card-stat-money { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--emerald); }
.kpi-v-20 { font-size: 20px; }
.sk-260 { height: 260px; }
.sk-300 { height: 300px; }
.grad-amber-emerald { background: linear-gradient(90deg, var(--amber), var(--emerald)); }

/* ── v2 Parity Layer (structure + positioning) ── */
.page-head { margin-bottom: 24px; }
.page-title { font-size: 23px; font-weight: 800; letter-spacing: -.6px; line-height: 1.15; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 14px; gap: 14px; margin-bottom: 22px; }
.kpi-card { position: relative; overflow: hidden; }
.kpi-card:hover { border-color: var(--line2); transform: translateY(-1px); transition: border-color .15s, transform .15s; }
.kpi-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  filter: blur(24px);
  opacity: .2;
}
.kpi-amber::after { background: var(--amber); }
.kpi-green::after { background: var(--emerald); }
.kpi-sky::after { background: var(--sky); }
.kpi-rose::after { background: var(--rose); }
.kpi-delta { margin-top: 4px; font-size: 11px; color: var(--muted2); }

.sparks { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 14px; gap: 14px; margin-bottom: 22px; }
.spark { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r2); padding: 16px 18px; }
.sp-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted2); margin-bottom: 4px; }
.sp-val { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 10px; line-height: 1; }
.sp-bars { display: flex; align-items: flex-end; gap: 2.5px; height: 44px; }
.sp-bar { flex: 1 1; border-radius: 2px 2px 0 0; min-height: 4px; }
.usina-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 14px; gap: 14px; margin-bottom: 22px; }
.usina-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.usina-card:hover { border-color: var(--line2); transform: translateY(-2px); }
.uc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.uc-nm { font-size: 14px; font-weight: 700; color: var(--text); }
.uc-loc { font-size: 11.5px; color: var(--muted2); margin-top: 2px; }
.uc-kpis { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; gap: 10px; margin-bottom: 12px; }
.uc-kpi { background: var(--bg3); border-radius: var(--r); padding: 10px; border: none; }
.uc-kpi-l { font-size: 9.5px; color: var(--muted2); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.uc-kpi-v { font-size: 16px; color: var(--text); font-weight: 800; letter-spacing: -.3px; }
.eff-bar-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted2); }
.progress { height: 6px; border-radius: 3px; background: var(--bg4); overflow: hidden; border: none; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--emerald); transition: width .6s; }

.tbl-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
.tbl td.primary { color: var(--text); font-weight: 600; }
.tbl td.code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.pager { display: flex; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.pager-info { font-size: 12px; color: var(--muted2); flex: 1 1; }
.pager-btns { display: flex; gap: 3px; align-items: center; }
.pgb {
  min-width: 30px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
  transition: all .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.pgb:hover { background: var(--bg3); border-color: var(--line2); color: var(--text); }
.pgb.on { background: var(--amber); border-color: var(--amber); color: #0A0700; font-weight: 700; }
.pgb:disabled { opacity: .3; cursor: not-allowed; }

.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); }

.alert-info { background: var(--sky-dim); border: 1px solid rgba(56,189,248,.2); color: var(--sky); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tag-ok { background: var(--emerald-dim); color: var(--emerald); border: 1px solid rgba(16,185,129,.2); }
.tag-warn { background: var(--rose-dim); color: var(--rose); border: 1px solid rgba(244,63,94,.2); }
.tag-amber { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,.2); }
.tag-sky { background: var(--sky-dim); color: var(--sky); border: 1px solid rgba(56,189,248,.2); }
.tag-grey { background: var(--bg4); color: var(--muted); border: 1px solid var(--line); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--amber-dim); border: 1px solid rgba(245,158,11,.25);
  border-radius: 20px; padding: 3px 10px; font-size: 11px; color: var(--amber);
}
.chip:hover { background: var(--amber-glow); }
button.chip {
  font-family: var(--fw);
  cursor: pointer;
}
.chip-x { opacity: .65; font-size: 13px; line-height: 1; }

.filterbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.searchbar {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0 12px; height: 36px;
  flex: 1 1; min-width: 160px; max-width: 280px; transition: border-color .15s;
}
.searchbar:focus-within { border-color: var(--amber); }
.searchbar input { background: none; border: none; outline: none; color: var(--text); font-size: 12.5px; font-family: var(--fw); width: 100%; }
.searchbar input::placeholder { color: var(--muted2); }
.sel-wrap { position: relative; display: inline-flex; align-items: center; min-width: 180px; }
.sel-wrap .fi {
  height: 36px;
  padding: 0 32px 0 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--muted);
  font-size: 12.5px;
}
.sel-wrap::after {
  content: '▾';
  position: absolute;
  right: 9px;
  color: var(--muted2);
  font-size: 10px;
  pointer-events: none;
}

.dash-grid { display: grid; grid-template-columns: 1fr 340px; grid-gap: 18px; gap: 18px; }
.page-content.dash-v2 { padding: 24px 28px; }
.dash-v2 .card { padding: 0; }
.dash-v2 .kpi-card { padding: 18px; }
.dash-v2 .kpi-card:hover { transform: translateY(-2px); }
.dash-v2 .kpi-card::after {
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  filter: blur(28px);
  opacity: .25;
}
.dash-v2 .kpi-ico { font-size: 22px; margin-bottom: 10px; line-height: 1; }
.dash-v2 .kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 6px;
}
.dash-v2 .kpi-val { font-size: 28px; font-weight: 800; letter-spacing: -.8px; line-height: 1; }
.dash-v2 .kpi-unit { font-size: 14px; font-weight: 500; }
.dash-v2 .kpi-unit-muted { color: var(--muted2); }
.dash-v2 .kpi-money { font-size: 22px; letter-spacing: -.5px; }
.dash-v2 .sp-val { font-size: 22px; }
.dash-v2 .card-title { font-size: 14px; font-weight: 700; }
.dash-v2 .card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dash-v2 .card-body { padding: 18px; }
.dash-v2 .card-head .card-title { display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.dash-v2 .kpi-delta { font-size: 11.5px; margin-top: 7px; }
.dash-v2 .kpi-row { gap: 14px; margin-bottom: 22px; }
.dash-v2 .sparks { gap: 14px; margin-bottom: 22px; }
.dash-v2 .page-actions .btn-sm { padding: 5px 10px; font-size: 11.5px; }
.dash-card { padding: 0; overflow: hidden; }
.dash-card .card-head { padding: 14px 18px; }
.dash-card .card-body { padding: 18px; }
.dash-v2 .progress {
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  border: none;
}
.dash-v2 .progress-fill {
  border-radius: 3px;
  transition: width .6s;
}
.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: none; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.tl-msg { font-size: 13px; color: var(--text); }
.tl-time { font-size: 11px; color: var(--muted2); margin-top: 2px; }
.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-row { display: flex; align-items: center; justify-content: space-between; }
.status-l { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot-operacional { background: var(--emerald); }
.status-dot-manutencao { background: var(--amber); }
.status-dot-alerta { background: var(--rose); }
.status-v { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.timeline-tight { padding: 6px 18px !important; }
.status-progress { margin-top: 8px; }
.alert-strip {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 16px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  background: var(--bg3);
  color: var(--text);
  line-height: 1.35;
}
.alert-strip:hover { border-color: var(--line2); }
.alert-strip.alert-warn { background: var(--amber-dim); border-color: rgba(245,158,11,.2); color: var(--amber); }
.alert-strip.alert-err { background: var(--rose-dim); border-color: rgba(244,63,94,.22); color: var(--rose); }
.alert-strip.alert-ok { background: var(--emerald-dim); border-color: rgba(16,185,129,.2); color: var(--emerald); }
.dash-v2 .alert-strip { margin: 0; font-size: 12px; }
.dash-quick-btn { width: 100%; justify-content: center; font-size: 12.5px; padding: 7px 14px; }
.dash-v2 .btn.btn-primary { border: none; }
.dash-v2 .btn.btn-green { border: none; }
.dash-v2 .up { color: var(--emerald); }
.dash-v2 .ne { color: var(--muted2); }
.gen-bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-gap: 5px;
  gap: 5px;
  align-items: end;
  height: 130px;
  padding-top: 10px;
}
.gen-col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.gen-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: rgba(245,158,11,.25);
  min-height: 8px;
  transition: background .1s;
}
.gen-bar:hover { background: rgba(245,158,11,.65); }
.gen-label {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--muted2);
  letter-spacing: .04em;
}

@media (min-width: 1440px) {
  .dash-v2 .kpi-val { font-size: 30px; }
  .dash-v2 .kpi-money { font-size: 23px; }
  .dash-v2 .dash-grid { grid-template-columns: 1fr 356px; }
  .dash-v2 .status-l { font-size: 13.5px; }
}

@media (max-width: 1366px) and (min-width: 1101px) {
  .page-content.dash-v2 { padding: 22px 24px; }
  .dash-v2 .kpi-val { font-size: 27px; }
  .dash-v2 .kpi-money { font-size: 21px; }
  .dash-v2 .sp-val { font-size: 21px; }
  .dash-v2 .dash-grid { grid-template-columns: 1fr 330px; gap: 16px; }
  .dash-v2 .dash-card .card-head { padding: 13px 16px; }
  .dash-v2 .dash-card .card-body { padding: 16px; }
}

.wizard-steps { display: flex; align-items: center; gap: 0; margin-bottom: 28px; overflow-x: auto; padding-bottom: 4px; }
.dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-gap: 10px; gap: 10px; margin-bottom: 22px; }
.dropzone {
  border: 2px dashed var(--line2); border-radius: var(--r2);
  padding: 48px 24px; text-align: center; cursor: pointer; transition: all .2s; background: var(--bg3);
}
.dropzone:hover, .dropzone.drag { border-color: var(--amber); background: var(--amber-dim); }
.dz-ico { font-size: 52px; display: block; margin-bottom: 14px; }
.dz-title { font-size: 16px; font-weight: 700; letter-spacing: 0; margin-bottom: 6px; }
.dz-sub { font-size: 12.5px; color: var(--muted2); margin-top: 4px; }
.upload-hidden { display: none; }
.leitura-intro { text-align: center; margin-bottom: 24px; }
.leitura-intro-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 6px; }
.leitura-intro-sub { font-size: 13px; color: var(--muted2); }
.dist-selected { font-size: 10px; color: var(--amber); margin-top: 4px; font-weight: 700; }
.leitura-right-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.leitura-center-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.leitura-processing { text-align: center; padding: 60px 20px 24px; }
.leitura-spinner { font-size: 56px; display: inline-block; margin-bottom: 18px; animation: leitura-spin 1.2s linear infinite; }
.leitura-processing-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.leitura-processing-sub { font-size: 13px; color: var(--muted2); margin-bottom: 18px; }
.leitura-checks { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; justify-content: center; font-size: 11.5px; }
@keyframes leitura-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.wizard-steps { display: flex; align-items: center; gap: 0; margin-bottom: 28px; overflow-x: auto; padding-bottom: 4px; }
.wstep { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.wstep-circle {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--line2); background: var(--bg3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted2);
  position: relative;
  z-index: 1;
  transition: all .25s;
}
.wstep.current .wstep-circle { background: var(--amber); color: #0A0700; border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-dim); }
.wstep.done .wstep-circle { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.wstep-label { font-size: 12px; color: var(--muted2); margin: 0 10px; white-space: nowrap; font-weight: 500; }
.wstep.current .wstep-label,
.wstep.done .wstep-label { color: var(--text); }
.wstep-line { height: 2px; width: 32px; background: var(--line); flex-shrink: 0; margin: 0; }
.wstep.done + .wstep .wstep-line,
.wstep.done .wstep-line,
.wstep-line.done { background: var(--emerald); }

.dist-btn {
  background: var(--bg2); border: 1.5px solid var(--line); border-radius: var(--r2);
  padding: 14px 10px; text-align: center; cursor: pointer; transition: all .15s;
}
.dist-btn:hover { border-color: var(--amber); transform: translateY(-2px); }
.dist-btn.sel { border-color: var(--amber); background: var(--amber-dim); }
.dist-ico { font-size: 28px; display: block; margin-bottom: 6px; }
.dist-name { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.dist-btn.sel .dist-name { color: var(--amber); }

.extract-card { border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg2); overflow: hidden; }
.ec-header { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(16,185,129,.08), transparent); flex-wrap: wrap; }
.ec-emoji { font-size: 36px; line-height: 1; }
.ec-title { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.ec-sub { font-size: 12px; color: var(--muted2); margin-top: 2px; }
.ec-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ec-kpis { display: grid; grid-template-columns: repeat(3, 1fr); }
.ec-kpi { padding: 14px 20px; border-right: 1px solid var(--line); }
.ec-kpi:last-child { border-right: none; }
.ec-kpi-label { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.ec-kpi-val { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.ec-body { padding: 20px; }
.ec-fields { display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; gap: 10px; }
.ec-field { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg3); padding: 10px 13px; }
.ec-fl { font-size: 9.5px; color: var(--muted2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.ec-fv { font-size: 13px; color: var(--text); font-family: var(--mono); }
.ec-fv.ok { color: var(--text); }
.ec-fv.warn { color: var(--amber); }
.incons-box { margin-top: 14px; border: 1px solid rgba(244,63,94,.2); background: var(--rose-dim); border-radius: var(--r); padding: 14px 16px; }
.incons-title { font-size: 12px; font-weight: 700; color: var(--rose); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.incons-item { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.ia-confidence-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ia-confidence-track { width: 72px; height: 7px; background: var(--bg4); border-radius: 999px; overflow: hidden; }
.ia-confidence-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.pdf-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg3);
  height: 340px;
  overflow: hidden;
}
.pdf-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0f172a;
}
.perf-list { display: grid; grid-gap: 10px; gap: 10px; }
.perf-item {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg3);
  padding: 10px 12px;
}
.perf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.perf-name { font-size: 12px; font-weight: 700; color: var(--text); }
.perf-meta { font-size: 11px; color: var(--muted2); }
.aging-bars { display: grid; grid-gap: 8px; gap: 8px; }
.aging-row { display: grid; grid-template-columns: 54px 1fr 36px; align-items: center; grid-gap: 8px; gap: 8px; }
.aging-label { font-size: 11px; color: var(--muted2); font-family: var(--mono); }
.tabs-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-btn {
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--muted);
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}
.tab-btn.active { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg4);
  border: 1px solid var(--line2);
  border-radius: 999px;
  transition: .2s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background: var(--muted2);
  border-radius: 50%;
  transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(16,185,129,.24); border-color: rgba(16,185,129,.45); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background: var(--emerald); }
.integr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.integr-item:last-child { border-bottom: none; }
.danger-card { border-color: rgba(244,63,94,.3); box-shadow: inset 0 0 0 1px rgba(244,63,94,.2); }
.code-block {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
}

.sim-layout { display: grid; grid-template-columns: 1fr 370px; grid-gap: 20px; gap: 20px; }
.range-group { margin-bottom: 18px; }
.range-group label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.range-group label span { color: var(--amber); font-family: var(--mono); font-weight: 700; }
.range-group input[type="range"] { width: 100%; accent-color: var(--amber); cursor: pointer; height: 4px; }
.range-hint { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted3); margin-top: 4px; }
.result-hero { border: 1px solid rgba(16,185,129,.18); border-radius: var(--r2); background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(245,158,11,.06)); padding: 22px; margin-bottom: 18px; text-align: center; }
.res-big { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; color: var(--emerald); }
.res-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.res-rows { display: flex; flex-direction: column; gap: 6px; }
.res-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.res-row:last-child { border-bottom: none; }
.res-l { font-size: 13px; color: var(--muted); }
.res-v { font-size: 13px; font-family: var(--mono); color: var(--text); font-weight: 600; }

.tenant-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-gap: 14px; gap: 14px; }
.t-card { border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg2); padding: 18px; cursor: pointer; transition: border-color .14s, transform .14s; }
.t-card:hover { border-color: var(--amber); transform: translateY(-2px); }
.t-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.t-logo { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.t-logo-amber { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,.35); }
.t-name { font-size: 14px; font-weight: 700; color: var(--text); }
.t-stats { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 8px; gap: 8px; }
.t-stat { background: var(--bg3); border-radius: var(--r); padding: 8px; text-align: center; border: none; }
.t-stat-v { font-size: 15px; font-weight: 800; font-family: var(--mono); }
.t-stat-l { font-size: 9.5px; color: var(--muted2); text-transform: uppercase; letter-spacing: .06em; }

.regua { display: flex; flex-direction: column; gap: 8px; }
.regua-step { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg3); border-radius: var(--r); padding: 10px 14px; }
.regua-step.active { border-color: var(--amber); background: var(--amber-dim); }
.regua-n { width: 22px; height: 22px; border-radius: 50%; background: var(--bg4); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; min-width: 22px; color: var(--text); }
.regua-step.active .regua-n { background: var(--amber); color: #0A0700; }
.regua-title { font-size: 13px; color: var(--text); font-weight: 600; }
.regua-info { flex: 1 1; }
.inad-heat { display: grid; grid-template-columns: repeat(7, 1fr); grid-gap: 4px; gap: 4px; }
.heat-cell { aspect-ratio: 1; border-radius: 4px; }
.link { color: var(--sky); text-decoration: underline; font-size: 12px; }
.link:hover { color: #7dd3fc; }

.panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: 520px;
  background: var(--bg2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 60;
  transform: translateX(110%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  box-shadow: -12px 0 48px rgba(0,0,0,.6);
}
.panel.show { transform: none; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.panel-title { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.panel-body { flex: 1 1; overflow-y: auto; padding: 20px; }
.p-section { margin-bottom: 22px; }
.p-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted2);
  margin-bottom: 10px;
}
.p-grid { display: grid; grid-template-columns: 140px 1fr; grid-gap: 7px 14px; gap: 7px 14px; }
.p-k { font-size: 12.5px; color: var(--muted2); }
.p-v {
  font-size: 12px;
  color: var(--text);
  font-family: var(--mono);
  word-break: break-all;
}
.panel-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  background: var(--bg3);
  border: 1px solid var(--line2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.panel-close:hover { background: var(--bg4); color: var(--text); }
.panel-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 55;
}

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .sparks { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .sim-layout { grid-template-columns: 1fr; }
  .ec-kpis { grid-template-columns: 1fr; }
  .ec-kpi { border-right: none; border-bottom: 1px solid var(--line); }
  .ec-kpi:last-child { border-bottom: none; }
  .ec-fields { grid-template-columns: 1fr; }
  .page-content.dash-v2 { padding: 20px 20px; }
  .dash-v2 .dash-card .card-head { padding: 13px 16px; }
  .dash-v2 .dash-card .card-body { padding: 16px; }
  .dash-v2 .alert-strip { font-size: 12px; padding: 11px 12px; }
}

@media (max-width: 768px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .sparks { grid-template-columns: 1fr; }
  .panel { width: 100%; left: 0; border-left: none; border-top: 1px solid var(--line); }
  .page-content.dash-v2 { padding: 16px; }
  .dash-v2 .kpi-val { font-size: 24px; }
  .dash-v2 .kpi-money { font-size: 20px; }
  .dash-v2 .kpi-ico { font-size: 20px; margin-bottom: 8px; }
  .dash-v2 .status-l { font-size: 12.5px; }
  .dash-v2 .status-v { font-size: 12px; }
}

@media (max-width: 480px) {
  .kpi-grid, .kpi-row { grid-template-columns: 1fr; }
  .page-actions { width: 100%; margin-left: 0; }
  .page-actions .btn { flex: 1 1; justify-content: center; }
}

/* ── Tab Panel ───────────────────────────────────────── */
.tab-panel { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding: 0 4px; }
.tab-btn { background: none; border: none; color: var(--muted); font: 500 12px/1 var(--fw); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; }
.tab-btn:hover { color: var(--text); background: var(--bg3); }
.tab-btn.tab-active { color: var(--sky); border-bottom-color: var(--sky); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--rose); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; margin-left: 6px; padding: 0 4px; }

/* ── Source Label ─────────────────────────────────────── */
.source-label { display: inline-block; font-size: 9px; font-weight: 600; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.5px; }
.source-imported { background: var(--muted3); color: var(--muted); }
.source-recalculated { background: var(--sky-dim); color: var(--sky); }
.source-estimated { background: var(--amber-dim); color: var(--amber); }
.source-simulated { background: rgba(139,92,246,.12); color: var(--violet); }

/* ── Money Value ──────────────────────────────────────── */
.money-value { display: inline-flex; align-items: center; gap: 4px; }
.money-sm { font-size: 12px; }
.money-lg { font-size: 18px; }

/* ── Divergence Badge ─────────────────────────────────── */
.divergence-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 4px; }
.divergence-match { background: var(--emerald-dim); color: var(--emerald); }
.divergence-media { background: var(--amber-dim); color: var(--amber); }
.divergence-alta { background: rgba(249,115,22,.12); color: #F97316; }
.divergence-critical { background: var(--rose-dim); color: var(--rose); }

/* ── Calculation Breakdown Table ──────────────────────── */
.calc-breakdown { overflow-x: auto; }
.calc-breakdown .tbl-compact { width: 100%; border-collapse: collapse; }
.calc-breakdown .tbl-compact th { font-size: 10px; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); letter-spacing: 0.5px; }
.calc-breakdown .tbl-compact td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.calc-breakdown .row-credit td { background: rgba(16,185,129,.04); }
.calc-breakdown .row-subtotal td { background: var(--bg3); border-top: 1px solid var(--line2); }
.calc-breakdown .row-separator td { border-bottom: none; padding-bottom: 2px; }
.calc-breakdown .row-total td { background: var(--bg4); border-top: 2px solid var(--line2); }

/* ── Alert Inline ─────────────────────────────────────── */
.alert-inline { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 12px; }
.alert-inline-warn { background: var(--amber-dim); border: 1px solid var(--amber-glow); color: var(--amber); }
.alert-inline-info { background: var(--sky-dim); border: 1px solid rgba(56,189,248,.25); color: var(--sky); }
.alert-inline-error { background: var(--rose-dim); border: 1px solid rgba(244,63,94,.25); color: var(--rose); }
.alert-inline-ok { background: var(--emerald-dim); border: 1px solid rgba(16,185,129,.25); color: var(--emerald); }

/* ── Comparison Card ──────────────────────────────────── */
.comparison-grid { display: grid; grid-template-columns: 1fr auto 1fr; grid-gap: 12px; gap: 12px; align-items: center; padding: 12px; background: var(--bg3); border-radius: 8px; margin-bottom: 12px; }
.comparison-vs { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; }
.comparison-side { text-align: center; }
.comparison-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.comparison-val { font-size: 16px; font-weight: 700; font-family: var(--mono); }

