/* =====================================================================
   Azure FinOps Dashboard - estilos
   Inspirado no Azure Portal / Fluent 2. Tema claro e escuro por tokens.
   ===================================================================== */
:root {
  color-scheme: light;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --page: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-hover: #f0f3f7;
  --border: #e3e6ea;
  --border-strong: #c8cdd3;
  --text: #1b1d21;
  --text-2: #5f6670;
  --text-3: #8a9099;
  --accent: #0f6cbd;
  --accent-hover: #115ea3;
  --accent-soft: #e8f2fc;
  --header: #0b2440;
  --header-text: #ffffff;
  --grid: #eceef1;
  --axis: #c2c7ce;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --good: #0aac23; --good-text: #0b7a1d;
  --warning: #fbb315; --warning-text: #8a5a00;
  --serious: #f18a59; --serious-text: #a64a1c;
  --critical: #dc3c3d; --critical-text: #b3261e;
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600;
  --s5: #ee7fac; --s6: #008a17; --s7: #6a4ce2; --s8: #ec4647;
  --s-other: #a3a9b1;
  --seq-1: #cce3fd; --seq-3: #84b9f3; --seq-5: #338ced; --seq-7: #1b64be; --seq-9: #0e3d7e;
  --radius: 8px;
  --radius-sm: 6px;
  --nav-w: 232px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111214; --surface: #1b1d21; --surface-2: #202328; --surface-hover: #262a30;
    --border: #2e3238; --border-strong: #41464e; --text: #eceef1; --text-2: #a3a9b1; --text-3: #7b828c;
    --accent: #479ef5; --accent-hover: #62abf5; --accent-soft: #10284a; --header: #0b0c0e; --header-text: #eceef1;
    --grid: #2a2d33; --axis: #474b52; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.6);
    --good-text: #53c556; --warning-text: #fbb315; --serious-text: #f18a59; --critical-text: #f07576;
    --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263;
    --s-other: #6b7179;
    --seq-1: #10284a; --seq-3: #1757ac; --seq-5: #2370cd; --seq-7: #519ced; --seq-9: #9dc8f7;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111214; --surface: #1b1d21; --surface-2: #202328; --surface-hover: #262a30;
  --border: #2e3238; --border-strong: #41464e; --text: #eceef1; --text-2: #a3a9b1; --text-3: #7b828c;
  --accent: #479ef5; --accent-hover: #62abf5; --accent-soft: #10284a; --header: #0b0c0e; --header-text: #eceef1;
  --grid: #2a2d33; --axis: #474b52; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.6);
  --good-text: #53c556; --warning-text: #fbb315; --serious-text: #f18a59; --critical-text: #f07576;
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263;
  --s-other: #6b7179;
  --seq-1: #10284a; --seq-3: #1757ac; --seq-5: #2370cd; --seq-7: #519ced; --seq-9: #9dc8f7;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow-x: hidden; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--page); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- topo */
.topbar { position: sticky; top: 0; z-index: 40; height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--header); color: var(--header-text); }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.topbar .brand-logo { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: linear-gradient(135deg, #2b88d8, #0f6cbd); }
.topbar .brand small { font-weight: 400; opacity: .7; margin-left: 4px; }
.topbar .spacer { flex: 1; }
.topbar .icon-btn { color: var(--header-text); }
.topbar .icon-btn:hover { background: rgba(255,255,255,.12); }
.fresh-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1); white-space: nowrap; }
.fresh-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.fresh-pill.stale .dot { background: var(--warning); }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--radius-sm); background: transparent; border: 0; color: var(--header-text); cursor: pointer; }
.user-btn:hover { background: rgba(255,255,255,.12); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #2b88d8; color: #fff; font-size: 12px; font-weight: 600; }
.user-btn .who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; font-size: 12px; }
.user-btn .who small { opacity: .7; }
.topbar .menu-toggle { display: none; }

