/* ==========================================================================
   Painel de Suprimentos EPC-15 — tema claro/escuro com gradientes
   Cores em variáveis: o tema escuro só redefine os tokens.
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #F3F5FB;
  --surface: #FFFFFF;
  --surface-2: #F6F8FC;
  --surface-3: #EEF1F8;
  --line: #E4E8F1;
  --line-soft: #EEF1F7;
  --line-strong: #CFD6E4;
  --text: #0F172A;
  --text-2: #475569;
  --muted: #64748B;

  --brand: #4F46E5;
  --brand-ink: #3730A3;
  --brand-soft: #EEF0FF;
  --brand-line: #C7CCFB;
  --ring: rgba(79, 70, 229, .18);
  --row-hover: #F5F6FF;

  --good: #059669; --good-soft: #D1FAE5; --good-ink: #065F46;
  --warn: #D97706; --warn-soft: #FEF3C7; --warn-ink: #92400E;
  --bad: #DC2626;  --bad-soft: #FEE2E2;  --bad-ink: #991B1B;
  --info-soft: #E0F2FE; --info-ink: #075985;
  --violet-soft: #EDE9FE; --violet-ink: #5B21B6;

  /* Gradientes */
  --grad-brand: linear-gradient(135deg, #0B7FC1 0%, #4F46E5 55%, #7C3AED 100%);
  --grad-hero: linear-gradient(120deg, #0B6FAE 0%, #3B3FD8 48%, #7C3AED 82%, #C026D3 115%);
  --grad-side: linear-gradient(185deg, #0B2F57 0%, #17256B 45%, #34186E 100%);
  --grad-good: linear-gradient(90deg, #10B981, #14B8A6);
  --grad-warn: linear-gradient(90deg, #F59E0B, #F97316);
  --grad-bad: linear-gradient(90deg, #EF4444, #EC4899);
  --glow-1: rgba(124, 58, 237, .10);
  --glow-2: rgba(14, 165, 233, .10);

  /* Gráficos (lidos pelo charts.js) */
  --chart-text: #516079;
  --chart-grid: #E8ECF4;
  --chart-label: #1E293B;
  --chart-a: #38BDF8;
  --chart-b: #4F46E5;
  --chart-soft-a: #D6DCFE;
  --chart-soft-b: #A5B1FB;
  --chart-teal-a: #5EEAD4;
  --chart-teal-b: #0D9488;
  --chart-plan: #94A3B8;
  --chart-proj: #F97316;
  --chart-real: #4F46E5;
  --chart-today: #E11D48;
  --chart-tip: #0F172A;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .14);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 20px 40px -16px rgba(30, 27, 110, .28);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-num: "Segoe UI Variable Display", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A0F1E;
    --surface: #111831;
    --surface-2: #161E3B;
    --surface-3: #1C2548;
    --line: #232D52;
    --line-soft: #1B2446;
    --line-strong: #33406E;
    --text: #E7EBF7;
    --text-2: #B3BCD8;
    --muted: #8B96B8;
    --brand: #8B93FF;
    --brand-ink: #C7CBFF;
    --brand-soft: rgba(139, 147, 255, .14);
    --brand-line: rgba(139, 147, 255, .38);
    --ring: rgba(139, 147, 255, .28);
    --row-hover: rgba(139, 147, 255, .07);
    --good: #34D399; --good-soft: rgba(52, 211, 153, .14); --good-ink: #6EE7B7;
    --warn: #FBBF24; --warn-soft: rgba(251, 191, 36, .14); --warn-ink: #FCD34D;
    --bad: #F87171;  --bad-soft: rgba(248, 113, 113, .15); --bad-ink: #FCA5A5;
    --info-soft: rgba(56, 189, 248, .14); --info-ink: #7DD3FC;
    --violet-soft: rgba(167, 139, 250, .16); --violet-ink: #C4B5FD;
    --grad-side: linear-gradient(185deg, #081A33 0%, #111A4D 45%, #25104F 100%);
    --glow-1: rgba(124, 58, 237, .16);
    --glow-2: rgba(14, 165, 233, .12);
    --chart-text: #9AA6C8;
    --chart-grid: rgba(255, 255, 255, .07);
    --chart-label: #DDE3F3;
    --chart-a: #22D3EE;
    --chart-b: #818CF8;
    --chart-soft-a: #2A3566;
    --chart-soft-b: #46549A;
    --chart-teal-a: #2DD4BF;
    --chart-teal-b: #0F9C8C;
    --chart-plan: #6B7899;
    --chart-proj: #FB923C;
    --chart-real: #8B93FF;
    --chart-today: #FB7185;
    --chart-tip: #020617;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -18px rgba(0, 0, 0, .7);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B96B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0F1E;
  --surface: #111831;
  --surface-2: #161E3B;
  --surface-3: #1C2548;
  --line: #232D52;
  --line-soft: #1B2446;
  --line-strong: #33406E;
  --text: #E7EBF7;
  --text-2: #B3BCD8;
  --muted: #8B96B8;
  --brand: #8B93FF;
  --brand-ink: #C7CBFF;
  --brand-soft: rgba(139, 147, 255, .14);
  --brand-line: rgba(139, 147, 255, .38);
  --ring: rgba(139, 147, 255, .28);
  --row-hover: rgba(139, 147, 255, .07);
  --good: #34D399; --good-soft: rgba(52, 211, 153, .14); --good-ink: #6EE7B7;
  --warn: #FBBF24; --warn-soft: rgba(251, 191, 36, .14); --warn-ink: #FCD34D;
  --bad: #F87171;  --bad-soft: rgba(248, 113, 113, .15); --bad-ink: #FCA5A5;
  --info-soft: rgba(56, 189, 248, .14); --info-ink: #7DD3FC;
  --violet-soft: rgba(167, 139, 250, .16); --violet-ink: #C4B5FD;
  --grad-side: linear-gradient(185deg, #081A33 0%, #111A4D 45%, #25104F 100%);
  --glow-1: rgba(124, 58, 237, .16);
  --glow-2: rgba(14, 165, 233, .12);
  --chart-text: #9AA6C8;
  --chart-grid: rgba(255, 255, 255, .07);
  --chart-label: #DDE3F3;
  --chart-a: #22D3EE;
  --chart-b: #818CF8;
  --chart-soft-a: #2A3566;
  --chart-soft-b: #46549A;
  --chart-teal-a: #2DD4BF;
  --chart-teal-b: #0F9C8C;
  --chart-plan: #6B7899;
  --chart-proj: #FB923C;
  --chart-real: #8B93FF;
  --chart-today: #FB7185;
  --chart-tip: #020617;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -18px rgba(0, 0, 0, .7);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B96B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 560px at 105% -8%, var(--glow-1), transparent 62%),
    radial-gradient(900px 520px at 12% -12%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
code { font: .9em Consolas, "Cascadia Mono", monospace; background: var(--surface-3); border-radius: 6px; padding: 1px 6px; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-soft); }

.ico {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Carregando ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: var(--bg); color: var(--text-2);
}
.boot p { margin: 0; font-size: 13px; }
.boot-logo {
  padding: 14px 18px; border-radius: 18px; background: #fff;
  box-shadow: 0 16px 36px -14px rgba(30, 27, 110, .45); animation: pulse 1.6s ease-in-out infinite;
}
.boot-logo img { display: block; width: 150px; height: auto; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.main-col { min-width: 0; display: flex; flex-direction: column; }

/* ---------- Menu lateral ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 30;
  display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px; overflow-y: auto;
  background: var(--grad-side); color: #fff;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(300px 220px at 0% 0%, rgba(56, 189, 248, .22), transparent 70%),
    radial-gradient(320px 260px at 100% 100%, rgba(217, 70, 239, .20), transparent 70%);
}
.sidebar > * { position: relative; }
.brand { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 0 4px; }
.brand .brand-text { padding: 0 4px; }
/* O logo tem fundo branco: fica num cartão branco para combinar com o menu em degradê */
.logo-card {
  display: grid; place-items: center; padding: 10px 14px; border-radius: 14px; background: #fff;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.logo-card img { display: block; width: 100%; max-width: 190px; height: auto; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #38BDF8 0%, #6366F1 55%, #D946EF 100%);
  color: #fff; font: 700 14px/1 var(--font-num); letter-spacing: .05em;
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font: 650 16px var(--font-display); }
.brand-text small { color: rgba(255, 255, 255, .62); font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button, .nav-util {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left;
  font: 500 14px var(--font); color: rgba(255, 255, 255, .72);
  transition: background .15s, color .15s;
}
.nav button:hover, .nav-util:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav button.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(90deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px -10px rgba(0, 0, 0, .5);
}
.nav button.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #38BDF8, #D946EF);
}
.nav button.active .ico { color: #7DD3FC; }
.nav .ico, .nav-util .ico { width: 20px; height: 20px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.data-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center;
  padding: 12px; border-radius: 14px; font-size: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .10);
}
.data-card .ico { grid-row: span 2; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #BAE6FD; }
.data-card strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-card small { color: rgba(255, 255, 255, .6); }
/* Troca de painel (Suprimentos ⇄ SMS) */
.bi-switch { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .10); }
.bi-switch small { padding: 0 12px; color: rgba(255, 255, 255, .5); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.bi-switch a { text-decoration: none; }
.scrim { display: none; }

/* ---------- Cabeçalho ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.page-title { min-width: 0; flex: 1; }
.page-title h1 { font-size: 22px; line-height: 1.2; }
.page-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad-brand); color: #fff; font: 700 12px/1 var(--font-num); letter-spacing: .03em;
}
.user-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.user-text small { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.icon-btn.menu-btn { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: 600 13.5px var(--font); white-space: nowrap; user-select: none; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s, filter .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--brand-line); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; }
.btn-primary {
  border: 0; color: #fff; background: var(--grad-brand); background-size: 140% 100%;
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .65), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:hover { background: var(--grad-brand); background-size: 140% 100%; background-position: 100% 0; filter: brightness(1.06); box-shadow: 0 10px 22px -8px rgba(79, 70, 229, .75); }
.btn-soft { border-color: transparent; background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn-ghost.danger { color: var(--bad); }
.btn-ghost.danger:hover { background: var(--bad-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { height: 46px; font-size: 15px; border-radius: 13px; }
.btn-icon { width: 30px; height: 30px; padding: 0; border-radius: 8px; }
.btn-icon .ico { width: 15px; height: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm);
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.link { color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

/* ---------- Campos ---------- */
select, input[type="search"], input[type="text"], input[type="password"], input[type="number"] {
  height: 38px; width: 100%; min-width: 0; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--text);
  font: 14px var(--font); transition: border-color .15s, box-shadow .15s, background .15s;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--chevron) no-repeat right 10px center / 16px, var(--surface-2);
  text-overflow: ellipsis;
}
select:hover, input:hover { border-color: var(--line-strong); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background-color: var(--surface); }
select:disabled, input:disabled { opacity: .6; cursor: not-allowed; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--brand); }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form-row .muted { font-weight: 400; }
.form-row.inline { flex-direction: row; gap: 6px; align-items: center; }
.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 46px; }
.input-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px;
  background: none; color: var(--muted); cursor: pointer;
}
.input-btn:hover, .input-btn[aria-pressed="true"] { color: var(--brand); background: var(--brand-soft); }
.field-error { color: var(--bad); font-size: 12.5px; font-weight: 500; margin: 4px 0; }

/* ---------- Filtros ---------- */
.filterbar {
  width: calc(min(100%, 1680px) - 56px); margin: 18px auto 0;
  padding: 14px 18px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.filter-head { display: flex; align-items: center; gap: 12px; }
.filter-title {
  display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none;
  color: var(--text); font: inherit; cursor: default;
}
.filter-title strong { font: 650 14.5px var(--font-display); }
.filter-icon {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad-brand); color: #fff;
}
.filter-icon .ico { width: 15px; height: 15px; }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--grad-brand); color: #fff; font: 700 11.5px/1 var(--font-num);
}
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.filters { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.filters label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.filters select.on { border-color: var(--brand-line); background-color: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

/* ---------- Conteúdo ---------- */
main { width: min(100%, 1680px); margin: 0 auto; padding: 18px 28px 56px; }
.page { display: flex; flex-direction: column; gap: 18px; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-marcos { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); align-items: start; }
.span-2 { grid-column: span 2; }

.panel {
  min-width: 0; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.panel.flush { padding: 0; overflow: hidden; }
.panel-accent {
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-brand) border-box;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { display: flex; align-items: center; gap: 10px; font-size: 15.5px; }
.panel-head small { color: var(--muted); font-size: 12px; text-align: right; }
.head-icon {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
}
.head-icon .ico { width: 16px; height: 16px; }
.head-icon.grad { background: var(--grad-brand); color: #fff; }
.panel-alert.bad .head-icon { background: var(--bad-soft); color: var(--bad); }
.panel-alert.warn .head-icon { background: var(--warn-soft); color: var(--warn); }
.hint { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-2); font-size: 13px; }
.hint .ico { color: var(--brand); width: 16px; height: 16px; }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.card-toolbar { padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.toolbar label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.toolbar label .ico { color: var(--brand); }
.toolbar select { width: auto; max-width: 240px; }
.search { position: relative; flex: 1; max-width: 560px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; }

.chart-box { position: relative; width: 100%; }
.chart-box.sm { height: 220px; }
.chart-box.md { height: 290px; }
.chart-box.lg { height: 370px; }
.chart-box.xl { height: 410px; }

/* ---------- Estado vazio ---------- */
.empty { display: grid; place-items: center; min-height: calc(100vh - 200px); }
.empty-card { width: min(660px, 100%); }
.drop {
  padding: 56px 36px; border-radius: 24px; text-align: center; color: var(--text-2);
  border: 2px dashed var(--brand-line);
  background: radial-gradient(500px 220px at 50% 0%, var(--brand-soft), transparent 70%), var(--surface);
  box-shadow: var(--shadow); transition: border-color .15s, background .15s, transform .15s;
}
.drop-icon {
  display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 22px;
  background: var(--grad-brand); color: #fff; box-shadow: 0 16px 32px -12px rgba(79, 70, 229, .6);
}
.drop-icon .ico { width: 32px; height: 32px; }
.drop h2 { font-size: 21px; color: var(--text); margin: 18px 0 8px; }
.drop p { margin: 6px auto; max-width: 480px; }
.drop.over { border-color: var(--brand); background-color: var(--brand-soft); transform: scale(1.01); }
.error { color: var(--bad-ink); background: var(--bad-soft); border-radius: 12px; padding: 12px 16px; margin-top: 14px; }

/* ---------- Destaque da Visão geral ---------- */
.hero {
  width: calc(min(100%, 1680px) - 56px); margin: 18px auto 0;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 28px;
  padding: 24px 28px; border-radius: 22px; color: #fff;
  background: var(--grad-hero); box-shadow: var(--shadow-lg);
}
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
}
.hero::before { width: 380px; height: 380px; right: -90px; top: -200px; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); }
.hero::after { width: 300px; height: 300px; left: 30%; bottom: -220px; background: radial-gradient(circle, rgba(56, 189, 248, .35), transparent 65%); }
.hero-text { min-width: 0; flex: 1 1 320px; }
.hero-text small { display: block; font-size: 12.5px; opacity: .8; }
.hero-text h2 { font-size: 26px; margin: 2px 0 6px; }
.hero-text p { margin: 0; opacity: .88; font-size: 13.5px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stat {
  min-width: 160px; padding: 12px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-stat span { display: block; font-size: 12px; opacity: .85; }
.hero-stat strong { display: block; font: 700 25px/1.2 var(--font-num); }
.meter { height: 6px; margin-top: 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #A5F3FC, #fff); }

/* ---------- Cards de KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.kpi {
  --k-grad: var(--grad-brand); --k-glow: rgba(99, 102, 241, .10);
  position: relative; overflow: hidden; min-height: 128px; padding: 18px 18px 14px;
  display: flex; flex-direction: column; gap: 6px; border-radius: var(--radius);
  background: radial-gradient(220px 120px at 100% 0%, var(--k-glow), transparent 70%), var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--k-grad); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-line); }
.kpi.bom { --k-grad: var(--grad-good); --k-glow: rgba(16, 185, 129, .13); }
.kpi.atencao { --k-grad: var(--grad-warn); --k-glow: rgba(245, 158, 11, .15); }
.kpi.critico { --k-grad: var(--grad-bad); --k-glow: rgba(239, 68, 68, .14); }
.kpi-name { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.kpi-info { color: var(--muted); display: inline-flex; cursor: help; }
.kpi-info .ico { width: 15px; height: 15px; }
.kpi-value { font: 700 30px/1.1 var(--font-num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.critico .kpi-value { color: var(--bad); }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.kpi-sub { font-size: 11.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 28px;
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
}

.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mini {
  position: relative; overflow: hidden; padding: 10px 14px 10px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.mini::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad-brand); }
.mini.bad::before { background: var(--grad-bad); }
.mini.good::before { background: var(--grad-good); }
.mini span { display: block; font-size: 11.5px; color: var(--muted); }
.mini strong { font: 700 21px/1.25 var(--font-num); font-variant-numeric: tabular-nums; }
.mini.bad strong { color: var(--bad); }
.mini.good strong { color: var(--good); }
.mini-kpis.compacto { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mini-kpis.compacto .mini { padding: 8px 10px 8px 13px; }
.mini-kpis.compacto .mini strong { font-size: 16px; }
.filtro-etapa { margin: -6px 0 12px; font-size: 12px; }
/* Cards do rundown que abrem os itens no Detalhamento */
.mini-link { font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.mini-link:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.mini-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mini-link small { display: block; margin-top: 1px; font-size: 11px; font-weight: 600; color: var(--brand); }
/* Faixa do Detalhamento com os itens de um card: origem, partes (ex.: atrasados × adiantados) e a conta */
.recorte { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 7px 7px 7px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12.5px; }
.recorte[hidden] { display: none; }
.recorte > .ico { width: 15px; height: 15px; flex-shrink: 0; color: var(--brand); }
.recorte strong { font-weight: 700; }
.recorte-partes { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface); }
.recorte-parte { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 3px 10px; background: transparent; color: var(--text-2); font: 600 12px var(--font); cursor: pointer; }
.recorte-parte b { font-variant-numeric: tabular-nums; color: var(--muted); }
.recorte-parte:hover { color: var(--brand); }
.recorte-parte[aria-pressed="true"] { background: var(--brand); color: var(--surface); }
.recorte-parte[aria-pressed="true"] b { color: inherit; }
.recorte-acoes { display: inline-flex; gap: 6px; margin-left: auto; }
.recorte-acoes button { display: inline-flex; align-items: center; border: 0; border-radius: 999px; padding: 3px 9px; background: var(--surface); color: var(--brand); font: 600 12px var(--font); cursor: pointer; }
.recorte-acoes button:hover { background: var(--brand); color: var(--surface); }
.recorte-acoes .ico { width: 15px; height: 15px; }
.recorte button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.recorte-nota { flex-basis: 100%; margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--text-2); }

/* ---------- Blocos da Visão geral e cards de indicador (Tiles, usados por todos os painéis) ---------- */
.ov-block { display: flex; flex-direction: column; gap: 14px; }
.ov-block > .panel-head { margin-bottom: 0; }
.ktiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.ktile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; min-height: 112px;
  padding: 12px 14px 12px 17px; border-radius: 13px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-soft);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ktile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad-brand); }
.ktile.bom::before { background: var(--grad-good); }
.ktile.atencao::before { background: var(--grad-warn); }
.ktile.critico::before { background: var(--grad-bad); }
.ktile:hover { border-color: var(--brand-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.ktile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ktile-name { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text-2); }
.ktile .pill { flex-shrink: 0; font-size: 10.5px; padding: 1px 8px; }
.ktile-value { font: 700 25px/1.15 var(--font-num); letter-spacing: -.015em; color: var(--text); }
.ktile.critico .ktile-value { color: var(--bad); }
.ktile-sub { margin-top: auto; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
/* Card que abre os itens no Detalhamento (Tiles.tile com acao) */
.ktile-link { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ktile-link:hover { border-color: var(--brand); }
.ktile-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ktile-acao { margin-top: auto; font-size: 11px; font-weight: 600; line-height: 1.3; color: var(--brand); }
.ktile-sub + .ktile-acao { margin-top: 0; }
.kmeter { position: relative; height: 6px; margin: 2px 0; border-radius: 999px; background: var(--surface-3); }
.kmeter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--chart-a), var(--chart-b)); }
.kmeter b { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--text-2); }
.ktile.bom .kmeter i { background: var(--grad-good); }
.ktile.critico .kmeter i { background: var(--grad-bad); }
.ov-block .chart-box { margin-top: 2px; }
.ov-empty { padding: 18px; text-align: center; color: var(--muted); border: 2px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------- Paleta das séries (gráficos com várias séries: charts-series.js) ----------
   Ordem fixa, validada para daltonismo e contraste nas superfícies dos dois temas. */
:root {
  --serie-1: #2a78d6; --serie-2: #eb6834; --serie-3: #1baf7a; --serie-4: #eda100;
  --serie-5: #e87ba4; --serie-6: #008300; --serie-7: #4a3aa7; --serie-8: #e34948;
  --serie-outros: #94A3B8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --serie-1: #3987e5; --serie-2: #d95926; --serie-3: #199e70; --serie-4: #c98500;
    --serie-5: #d55181; --serie-6: #008300; --serie-7: #9085e9; --serie-8: #e66767;
    --serie-outros: #6B7899;
  }
}
:root[data-theme="dark"] {
  --serie-1: #3987e5; --serie-2: #d95926; --serie-3: #199e70; --serie-4: #c98500;
  --serie-5: #d55181; --serie-6: #008300; --serie-7: #9085e9; --serie-8: #e66767;
  --serie-outros: #6B7899;
}

/* ---------- Componentes dos BIs de SMS e Qualidade ---------- */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-title {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 -4px;
  font: 650 12px var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
/* Verificações da planilha */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
}
.checks .head-icon { grid-row: span 2; }
.checks li.atencao .head-icon { background: var(--warn-soft); color: var(--warn); }
.checks li.info .head-icon { background: var(--info-soft); color: var(--info-ink); }
.checks strong { font-size: 13.5px; font-weight: 650; }
.checks p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.checks .area { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.checks-ok { display: flex; align-items: center; gap: 10px; color: var(--good-ink); background: var(--good-soft); border-radius: 12px; padding: 12px 14px; }
/* Tabelas de índices, medidas e dados */
.trend { font-weight: 600; white-space: nowrap; }
.trend.up { color: var(--good-ink); }
.trend.down { color: var(--bad-ink); }
.trend.neutro { color: var(--text-2); }
tr.grupo td { background: var(--surface-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.vazio { color: var(--muted); }
.formula { font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; color: var(--text-2); }

/* ---------- Farol ---------- */
.farol-track { display: flex; gap: 3px; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.farol-seg {
  min-width: 3px; cursor: pointer; transition: filter .15s, transform .15s;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 62%, #fff), var(--c));
}
.farol-seg:hover { filter: brightness(1.08) saturate(1.1); }
.farol-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
/* Card do farol: o card filtra o painel; "Ver itens" abre os itens no Detalhamento */
.farol-item {
  display: flex; position: relative; border-radius: 13px; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 10%, transparent), transparent 70%), var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.farol-filtro {
  display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0;
  padding: 10px 12px; border: 0; border-radius: inherit; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.farol-filtro:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.farol-ver {
  position: absolute; right: 6px; bottom: 7px; border: 0; border-radius: 999px; padding: 2px 8px;
  background: transparent; color: var(--brand); font: 600 11px var(--font); cursor: pointer;
}
.farol-ver:hover { background: var(--brand-soft); }
.farol-ver:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.farol-item:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); transform: translateY(-1px); }
.farol-item.sel { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.farol-item .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.farol-item span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.farol-item strong { display: block; margin-top: 2px; font: 700 22px/1.2 var(--font-num); }
.farol-item small { color: var(--muted); font-weight: 600; }

/* ---------- Marco ---------- */
.milestone-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.milestone-date {
  font: 700 34px/1.1 var(--font-num); letter-spacing: -.02em;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.milestone-desc { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.pill:empty { display: none; }
.pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill.info { background: var(--brand-soft); color: var(--brand-ink); }
.pill.good { background: var(--good-soft); color: var(--good-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--text-2); background: var(--surface-2); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow: auto; max-height: 440px; border-radius: 12px; }
.table-wrap.tall { max-height: calc(100vh - 300px); border-radius: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th {
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2);
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--brand); }
th.sorted { color: var(--brand); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
td.wide { min-width: 280px; }
td.neg { color: var(--bad); font-weight: 600; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
.farol-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--c); }
.farol-badge {
  display: inline-flex; align-items: center; padding: 2px 10px 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text);
  background: color-mix(in srgb, var(--c) 15%, transparent);
}
.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-cell .bar { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--chart-a), var(--chart-b)); }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; }
.empty-row { color: var(--muted); text-align: center; padding: 28px; }

/* ---------- Listas compactas (Marcos e alertas, Detalhamento) ---------- */
table.compacta td { vertical-align: middle; }
table.compacta td.wide { min-width: 220px; max-width: 380px; }
table.compacta .farol-badge { font-size: 11.5px; }
table.compacta .item-cell strong { word-break: break-word; }
.table-wrap.lista { max-height: none; }
.item-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.item-cell strong { font-weight: 600; color: var(--text); line-height: 1.35; }
.item-cell small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.datas-cell { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.datas-cell i { font-style: normal; color: var(--muted); }
.datas-cell span:last-child { font-weight: 600; }
.folga-badge {
  display: inline-flex; justify-content: center; min-width: 66px; padding: 3px 10px; border-radius: 999px;
  font: 700 12.5px/1.4 var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.folga-badge.bad { background: var(--bad-soft); color: var(--bad-ink); }
.folga-badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.folga-badge.ok { background: var(--good-soft); color: var(--good-ink); }
.lista-toolbar { margin: 4px 0 12px; }
.mais { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 2px; }

/* Ações registradas, agrupadas (o texto aparece uma vez) */
.acoes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.acao {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; text-align: left;
  border-radius: 12px; border: 1px solid var(--line); border-left: 3px solid var(--bad);
  background: var(--surface-2); color: inherit; font: inherit;
}
button.acao { cursor: pointer; transition: border-color .15s, background .15s; }
button.acao:hover { border-color: var(--brand-line); }
button.acao.on { background: var(--brand-soft); border-color: var(--brand-line); border-left-color: var(--brand); }
.acao-n { display: flex; flex-direction: column; align-items: center; min-width: 62px; font: 700 22px/1.1 var(--font-num); color: var(--bad); }
.acao-n small { font: 600 10.5px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.acao-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acao-txt strong { font-weight: 600; line-height: 1.4; }
.acao-txt small { font-size: 12px; color: var(--muted); }

/* Linha do tempo dos marcos contratuais */
.marcos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.marco {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 18px; padding: 14px 16px;
  border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2);
}
.marco.proximo { border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad-brand) border-box; }
.marco-data { display: flex; flex-direction: column; gap: 6px; }
.marco-data strong { font: 700 22px/1.1 var(--font-num); letter-spacing: -.01em; }
.marco.proximo .marco-data strong { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marco-tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); background: var(--brand-soft); border-radius: 6px; padding: 2px 7px; }
.marco-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.marco-nome { font-weight: 600; line-height: 1.4; }
.marco .chips { margin-top: 8px; }

/* Detalhamento: linhas que abrem os demais campos */
table.detalhe tr.linha { cursor: pointer; }
table.detalhe tr.linha:focus-visible td { outline: none; background: var(--row-hover); }
table.detalhe tr.linha:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
table.detalhe tr.aberta td { background: var(--brand-soft); border-bottom-color: transparent; }
.linha-item { display: flex; align-items: flex-start; gap: 8px; }
.linha-item .chev { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); transition: transform .15s; }
tr.aberta .linha-item .chev { transform: rotate(180deg); color: var(--brand); }
tr.detalhe-linha td { background: var(--brand-soft); padding: 4px 16px 18px 40px; }
tr.detalhe-linha:hover td { background: var(--brand-soft); }
.det-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 22px; margin: 0; }
.det-grid .largo { grid-column: span 2; }
.det-grid dt { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.det-grid dd { margin: 2px 0 0; font-size: 13px; color: var(--text); word-break: break-word; }
.dt-dica { display: inline-flex; align-items: center; gap: 6px; }
.dt-dica .ico { width: 15px; height: 15px; color: var(--brand); }

/* ---------- Configuração de KPIs ---------- */
.kpi-config { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.kc-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kc-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; }
.kc-group { margin-bottom: 22px; }
.kc-group h3 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font: 650 12px var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.kc-group h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.kc-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start;
  padding: 14px 16px; margin-bottom: 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s;
}
.kc-item.on { border-color: var(--brand-line); background: linear-gradient(120deg, var(--brand-soft), transparent 55%), var(--surface); }
/* Interruptor (checkbox nativo com aparência de switch) */
.kc-item > input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 1px 0 0; width: 40px; height: 24px; border-radius: 999px; cursor: pointer;
  background: radial-gradient(circle at 12px 50%, #fff 8px, transparent 8.5px), var(--line-strong);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); transition: filter .15s;
}
.kc-item > input[type="checkbox"]:checked { background: radial-gradient(circle at 28px 50%, #fff 8px, transparent 8.5px), var(--grad-brand); }
.kc-item > input[type="checkbox"]:hover:not(:disabled) { filter: brightness(1.05); }
.kc-item > input[type="checkbox"]:disabled { opacity: .55; cursor: not-allowed; }
.kc-title { font-weight: 650; }
.kc-desc { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.kc-origin { font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 2px 7px; margin-left: 8px; vertical-align: 1px; letter-spacing: .02em; }
.kc-origin.pbi { background: var(--warn-soft); color: var(--warn-ink); }
.kc-origin.novo { background: var(--good-soft); color: var(--good-ink); }
.kc-origin.custom { background: var(--violet-soft); color: var(--violet-ink); }
.kc-value { font: 700 20px/1.2 var(--font-num); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kc-item.on .kc-value { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kc-methods { grid-column: 2 / 4; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.kc-method { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; font-size: 13px; padding: 6px 10px; border-radius: 9px; cursor: pointer; }
.kc-method:hover { background: var(--surface-2); }
.kc-method:has(input:checked) { background: var(--brand-soft); }
.kc-method .formula { display: block; font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; color: var(--muted); }
.kc-method .mv { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.kc-actions { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kc-json { grid-column: 1 / 4; margin: 8px 0 0; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.order-list li {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; font-size: 13px;
  border: 1px solid var(--line-soft); border-radius: 11px; background: var(--surface-2);
}
.order-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-list .ord {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  background: var(--grad-brand); color: #fff; font: 700 11px/1 var(--font-num);
}
.order-list .btn-icon { border-color: transparent; background: transparent; color: var(--muted); }
.order-list .btn-icon:hover:not(:disabled) { background: var(--surface); color: var(--brand); border-color: var(--line); }
.preview { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.preview code { background: none; padding: 0; }
.kc-json {
  background: #0B1224; color: #D6E4F0; border: 1px solid #1E2A4A; border-radius: 12px;
  padding: 12px 14px; font-size: 11.5px; overflow: auto; max-height: 320px;
}

/* ---------- Aviso flutuante ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 14px; font-size: 13.5px; color: #fff;
  background: linear-gradient(135deg, #111A3A, #1E1B4B); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .55); animation: toast-in .25s ease;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, #38BDF8, #D946EF); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- Exportação em PDF (pdf-export.js) ---------- */
/* Janela: telas do menu (todas marcadas) e fundo do PDF */
.pdf-dialogo {
  width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.pdf-dialogo::backdrop { background: rgba(8, 12, 28, .55); backdrop-filter: blur(3px); }
.pdf-dialogo form { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px 20px; }
.pdf-dlg-head { display: flex; align-items: center; gap: 12px; }
.pdf-dlg-head > div { flex: 1; min-width: 0; }
.pdf-dlg-head h2 { font-size: 18px; }
.pdf-dlg-head p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.pdf-dlg-head .head-icon { width: 38px; height: 38px; border-radius: 11px; }
.pdf-dlg-head .head-icon .ico { width: 19px; height: 19px; }
.pdf-dlg-head .icon-btn { width: 34px; height: 34px; box-shadow: none; }
.pdf-grupo { display: flex; flex-direction: column; gap: 10px; }
.pdf-grupo-head { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.pdf-grupo-head h3 { font: 650 12px var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.pdf-grupo-head small { font-size: 12px; color: var(--muted); }
.pdf-grupo-head .btn { margin-left: auto; }
.pdf-telas, .pdf-temas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pdf-tela, .pdf-tema {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); transition: border-color .15s, background .15s, box-shadow .15s;
}
.pdf-tela { padding-right: 38px; }
.pdf-tela input, .pdf-tema input { position: absolute; opacity: 0; pointer-events: none; }
.pdf-tela:hover, .pdf-tema:hover { border-color: var(--brand-line); }
.pdf-tela:has(input:focus-visible), .pdf-tema:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.pdf-opcao-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pdf-opcao-txt strong { font-size: 13.5px; font-weight: 600; }
.pdf-opcao-txt small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-marca {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; padding: 2px;
  border-radius: 6px; border: 1.5px solid var(--line-strong); color: transparent; stroke-width: 2.6;
}
.pdf-tela:has(input:checked) { border-color: var(--brand-line); background: var(--brand-soft); }
.pdf-tela:has(input:checked) .pdf-marca { border-color: transparent; background: var(--grad-brand); color: #fff; }
.pdf-tela:not(:has(input:checked)) .head-icon { background: var(--surface-3); color: var(--muted); }
.pdf-tema:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--ring); }
/* Miniatura do fundo: cores fixas de cada tema, iguais com o painel em qualquer tema */
.pdf-amostra {
  flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 9px 1fr; gap: 3px;
  width: 56px; height: 42px; padding: 5px; border-radius: 8px; border: 1px solid rgba(100, 116, 139, .35);
}
.pdf-amostra i { border-radius: 3px; }
.pdf-amostra i:first-child { grid-column: span 2; background: linear-gradient(120deg, #0B6FAE, #3B3FD8 48%, #7C3AED); }
.pdf-tema.light .pdf-amostra { background: #F3F5FB; }
.pdf-tema.light .pdf-amostra i + i { background: #FFFFFF; box-shadow: 0 0 0 1px #E4E8F1; }
.pdf-tema.dark .pdf-amostra { background: #0A0F1E; }
.pdf-tema.dark .pdf-amostra i + i { background: #111831; box-shadow: 0 0 0 1px #232D52; }
.pdf-dialogo .hint { align-items: flex-start; font-size: 12.5px; }
.pdf-dialogo .hint .ico { margin-top: 1px; }
.pdf-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* Aviso enquanto o PDF é gerado: cobre o painel, que troca de tela e de tema por baixo (cores fixas) */
.pdf-progresso { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: #0A0F1E; color: #E7EBF7; }
.pdf-progresso-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(400px, 100%); padding: 28px 28px 22px;
  border-radius: 20px; text-align: center; background: #111831; border: 1px solid #232D52; box-shadow: 0 24px 48px -18px rgba(0, 0, 0, .7);
}
.pdf-progresso-card strong { font: 650 17px var(--font-display); }
.pdf-progresso-card .pdf-etapa { min-height: 20px; font-size: 13px; color: #B3BCD8; }
.pdf-progresso .spinner { border-color: #232D52; border-top-color: #8B93FF; }
.pdf-progresso .meter { width: 100%; background: rgba(255, 255, 255, .12); }
.pdf-progresso .meter i { width: 0; background: linear-gradient(90deg, #38BDF8, #8B93FF); transition: width .2s; }
.pdf-progresso .btn { margin-top: 6px; background: transparent; color: #C7CBFF; border-color: #33406E; }
.pdf-progresso .btn:hover { background: rgba(139, 147, 255, .14); }

/* Carga da planilha (carga.js): janela com a barra de 0% a 100%, as etapas e o resumo no fim */
.carga-dlg {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.carga-dlg::backdrop { background: rgba(8, 12, 28, .55); backdrop-filter: blur(3px); }
.carga-corpo { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px 20px; }
.carga-head { display: flex; align-items: center; gap: 12px; }
.carga-head > div { flex: 1; min-width: 0; }
.carga-head h2 { font-size: 18px; }
.carga-head p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carga-head .head-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; }
.carga-head .head-icon .ico { width: 19px; height: 19px; }
.carga-dlg.ok .carga-head .head-icon { background: var(--good); }
.carga-dlg.erro .carga-head .head-icon { background: var(--bad); }
.carga-progresso { display: flex; align-items: center; gap: 14px; }
.carga-barra { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.carga-barra i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--grad-brand); transition: width .2s; }
.carga-dlg.ok .carga-barra i { background: var(--good); }
.carga-dlg.erro .carga-barra i { background: var(--bad); }
.carga-pct { min-width: 4.2ch; text-align: right; font: 700 22px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.carga-etapas { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.carga-etapas li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.carga-etapas .marca { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.carga-etapas .marca .ico { width: 12px; height: 12px; stroke-width: 3; visibility: hidden; }
.carga-etapas li.ativa { color: var(--text); font-weight: 600; }
.carga-etapas li.ativa .marca { border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.carga-etapas li.feita { color: var(--text-2); }
.carga-etapas li.feita .marca { border-color: transparent; background: var(--good); color: #fff; }
.carga-etapas li.feita .marca .ico, .carga-etapas li.falhou .marca .ico { visibility: visible; }
.carga-etapas li.falhou { color: var(--bad-ink); font-weight: 600; }
.carga-etapas li.falhou .marca { border-color: transparent; background: var(--bad); color: #fff; }
.carga-resumo { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; }
.carga-resumo small { font-size: 12.5px; opacity: .85; }
.carga-dlg.ok .carga-resumo { background: var(--good-soft); color: var(--good-ink); }
.carga-dlg.erro .carga-resumo { background: var(--bad-soft); color: var(--bad-ink); }
.carga-foot { display: flex; justify-content: flex-end; }
.carga-foot .btn[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .carga-barra i { transition: none; }
  .carga-etapas li.ativa .marca { animation: none; border-color: var(--brand); }
}

/* Cópia das telas (classe no <html>): sem menu, topo e filtros, na largura do PDF, sem animação,
   tabelas inteiras (sem rolagem) e sem os controles que só servem na tela */
.pdf-captura .sidebar, .pdf-captura .scrim, .pdf-captura .topbar, .pdf-captura .filterbar { display: none !important; }
.pdf-captura .shell { display: block; width: var(--pdf-largura); min-height: 0; }
.pdf-captura .main-col { width: var(--pdf-largura); }
.pdf-captura main { padding-bottom: 18px; }
.pdf-captura .shell *, .pdf-captura .shell *::before, .pdf-captura .shell *::after { animation: none !important; transition: none !important; }
.pdf-captura .table-wrap { max-height: none !important; overflow: hidden; }
.pdf-captura .ktile-acao, .pdf-captura .farol-ver, .pdf-captura .mini-link small, .pdf-captura .dt-dica, .pdf-captura .so-tela,
.pdf-captura #dt-csv, .pdf-captura #dd-csv, .pdf-captura #rd-auto, .pdf-captura .recorte-acoes, .pdf-captura .mais .btn,
.pdf-captura .pager .btn, .pdf-captura p.btn-row, .pdf-captura .search:has(input:placeholder-shown) { display: none !important; }
/* Texto que só aparece no PDF (ex.: quantos itens a lista tem além dos mostrados) */
.so-pdf { display: none; }
.pdf-captura .so-pdf { display: inline; }
/* Cabeçalho de cada página do PDF: BI, item do menu a que a tela pertence, filtros e datas */
.pdf-cabecalho { width: var(--pdf-largura); padding: 0 28px; }
.pdf-cab {
  display: flex; align-items: center; gap: 18px; padding: 10px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.pdf-cab .logo-card { width: 112px; flex-shrink: 0; padding: 6px 9px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.pdf-bi { display: flex; flex-direction: column; flex-shrink: 0; line-height: 1.2; padding-right: 18px; border-right: 1px solid var(--line); }
.pdf-bi strong { font: 650 16px var(--font-display); }
.pdf-bi small { font-size: 12px; color: var(--muted); }
.pdf-tela-atual { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.pdf-menu {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 5px; border-radius: 999px;
  background: var(--grad-brand); color: #fff; font: 650 15px var(--font-display); box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .7);
}
.pdf-menu b { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .2); font: 700 10px/1.5 var(--font); text-transform: uppercase; letter-spacing: .08em; }
.pdf-menu .ico { width: 17px; height: 17px; }
.pdf-tela-atual small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 48%; font-size: 11.5px; color: var(--text-2); text-align: right; }
.pdf-meta span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-meta span + span { color: var(--muted); }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 56px; color: #fff; background: var(--grad-hero);
}
.login-brand { display: flex; align-items: center; gap: 16px; }
.login-brand .logo-card { width: 190px; padding: 12px 16px; }
.login-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.login-brand strong { font: 650 17px var(--font-display); }
.login-brand small { opacity: .75; font-size: 12px; }
.login-copy { max-width: 540px; margin-bottom: 8vh; }
.login-copy h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.12; letter-spacing: -.02em; font-weight: 700; }
.login-copy p { margin: 16px 0 26px; font-size: 15.5px; opacity: .88; max-width: 480px; }
.login-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; }
.login-points .ico {
  width: 34px; height: 34px; padding: 8px; border-radius: 11px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
}
.blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); opacity: .55; animation: float 14s ease-in-out infinite; }
.blob.b1 { width: 360px; height: 360px; right: -80px; top: -60px; background: #38BDF8; }
.blob.b2 { width: 300px; height: 300px; left: -60px; bottom: -80px; background: #D946EF; animation-delay: -5s; }
.blob.b3 { width: 220px; height: 220px; right: 20%; bottom: 18%; background: #6366F1; animation-delay: -9s; }
@keyframes float { 50% { transform: translate(24px, -18px) scale(1.06); } }

/* Página inicial da plataforma (Sirius): céu noturno com a constelação do Cão Maior.
   Só no login de "/"; SMS e Qualidade continuam com o hero em gradiente. */
.login-hero--sirius {
  background:
    radial-gradient(ellipse 60% 45% at 74% 28%, rgba(76, 125, 255, .30), transparent 70%),
    radial-gradient(ellipse 55% 50% at 6% 100%, rgba(124, 58, 237, .30), transparent 70%),
    linear-gradient(165deg, #04060F 0%, #0A1130 48%, #1B1550 100%);
}
.login-hero--sirius::before,
.login-hero--sirius::after { content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none; }
/* Campo de estrelas: dois ladrilhos de tamanhos diferentes para a repetição não aparecer */
.login-hero--sirius::before {
  background-image:
    radial-gradient(1px 1px at 18px 32px, rgba(255, 255, 255, .85), transparent),
    radial-gradient(1px 1px at 74px 140px, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1px 1px at 130px 64px, rgba(205, 222, 255, .75), transparent),
    radial-gradient(1px 1px at 186px 196px, rgba(255, 255, 255, .55), transparent),
    radial-gradient(1px 1px at 214px 22px, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1px 1px at 46px 210px, rgba(205, 222, 255, .6), transparent),
    radial-gradient(1px 1px at 160px 118px, rgba(255, 255, 255, .45), transparent),
    radial-gradient(1px 1px at 98px 90px, rgba(255, 255, 255, .5), transparent);
  background-size: 230px 230px;
}
.login-hero--sirius::after {
  background-image:
    radial-gradient(1.5px 1.5px at 60px 80px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 250px 40px, rgba(214, 228, 255, .95), transparent),
    radial-gradient(1.5px 1.5px at 330px 270px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 140px 320px, rgba(214, 228, 255, .9), transparent),
    radial-gradient(1.5px 1.5px at 20px 250px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 210px 180px, rgba(255, 255, 255, .8), transparent);
  background-size: 370px 370px;
  animation: twinkle 5s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .35; } }
.sirius-sky {
  position: absolute; z-index: -1; right: 3%; top: 4%;
  width: min(50%, 460px); height: auto; overflow: visible;
}
.sirius-sky .sky-lines polyline { fill: none; stroke: rgba(186, 210, 255, .26); stroke-width: 1; stroke-dasharray: 3 5; }
.sirius-sky .sky-stars circle { fill: #DCE6FF; opacity: .85; }
.sirius-sky .sirius-halo { transform-origin: 248px 154px; animation: sirius-pulse 6s ease-in-out infinite; }
.sirius-sky .sky-label { fill: rgba(220, 230, 255, .6); font: 500 10.5px var(--font); letter-spacing: .08em; }
@keyframes sirius-pulse { 50% { transform: scale(1.12); opacity: .85; } }
.login-hero--sirius .login-brand strong { font-size: 22px; letter-spacing: .01em; }
@media (max-width: 1200px) and (min-width: 901px) {
  .sirius-sky { top: 14%; width: min(46%, 460px); }
  .sirius-sky .sky-label { display: none; }
}
.login-side { display: grid; place-items: center; padding: 32px; }
.login-card {
  width: min(410px, 100%); padding: 34px 32px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.login-card h2 { font-size: 24px; }
.login-card > p.muted { margin: 4px 0 24px; }
.login-card input { height: 44px; }
.login-card .btn { margin-top: 8px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
  .marco { grid-template-columns: 1fr; }
  .marco-data { flex-direction: row; align-items: center; gap: 10px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .kpi-config { grid-template-columns: 1fr; }
  .kc-side { position: static; max-height: none; }
  .grid-marcos { grid-template-columns: 1fr; }
}
/* Menu vira trilho de ícones */
@media (max-width: 1100px) and (min-width: 901px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 20px 12px; align-items: center; }
  .brand { padding: 0; width: 100%; }
  .brand .logo-card { padding: 6px 4px; border-radius: 10px; }
  .brand-text, .nav button span, .nav-util span, .data-card, .bi-switch small { display: none; }
  .bi-switch { padding-top: 0; border-top: 0; }
  .nav button, .nav-util { justify-content: center; padding: 12px; }
  .nav button.active::before { left: -12px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px; height: auto; z-index: 60;
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  .shell.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 12, 28, .5); backdrop-filter: blur(2px); }
  .icon-btn.menu-btn { display: grid; }
  .topbar { height: 64px; padding: 0 16px; gap: 12px; }
  .page-title h1 { font-size: 18px; }
  .page-title p { display: none; }
  .user-text { display: none; }
  .user-chip { padding: 3px; }
  #upload-btn span, #pdf-btn span, #novo-btn span, #at-salvar span, #at-descartar span { display: none; }
  #upload-btn, #pdf-btn, #novo-btn, #at-salvar, #at-descartar { width: 40px; padding: 0; }
  .pdf-telas, .pdf-temas { grid-template-columns: 1fr; }
  .filterbar { width: auto; margin: 12px 16px 0; padding: 12px 14px; }
  .filter-title { cursor: pointer; }
  .filter-title::after { content: ""; width: 16px; height: 16px; background: var(--chevron) no-repeat center / 16px; transition: transform .2s; }
  .filterbar.open .filter-title::after { transform: rotate(180deg); }
  .filterbar:not(.open) .filters { display: none; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-count { display: none; }
  .filter-head .btn { margin-left: auto; }
  main { padding: 14px 16px 40px; }
  .grid-2, .grid-3, .grid-overview { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .panel { padding: 16px; }
  .panel-head { flex-wrap: wrap; align-items: flex-start; }
  .panel-head small { text-align: left; }
  td.wide { min-width: 220px; }
  /* Listas compactas: no celular ficam só as colunas principais (o resto aparece ao abrir a linha) */
  .col-opt { display: none; }
  .det-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  tr.detalhe-linha td { padding-left: 16px; }
  .marco { grid-template-columns: 1fr; }
  .dt-dica { display: none; }
  .acao-n { min-width: 48px; font-size: 18px; }
  .hero { padding: 20px; width: auto; margin: 12px 16px 0; }
  .hero-text h2 { font-size: 21px; }
  .hero-stat { flex: 1 1 140px; min-width: 0; }
  .farol-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ktiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ktile { min-height: 100px; padding: 10px 10px 10px 14px; }
  .ktile-value { font-size: 20px; }
  .kpi { padding: 14px 12px 12px; min-height: 108px; }
  .kpi-value { font-size: 23px; }
  .toolbar select { max-width: none; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-hero { padding: 28px 24px 36px; gap: 24px; }
  .login-copy { margin: 0; }
  .login-copy p, .login-points { display: none; }
  .login-copy h1 { font-size: 24px; }
  .login-brand .logo-card { width: 150px; }
  .login-side { padding: 24px 16px 40px; align-items: start; }
  .sirius-sky { width: 220px; right: -40px; top: -30px; opacity: .75; }
  .sirius-sky .sky-label { display: none; }
}
@media (max-width: 420px) {
  /* Topo com tema e engrenagem: botões menores para caber no celular */
  .topbar { gap: 8px; }
  .topbar-actions { gap: 6px; }
  .topbar .icon-btn, #upload-btn, #pdf-btn, #novo-btn, #at-salvar, #at-descartar { width: 36px; height: 36px; }
  .filters { grid-template-columns: 1fr; }
  .kpi-value { font-size: 20px; }
}
@media (max-width: 340px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .filterbar, .toolbar, .pager, .toast { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .panel, .kpi, .hero { box-shadow: none; break-inside: avoid; }
}

/* Bolhas agrupadas e mapa de pontos (public/js/bi-graficos.js: BIs de Restrições e SMS) */
.bolhas { width: 100%; height: auto; max-height: 440px; display: block; }
.bolha circle { stroke: var(--surface); stroke-width: 2; }
.bolha.clicavel, .ponto.clicavel { cursor: pointer; }
.bolha-valor { fill: #fff; font: 700 15px var(--font-num); pointer-events: none; }
.bolha-rotulo { fill: #fff; font: 600 10.5px var(--font); pointer-events: none; }
.bolhas-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--text-2); }
.bolhas-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.mapa-pontos { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: 12px; }
.ponto-rotulo { fill: var(--text-2); font: 600 11px var(--font); }

/* Topo: tema e engrenagem das Configurações (só administradores) ao lado do nome */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.config { position: relative; }
.config-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 220px; padding: 8px;
  display: flex; flex-direction: column; gap: 2px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.config-menu[hidden] { display: none; }
.config-menu strong { padding: 6px 10px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.config-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.config-menu a .ico { width: 17px; height: 17px; color: var(--brand); }
.config-menu a:hover, .config-menu a:focus-visible { background: var(--brand-soft); color: var(--brand-ink); outline: none; }
.config-menu a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); }
