/* ============================================================================
   AutoMoodle 2 — Design System v3  ·  Dark BI Dashboard
   Metodologia ui-ux-pro-max: ícones SVG (Lucide), tipografia display,
   glassmorphism refinado, micro-interações 150–300ms, reduced-motion.
   CSS puro, sem dependências (apenas Google Fonts).
   ============================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg-0: #070a14;
  --bg-1: #0a0e1a;
  --surface: rgba(20, 27, 45, 0.66);
  --surface-2: rgba(30, 40, 64, 0.55);
  --surface-solid: #141b2d;
  --line: rgba(125, 145, 196, 0.14);
  --line-2: rgba(125, 145, 196, 0.28);

  --text: #e8edfb;
  --muted: #8b97b8;
  --faint: #5b6788;

  --brand: #6366f1;
  --brand-2: #22d3ee;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #22d3ee);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(34,211,238,0.12));

  --ok: #34d399; --warn: #fbbf24; --err: #fb7185; --info: #60a5fa; --violet: #a855f7;

  /* paleta categórica p/ gráficos */
  --c1: #6366f1; --c2: #22d3ee; --c3: #a855f7; --c4: #34d399; --c5: #fbbf24; --c6: #fb7185; --c7: #60a5fa;

  --r-lg: 18px; --r-md: 13px; --r-sm: 9px;
  --shadow: 0 18px 48px -20px rgba(0,0,0,0.7);
  --glow: 0 0 0 1px rgba(99,102,241,0.35), 0 20px 50px -18px rgba(99,102,241,0.4);
  --t: 0.2s cubic-bezier(0.22, 1, 0.36, 1);

  --sidebar-w: 250px;
}

/* ===========================================================================
   TEMA CLARO  (data-theme="light" no <html>, alternado pelo botão da sidebar)
   Sobrescreve os tokens + os poucos pontos com cor cravada (tabela, inputs,
   progress, sidebar, fundo). O log continua "terminal" escuro (legível).
   =========================================================================== */