/* ---------------------------------------------------------------- estrutura */
.shell { display: flex; min-height: calc(100vh - 48px); }
.sidenav { width: var(--nav-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 12px 8px; position: sticky; top: 48px; height: calc(100vh - 48px); overflow-y: auto; }
.sidenav .nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 12px 6px; }
.sidenav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); font-size: 14px; position: relative; }
.sidenav a:hover { background: var(--surface-hover); text-decoration: none; }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidenav a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.sidenav .badge { margin-left: auto; }
main { flex: 1; min-width: 0; padding: 20px 24px 40px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 600; margin: 0; }
.page-head .sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- botões e controles */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; font-size: 13px; }
.btn:hover { background: var(--surface-hover); }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.danger { color: var(--critical-text); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 30px; cursor: pointer; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.select, .input { height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); padding: 0 10px; font-size: 13px; min-width: 0; }
.select:focus, .input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea.input { height: auto; padding: 8px 10px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
label.field > .input, label.field > .select { width: 100%; color: var(--text); font-size: 14px; }

/* ---------------------------------------------------------------- barra de filtros */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; position: sticky; top: 56px; z-index: 30; }
.filterbar .divider { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 13px; max-width: 320px; }
.pill-btn:hover { background: var(--surface-hover); }
.pill-btn b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-btn .k { color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; border: 1px solid transparent; max-width: 340px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .k { color: var(--text-2); }
.chip button { border: 0; background: transparent; color: inherit; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.chip button:hover { background: rgba(15,108,189,.15); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 13px; padding: 4px 6px; }

/* ---------------------------------------------------------------- popovers / dropdown */
.popover { position: fixed; z-index: 100; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 240px; max-width: min(420px, calc(100vw - 24px)); max-height: min(480px, calc(100vh - 80px)); display: flex; flex-direction: column; overflow: hidden; }
.popover .pop-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.popover .pop-title { font-weight: 600; font-size: 13px; }
.popover .pop-body { overflow-y: auto; padding: 4px; flex: 1; }
.popover .pop-foot { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.opt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.opt:hover, .opt.focus { background: var(--surface-hover); }
.opt input { margin: 0; accent-color: var(--accent); }
.opt .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .meta { color: var(--text-3); font-size: 12px; }
.opt .check { width: 16px; color: var(--accent); font-weight: 700; }
.opt.sel { font-weight: 600; }
.pop-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------------------------------------------------------------- cards e grid */
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 4px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .hint { color: var(--text-2); font-size: 12px; width: 100%; margin-top: -2px; }
.card-head .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.seg { max-width: 100%; overflow-x: auto; }
.card-body { padding: 8px 16px 16px; flex: 1; min-width: 0; }
.chart { width: 100%; height: 300px; }
.chart.tall { height: 380px; }
.chart.short { height: 240px; }
.chart.xs { height: 180px; }

/* ---------------------------------------------------------------- KPI */
.kpi { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.kpi .label .icon { color: var(--text-3); }
.kpi .value { font-size: 26px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero .value { font-size: 34px; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; min-height: 20px; }
.kpi .spark { height: 34px; margin-top: 4px; }
.kpi .meter { margin-top: 6px; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--border-strong); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.delta.up-bad { color: var(--critical-text); background: color-mix(in srgb, var(--critical) 12%, transparent); }
.delta.down-good { color: var(--good-text); background: color-mix(in srgb, var(--good) 12%, transparent); }
.delta.neutral { color: var(--text-2); background: var(--surface-2); }
.meter { position: relative; height: 8px; border-radius: 999px; background: var(--seq-1); overflow: visible; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.meter .fill.warning { background: var(--warning); }
.meter .fill.serious { background: var(--serious); }
.meter .fill.critical { background: var(--critical); }
.meter .marker { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); border-radius: 1px; }
.meter .marker::after { content: attr(data-label); position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-2); white-space: nowrap; }

/* ---------------------------------------------------------------- status / badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge .sdot { width: 8px; height: 8px; border-radius: 50%; }
.badge.good { color: var(--good-text); } .badge.good .sdot { background: var(--good); }
.badge.warning { color: var(--warning-text); } .badge.warning .sdot { background: var(--warning); }
.badge.serious { color: var(--serious-text); } .badge.serious .sdot { background: var(--serious); }
.badge.critical { color: var(--critical-text); } .badge.critical .sdot { background: var(--critical); }
.badge.info { color: var(--accent); } .badge.info .sdot { background: var(--accent); }
.count-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); margin: 1px 2px 1px 0; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tag b { color: var(--text); font-weight: 600; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------------------------------------------------------------- tabelas */
.table-wrap { overflow: auto; border-top: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; user-select: none; }
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--text); }
table.data th .arrow { opacity: .6; margin-left: 3px; }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-hover); }
table.data tr.clickable { cursor: pointer; }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td .cell-main { font-weight: 600; display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data td .cell-sub { color: var(--text-2); font-size: 12px; display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sharebar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.sharebar .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sharebar .bar i { display: block; height: 100%; background: var(--s1); border-radius: 999px; }
.sharebar span { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.legend-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend-list .li { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 4px; border-radius: 4px; }
.legend-list .li:hover { background: var(--surface-hover); }
.legend-list .li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-list .li .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-list .li .p { color: var(--text-2); font-variant-numeric: tabular-nums; width: 46px; text-align: right; font-size: 12px; }

/* ---------------------------------------------------------------- orçamentos */
.budget-card .card-body { display: flex; flex-direction: column; gap: 10px; }
.budget-figs { display: flex; gap: 18px; flex-wrap: wrap; }
.budget-figs div { display: flex; flex-direction: column; }
.budget-figs small { color: var(--text-2); font-size: 12px; }
.budget-figs b { font-size: 18px; font-weight: 600; }

/* ---------------------------------------------------------------- estados */
.empty { padding: 40px 16px; text-align: center; color: var(--text-2); }
.empty .icon { width: 32px; height: 32px; color: var(--text-3); margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-hover) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading-bar { position: fixed; top: 48px; left: 0; height: 2px; background: var(--accent); z-index: 60; width: 0; transition: width .3s ease, opacity .3s; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; margin-bottom: 16px; }
.notice.warn { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.notice.info { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }

/* ---------------------------------------------------------------- modal / drawer / toast */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { padding: 16px 20px 8px; display: flex; align-items: center; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.modal-body { padding: 8px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drawer { position: fixed; top: 48px; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 80; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; }
.drawer.open { transform: none; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h2 { margin: 0; font-size: 17px; word-break: break-all; }
.drawer-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; word-break: break-word; }
.toasts { position: fixed; bottom: 16px; right: 16px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; max-width: 380px; display: flex; gap: 8px; align-items: center; }
.toast.error { background: var(--critical); color: #fff; }

/* ---------------------------------------------------------------- login */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% 0%, color-mix(in srgb, var(--accent) 18%, var(--page)), var(--page)); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: min(420px, 100%); box-shadow: var(--shadow-lg); text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card p { margin: 0; color: var(--text-2); }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1280px) {
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  :root { --nav-w: 60px; }
  .sidenav .nav-group, .sidenav a .txt, .sidenav .badge { display: none; }
  .sidenav a { justify-content: center; padding: 10px; }
  .g-21, .g-12, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .user-btn .who { display: none; }
}
@media (max-width: 720px) {
  .topbar .menu-toggle { display: inline-grid; }
  .sidenav { position: fixed; left: 0; top: 48px; z-index: 70; width: 240px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidenav.open { transform: none; }
  .sidenav .nav-group, .sidenav a .txt, .sidenav .badge { display: initial; }
  .sidenav a { justify-content: flex-start; padding: 8px 12px; }
  main { padding: 14px 16px 32px; }
  .g-kpi, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .filterbar { position: static; }
  .fresh-pill, .topbar .brand small { display: none; }
  .kpi .value { font-size: 22px; }
  .kpi.hero .value { font-size: 28px; }
  .form-row { grid-template-columns: 1fr; }
  .chart.tall { height: 320px; }
}
@media print {
  .topbar, .sidenav, .filterbar .btn, .page-head .actions { display: none !important; }
  main { padding: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}