:root[data-theme="light"] {
  --bg-0: #e9edf5;
  --bg-1: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(236, 240, 248, 0.9);
  --surface-solid: #ffffff;
  --line: rgba(30, 45, 90, 0.12);
  --line-2: rgba(30, 45, 90, 0.20);

  --text: #172038;
  --muted: #566080;
  --faint: #8590aa;

  --ok: #0f9d58; --warn: #b26a00; --err: #d64545; --info: #2f6df6; --violet: #7c3aed;

  --shadow: 0 14px 36px -20px rgba(30, 45, 90, 0.30);
  --glow: 0 0 0 1px rgba(99,102,241,0.22), 0 16px 40px -18px rgba(99,102,241,0.22);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 760px at 82% -10%, rgba(139,92,246,0.10), transparent 58%),
    radial-gradient(1000px 680px at -8% 8%, rgba(34,211,238,0.08), transparent 54%),
    linear-gradient(180deg, #f6f8fc, #e9edf5);
  background-attachment: fixed;
}
:root[data-theme="light"] body::before { opacity: 0.7; }
:root[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(240,244,250,0.94));
}
:root[data-theme="light"] .nav-link.ativo { color: var(--brand); }
:root[data-theme="light"] thead th { background: rgba(236, 240, 248, 0.88); }
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea { background: rgba(255, 255, 255, 0.9); }
:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus { background: #fff; }
:root[data-theme="light"] .progress { background: rgba(30, 45, 90, 0.10); }
:root[data-theme="light"] pre.log { color: #dbe4f5; }  /* mantém terminal escuro legível */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px; color: var(--text); min-height: 100vh; display: flex;
  background:
    radial-gradient(1200px 760px at 82% -10%, rgba(139,92,246,0.16), transparent 58%),
    radial-gradient(1000px 680px at -8% 8%, rgba(34,211,238,0.10), transparent 54%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
}
body::before { /* grade sutil */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.5; z-index: 0;
  background-image: linear-gradient(rgba(125,145,196,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,145,196,0.035) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 50% 0%, #000, transparent 75%);
}

h1, h2, h3, .num, .valor, .ring-val, .kpi-num { font-family: "Space Grotesk", "Inter", sans-serif; }

::selection { background: rgba(99,102,241,0.4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(125,145,196,0.22); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: rgba(125,145,196,0.42); }
::-webkit-scrollbar-track { background: transparent; }

/* ícones SVG inline */
.icn { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }

/* ===========================================================================
   SIDEBAR
   =========================================================================== */
.sidebar {
  width: var(--sidebar-w); position: fixed; inset: 0 auto 0 0; z-index: 40;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 3px;
  background: linear-gradient(180deg, rgba(16,22,40,0.95), rgba(8,12,24,0.95));
  border-right: 1px solid var(--line); backdrop-filter: blur(16px);
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 22px; }
.sidebar .brand .logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad); color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(99,102,241,0.8);
}
.sidebar .brand .logo .icn { width: 21px; height: 21px; stroke-width: 2.2; }
.sidebar .brand .title { font-family: "Space Grotesk"; font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.sidebar .brand .title small { display: block; font-family: "Inter"; font-weight: 500; font-size: 10px; color: var(--faint); letter-spacing: 2px; margin-top: 1px; }

.nav-sec { font-size: 10px; letter-spacing: 1.6px; color: var(--faint); font-weight: 600; padding: 14px 14px 6px; text-transform: uppercase; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border-radius: var(--r-md); color: var(--muted);
  text-decoration: none; font-weight: 500; cursor: pointer; transition: color var(--t), background var(--t), transform var(--t);
}
button.nav-link { background: transparent; border: none; font: inherit; width: 100%; text-align: left; }
.nav-link .icn { width: 18px; height: 18px; transition: transform var(--t); }
.nav-link:hover { color: var(--text); background: var(--surface-2); transform: translateX(2px); }
.nav-link:hover .icn { transform: scale(1.12); }
.nav-link.ativo { color: #fff; background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(99,102,241,0.32); }
.nav-link.ativo .icn { color: var(--brand-2); }
.nav-link .nav-num { width: 19px; height: 19px; flex: none; border-radius: 6px; background: rgba(125,145,196,0.14);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--faint);
  font-family: "Space Grotesk", sans-serif; transition: color var(--t), background var(--t); }
.nav-link:hover .nav-num, .nav-link.ativo .nav-num { color: var(--brand-2); background: rgba(99,102,241,0.18); }
.nav-link.ativo::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 60%; border-radius: 0 4px 4px 0; background: var(--grad); }
.nav-link .badge-pend { margin-left: auto; min-width: 20px; text-align: center; background: var(--err);
  color: #fff; border-radius: 20px; font-size: 11px; font-weight: 700; padding: 1px 7px; animation: pulse 2.4s infinite; }
.sidebar .rodape { margin-top: auto; padding: 12px; color: var(--faint); font-size: 11px; display: flex; align-items: center; gap: 7px; }
.sidebar .rodape .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ===========================================================================
   CONTEÚDO
   =========================================================================== */
.conteudo { margin-left: var(--sidebar-w); padding: 30px 36px 70px; flex: 1; min-width: 0; position: relative; z-index: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; animation: fadeInUp 0.5s var(--t) both; }
.page-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; display: flex; align-items: center; gap: 11px; }
.page-head h2 .icn { width: 26px; height: 26px; color: var(--brand-2); }
.page-head .subtitulo { color: var(--muted); margin-top: 5px; }
.page-head .acoes { display: flex; gap: 10px; align-items: center; }

.stagger > * { animation: fadeInUp 0.5s var(--t) both; }
.stagger > *:nth-child(1){animation-delay:.04s}.stagger > *:nth-child(2){animation-delay:.09s}
.stagger > *:nth-child(3){animation-delay:.14s}.stagger > *:nth-child(4){animation-delay:.19s}
.stagger > *:nth-child(5){animation-delay:.24s}.stagger > *:nth-child(6){animation-delay:.29s}
.stagger > *:nth-child(7){animation-delay:.34s}.stagger > *:nth-child(8){animation-delay:.39s}

/* ===========================================================================
   CARDS / KPIs / PAINÉIS
   =========================================================================== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }

.card, .painel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.card { padding: 18px 20px; position: relative; overflow: hidden; transition: transform var(--t), box-shadow var(--t), border-color var(--t); }
.card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px; background: var(--grad); opacity: 0; transition: opacity var(--t); }
.card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--glow); }
.card:hover::before { opacity: 1; }
.card .rotulo { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card .rotulo .chip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand-2); }
.card .rotulo .chip .icn { width: 16px; height: 16px; }
.card .valor, .kpi-num { font-size: 32px; font-weight: 700; margin-top: 12px; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1; }
.card.destaque .valor { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.card .delta { font-size: 12px; color: var(--muted); margin-top: 7px; display: flex; align-items: center; gap: 5px; }
.card .delta.up { color: var(--ok); } .card .delta.down { color: var(--err); }

.painel { padding: 22px; margin-bottom: 20px; animation: fadeInUp 0.5s var(--t) both; }
.painel h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.painel h3 .icn { width: 18px; height: 18px; color: var(--brand-2); }

/* grid "bento" para a página de relatórios */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.bento > .col-4 { grid-column: span 4; } .bento > .col-6 { grid-column: span 6; }
.bento > .col-8 { grid-column: span 8; } .bento > .col-12 { grid-column: span 12; }
@media (max-width: 1100px){ .bento > [class^="col-"]{ grid-column: span 12; } }

/* ===========================================================================
   GRÁFICOS (SVG)
   =========================================================================== */
.chart-card { display: flex; flex-direction: column; min-height: 0; }
.chart-body { flex: 1; display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.donut-center { font-family: "Space Grotesk"; }
.legend { display: flex; flex-direction: column; gap: 9px; min-width: 130px; }
.legend .li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.legend .li .sw { width: 11px; height: 11px; border-radius: 4px; flex: none; }
.legend .li b { color: var(--text); margin-left: auto; font-variant-numeric: tabular-nums; font-family: "Space Grotesk"; }
.bar-track { fill: rgba(125,145,196,0.10); }
.chart-grid line { stroke: rgba(125,145,196,0.10); }
.chart-lbl { fill: var(--faint); font-size: 11px; font-family: "Inter"; }

/* ===========================================================================
   TABELAS
   =========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
  border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: rgba(11,16,30,0.7); backdrop-filter: blur(6px); }
tbody tr { border-bottom: 1px solid var(--line); transition: background var(--t); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clicavel { cursor: pointer; }
tbody tr.row-in { animation: fadeInUp 0.4s var(--t) both; }
.mono { font-family: "Space Grotesk", Consolas, monospace; font-size: 12.5px; }

/* ===========================================================================
   BADGES
   =========================================================================== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: rgba(52,211,153,0.12); color: var(--ok); border-color: rgba(52,211,153,0.25); }
.badge-warn { background: rgba(251,191,36,0.12); color: var(--warn); border-color: rgba(251,191,36,0.25); }
.badge-err { background: rgba(251,113,133,0.12); color: var(--err); border-color: rgba(251,113,133,0.25); }
.badge-info { background: rgba(96,165,250,0.12); color: var(--info); border-color: rgba(96,165,250,0.25); }

/* ===========================================================================
   BOTÕES / INPUTS
   =========================================================================== */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 9px 16px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: transform 0.12s var(--t), filter var(--t), box-shadow var(--t); }
.btn .icn { width: 16px; height: 16px; }
.btn:hover { filter: brightness(1.13); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -10px rgba(99,102,241,0.85); }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #fb7185); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; }
.btn-mini { padding: 5px 11px; font-size: 12px; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,0.4); animation: ripple 0.55s var(--t); pointer-events: none; }

input[type="text"], input[type="number"], input[type="search"], select, textarea {
  background: rgba(7,10,20,0.6); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--r-md); padding: 9px 12px; font-size: 13px; font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t), background var(--t); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,0.18); background: rgba(7,10,20,0.85); }
input.inline { width: 110px; padding: 5px 9px; }
::placeholder { color: var(--faint); }
label.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
label.chk input { accent-color: var(--brand); width: 16px; height: 16px; }
.linha-form { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; margin-bottom: 14px; }

/* progresso */
.progress { background: rgba(7,10,20,0.7); border: 1px solid var(--line); border-radius: 20px; height: 14px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: 20px; background: var(--grad); background-size: 200% 100%;
  transition: width 0.6s var(--t); animation: shimmerBar 2.2s linear infinite; box-shadow: 0 0 16px -2px rgba(99,102,241,0.7); }
.ring { --val: 0; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--brand) calc(var(--val)*1%), rgba(125,145,196,0.13) 0); transition: background 0.8s var(--t); }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface-solid); }
.ring .ring-val { position: relative; font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }

pre.log { background: #060912; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; max-height: 380px;
  overflow-y: auto; font-size: 12px; line-height: 1.6; font-family: "Space Grotesk", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

/* abas */
.abas { display: flex; gap: 5px; margin-bottom: 18px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.abas button { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: none; color: var(--muted);
  border-radius: 10px; padding: 9px 15px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; transition: color var(--t), background var(--t); }
.abas button .icn { width: 15px; height: 15px; }
.abas button:hover { color: var(--text); }
.abas button.ativa { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -10px rgba(99,102,241,0.85); }
.aba-painel { animation: fadeIn 0.35s var(--t) both; }

/* skeleton / spinner */
.skel { position: relative; overflow: hidden; background: rgba(125,145,196,0.10); border-radius: 6px; height: 14px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(125,145,196,0.18), transparent); animation: shimmer 1.3s infinite; }
.skel-card { height: 96px; border-radius: var(--r-lg); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }

/* toasts */
#toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 11px; background: var(--surface-solid); border: 1px solid var(--line-2);
  border-left: 4px solid var(--brand); border-radius: 12px; padding: 13px 17px; box-shadow: 0 18px 44px -14px rgba(0,0,0,0.75);
  max-width: 410px; animation: toastIn 0.4s var(--t) both; }
.toast.saindo { animation: toastOut 0.3s var(--t) forwards; }
.toast .icn { width: 18px; height: 18px; }
.toast.ok { border-left-color: var(--ok); } .toast.ok .icn { color: var(--ok); }
.toast.erro { border-left-color: var(--err); } .toast.erro .icn { color: var(--err); }
.toast.info .icn { color: var(--info); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(4,7,15,0.74); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 200; animation: fadeIn 0.22s var(--t); }
.modal { background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 26px;
  width: min(560px, 92vw); box-shadow: 0 30px 90px -20px rgba(0,0,0,0.85); animation: modalIn 0.3s var(--t) both; }
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.modal .modal-acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* estado vazio */
.vazio { text-align: center; color: var(--muted); padding: 42px 20px; }
.vazio .icn { width: 40px; height: 40px; opacity: 0.5; margin-bottom: 12px; color: var(--faint); }

/* utilitários */
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mt { margin-top: 16px; } .gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; } .right { margin-left: auto; }
.detalhe { border-left: 3px solid; border-image: var(--grad) 1; padding-left: 16px; }
.pill { background: rgba(99,102,241,0.16); color: var(--text); padding: 3px 11px; border-radius: 20px; font-size: 12px; }

/* "O que fazer agora" — linhas de ação clicáveis na home */
.acao-item { display: flex; align-items: center; gap: 14px; padding: 13px 15px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 9px;
  transition: border-color var(--t), background var(--t), transform var(--t); }
.acao-item:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateX(2px); }
.acao-item .ico-a { width: 22px; height: 22px; flex: none; }
.acao-item .txt { flex: 1; min-width: 0; }
.acao-item .txt b { font-weight: 600; }
.acao-item .txt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* keyframes */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 3px rgba(251,113,133,0.12)} 50%{box-shadow:0 0 0 6px rgba(251,113,133,0.03)} }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes shimmerBar { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes dash { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 860px) {
  :root { --sidebar-w: 68px; }
  .sidebar { padding: 16px 8px; }
  .sidebar .brand .title, .nav-link .rotulo-nav, .nav-link .nav-num, .sidebar .rodape span, .nav-sec { display: none; }
  .conteudo { padding: 22px 16px 50px; }
  .periodo-box { display: none; }
}

/* ============================================================================
   SELETOR DE PERÍODO (sidebar) + banner de período sem árvore
   ============================================================================ */
.periodo-box {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.periodo-box.alerta {
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
  background: color-mix(in srgb, var(--warn) 9%, var(--surface-2));
}
.periodo-rotulo {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.sel-periodo {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-solid);
  color: var(--text);
  font: 600 12.5px Inter, sans-serif;
  cursor: pointer;
}
.periodo-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
}
.periodo-status.ok { color: var(--ok); }
.periodo-status.alerta { color: var(--warn); }

.banner-periodo {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 60;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 22px;
  font-size: 12.5px; font-weight: 600;
  color: #78350f;
  background: color-mix(in srgb, var(--warn) 88%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 60%, black);
}
.banner-periodo svg { flex: none; }

/* ===========================================================================
   SELO DE DEMONSTRAÇÃO (exclusivo da versão de portfólio — dados fictícios)
   =========================================================================== */
#selo-demo {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 20px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  color: #04070f; font-size: 13px; letter-spacing: 0.3px;
  box-shadow: 0 6px 22px -10px rgba(0, 0, 0, 0.9);
}
#selo-demo strong { font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 700; letter-spacing: 0.8px; }
#selo-demo .selo-sub { color: rgba(4, 7, 15, 0.72); font-size: 12px; }
#selo-demo .selo-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #04070f;
  animation: seloPulso 1.6s ease-in-out infinite;
}
@keyframes seloPulso { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }

.com-selo-demo .sidebar { padding-top: 62px; }
.com-selo-demo .conteudo { padding-top: 66px; }
@media (max-width: 720px) { #selo-demo .selo-sub { display: none; } }
