/* =====================================================================
   PA INTELIGÊNCIA — STYLE.CSS (Premium · glassmorphism · editorial)
   Inspirado no protótipo do desktop Claude (zip 2026-05-14).
   Tipografia Inter + Instrument Serif · acento azul #4a9eff.
   Suporta data-theme="dark" (padrão) e data-theme="light".
   ===================================================================== */

/* =====================================================================
   1. TOKENS — DARK (padrão)
   ===================================================================== */
:root, :root[data-theme="dark"] {
  --bg-deep:        #050810;
  --bg-surface:     #0b1120;
  --bg-elevated:    #111726;
  --bg-hover:       rgba(255, 255, 255, 0.04);

  --line:           rgba(255, 255, 255, 0.10);
  --line-soft:      rgba(255, 255, 255, 0.06);
  --line-strong:    rgba(255, 255, 255, 0.18);

  --text-primary:   #f1f4fb;
  --text-muted:     rgba(255, 255, 255, 0.55);
  --text-dim:       rgba(255, 255, 255, 0.35);

  --accent:         #4a9eff;
  --accent-deep:    #2c6cc9;
  --accent-glow:    rgba(74, 158, 255, 0.18);
  --accent-soft:    rgba(74, 158, 255, 0.08);

  --gold:           #c79b5d;
  --gold-soft:      rgba(199, 155, 93, 0.15);

  --purple:         #a855f7;
  --purple-soft:    rgba(168, 85, 247, 0.15);

  --danger:         #ff5a6e;
  --danger-soft:    rgba(255, 90, 110, 0.15);
  --success:        #4ac99b;
  --success-soft:   rgba(74, 201, 155, 0.15);
  --warn:           #f0b94d;
  --warn-soft:      rgba(240, 185, 77, 0.15);

  --font-sans:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif:     'Instrument Serif', Georgia, serif;
  --font-display:   var(--font-sans);
  --font-body:      var(--font-sans);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-pill:    999px;

  --shadow-sm:      0 1px 2px rgba(0,0,0,0.25);
  --shadow:         0 4px 14px rgba(0,0,0,0.35);
  --shadow-lg:      0 16px 48px rgba(0,0,0,0.45);

  --surface-glass:  rgba(17, 23, 38, 0.6);
  --logo-filter:    none;
}

/* =====================================================================
   2. TOKENS — LIGHT
   Mantém glassmorphism, mas paleta clara. Acento azul mais profundo
   para garantir contraste em fundo claro.
   ===================================================================== */
:root[data-theme="light"] {
  --bg-deep:        #eef2f8;
  --bg-surface:     #ffffff;
  --bg-elevated:    #f5f7fb;
  --bg-hover:       rgba(10, 14, 26, 0.04);

  --line:           rgba(10, 14, 26, 0.12);
  --line-soft:      rgba(10, 14, 26, 0.06);
  --line-strong:    rgba(10, 14, 26, 0.22);

  --text-primary:   #0a0e1a;
  --text-muted:     rgba(10, 14, 26, 0.60);
  --text-dim:       rgba(10, 14, 26, 0.42);

  --accent:         #2c6cc9;
  --accent-deep:    #1a4f9c;
  --accent-glow:    rgba(44, 108, 201, 0.14);
  --accent-soft:    rgba(44, 108, 201, 0.06);

  --gold:           #8d6634;
  --gold-soft:      rgba(141, 102, 52, 0.14);

  --purple:         #7c3aed;
  --purple-soft:    rgba(124, 58, 237, 0.14);

  --danger:         #d23048;
  --danger-soft:    rgba(210, 48, 72, 0.10);
  --success:        #1f9d6e;
  --success-soft:   rgba(31, 157, 110, 0.12);
  --warn:           #b07000;
  --warn-soft:      rgba(176, 112, 0, 0.12);

  --shadow-sm:      0 1px 2px rgba(10, 14, 26, 0.05);
  --shadow:         0 4px 14px rgba(10, 14, 26, 0.08);
  --shadow-lg:      0 12px 32px rgba(10, 14, 26, 0.12);

  --surface-glass:  rgba(255, 255, 255, 0.85);
}

/* =====================================================================
   3. RESET + BASE
   ===================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

html, body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}

/* Gradientes radiais decorativos atrás de tudo — só no dark.
   No light, a página é clara e os gradientes ficariam manchas estranhas. */
body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  transition: opacity .3s ease;
}
body::before {
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
}
body::after {
  bottom: -150px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--gold-soft) 0%, transparent 60%);
}
[data-theme="light"] body::before { opacity: 0.55; }
[data-theme="light"] body::after  { opacity: 0.45; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--text-primary); }

img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* =====================================================================
   4. TIPOGRAFIA
   ===================================================================== */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}
h1 { font-size: 26px; }
h2 { font-size: 18px; font-weight: 500; }
h3 { font-size: 15px; font-weight: 500; }

.serif,
.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.tabular { font-variant-numeric: tabular-nums; }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 4px;
}

/* =====================================================================
   5. LAYOUT — sidebar + main
   ===================================================================== */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.main {
  padding: 28px 32px;
  min-width: 0;
  overflow-x: hidden;
}

/* =====================================================================
   6. SIDEBAR
   ===================================================================== */
.sidebar {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 0 6px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.sidebar .brand-logo {
  width: 22px;
  height: 22px;
  filter: var(--logo-filter);
  flex-shrink: 0;
}
.sidebar .brand .serif,
.sidebar .brand .serif-italic {
  color: var(--accent);
  font-weight: 400;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar .nav-group-label,
.sidebar .nav-section {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  padding: 14px 10px 6px;
  font-weight: 500;
  text-transform: uppercase;
}
.sidebar .nav-group-label:first-child,
.sidebar .nav-section:first-child {
  padding-top: 0;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 1px 0;
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-left-color .15s ease;
}
.sidebar nav a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar nav a.active {
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--accent-glow) 0%, var(--accent-soft) 100%);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar nav a i[data-lucide],
.sidebar nav a .nav-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color .15s ease, filter .15s ease;
}
.sidebar nav a:hover i[data-lucide],
.sidebar nav a:hover .nav-icon,
.sidebar nav a.active i[data-lucide],
.sidebar nav a.active .nav-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.sidebar .divider {
  height: 1px;
  background: var(--line-soft);
  margin: 12px 0;
}

/* Card de usuário (rodapé do sidebar) */
.user-card {
  margin-top: auto;
  padding: 11px;
  background: var(--bg-hover);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta .role {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: capitalize;
}

/* Linha "Tema" no rodapé do sidebar */
.sidebar-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 6px;
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.sidebar-toggle-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =====================================================================
   7. PAGE HEADER
   ===================================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header > div:first-child {
  min-width: 0;
  flex: 1 1 320px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 60ch;
  line-height: 1.5;
}
.page-header .actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Eyebrow legado — neutralizado no novo design */
.eyebrow { display: none; }

/* =====================================================================
   8. BOTÕES
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
}
.btn[disabled], .btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn i[data-lucide],
.btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  border: none;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(74, 158, 255, 0.30);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.42);
  transform: translateY(-1px);
  color: #ffffff;
}
[data-theme="light"] .btn-primary {
  box-shadow: 0 4px 14px rgba(44, 108, 201, 0.22);
}
[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(44, 108, 201, 0.30);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--danger);
  border: none;
  color: #ffffff;
  font-weight: 600;
}
.btn-danger:hover { background: #ff7080; color: #ffffff; }

.btn-pill { border-radius: var(--radius-pill); padding: 13px 26px; }
.btn-block { width: 100%; }

.btn-bar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

/* =====================================================================
   9. KPI GRID — KPIs coloridos (azul/cobre/roxo/verde)
   ===================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.kpi {
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--line-soft);
}
/* Variantes coloridas — fundo levemente tingido + borda na cor */
.kpi-blue {
  background: linear-gradient(135deg, rgba(74,158,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(74,158,255,0.18);
}
.kpi-gold {
  background: linear-gradient(135deg, rgba(199,155,93,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(199,155,93,0.18);
}
.kpi-purple {
  background: linear-gradient(135deg, rgba(168,85,247,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(168,85,247,0.18);
}
.kpi-green {
  background: linear-gradient(135deg, rgba(74,201,155,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(74,201,155,0.18);
}
[data-theme="light"] .kpi-blue   { background: linear-gradient(135deg, rgba(44,108,201,0.06) 0%, rgba(255,255,255,0.6) 100%); border-color: rgba(44,108,201,0.20); }
[data-theme="light"] .kpi-gold   { background: linear-gradient(135deg, rgba(141,102,52,0.06) 0%, rgba(255,255,255,0.6) 100%); border-color: rgba(141,102,52,0.20); }
[data-theme="light"] .kpi-purple { background: linear-gradient(135deg, rgba(124,58,237,0.06) 0%, rgba(255,255,255,0.6) 100%); border-color: rgba(124,58,237,0.20); }
[data-theme="light"] .kpi-green  { background: linear-gradient(135deg, rgba(31,157,110,0.06) 0%, rgba(255,255,255,0.6) 100%); border-color: rgba(31,157,110,0.20); }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-icon i[data-lucide] { width: 16px; height: 16px; stroke-width: 1.5; }
.kpi-blue   .kpi-icon { background: rgba(74,158,255,0.15); }    .kpi-blue   .kpi-icon i { color: var(--accent); }
.kpi-gold   .kpi-icon { background: rgba(199,155,93,0.15); }    .kpi-gold   .kpi-icon i { color: var(--gold); }
.kpi-purple .kpi-icon { background: rgba(168,85,247,0.15); }    .kpi-purple .kpi-icon i { color: var(--purple); }
.kpi-green  .kpi-icon { background: rgba(74,201,155,0.15); }    .kpi-green  .kpi-icon i { color: var(--success); }

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 4px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.kpi-delta {
  font-size: 10px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.kpi-delta.up   { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.dim  { color: var(--text-dim); }
.kpi-delta i[data-lucide] { width: 11px; height: 11px; stroke-width: 1.5; }

/* Legado: .kpi com .icon/.label/.value/.delta (mantém algumas chamadas antigas) */
.kpi .icon  { display: none; }
.kpi .label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.kpi .value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.kpi .delta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.kpi .delta.up    { color: var(--success); }
.kpi .delta.down  { color: var(--danger); }

/* Dot de status */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--success); box-shadow: 0 0 8px rgba(74,201,155,0.6); animation: pulse-dot 2.4s ease-in-out infinite; }
.dot-warn  { background: var(--warn);    box-shadow: 0 0 8px rgba(240,185,77,0.5); animation: pulse-dot 2.4s ease-in-out infinite; }
.dot-dim   { background: rgba(255,255,255,0.20); }
[data-theme="light"] .dot-dim { background: rgba(10,14,26,0.20); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

/* =====================================================================
   10. PANEL / CARD (glassmorphism)
   ===================================================================== */
.panel {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.panel h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.panel-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.grid-2-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* =====================================================================
   11. PILLS
   ===================================================================== */
.pill {
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--bg-hover);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .15s ease;
}
.pill:hover { color: var(--text-primary); }
.pill.active {
  background: var(--accent-soft);
  border-color: rgba(74,158,255,0.25);
  color: var(--accent);
  font-weight: 500;
}
[data-theme="light"] .pill.active { border-color: rgba(44,108,201,0.30); }

/* =====================================================================
   12. BARRAS DE PROGRESSO (termômetro)
   ===================================================================== */
.bar-row { margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}
.bar-label .name { color: var(--text-muted); }
.bar-label .val  { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.bar-track {
  height: 5px;
  background: var(--bg-hover);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width .8s cubic-bezier(.2,.7,.2,1);
}
.bar-blue   { background: linear-gradient(90deg, var(--accent), var(--accent-deep)); }
.bar-green  { background: linear-gradient(90deg, var(--success), #2da57a); }
.bar-purple { background: linear-gradient(90deg, var(--purple), #7c3aed); }
.bar-red    { background: linear-gradient(90deg, var(--danger), #c93a4d); }
.bar-gold   { background: linear-gradient(90deg, var(--gold), #8b6a3d); }
.bar-warn   { background: linear-gradient(90deg, var(--warn), #c8941f); }

/* =====================================================================
   13. TABELAS
   ===================================================================== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  background: transparent;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tr:hover td { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table .name {
  font-weight: 500;
  color: var(--text-primary);
}
.table .sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.table .num { font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table strong { font-weight: 600; }

/* =====================================================================
   14. BADGES
   ===================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  background: var(--accent-glow);
  color: var(--accent);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}
.badge.lvl,
.badge-accent,
.badge-blue    { background: var(--accent-glow);  color: var(--accent); }
.badge-gold    { background: var(--gold-soft);    color: var(--gold); }
.badge-purple  { background: var(--purple-soft);  color: var(--purple); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn    { background: var(--warn-soft);    color: var(--warn); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }

/* =====================================================================
   15. FORMS
   ===================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.field-full,
.field.full { grid-column: 1 / -1; }

.field { margin-bottom: 12px; }
.form-grid .field { margin-bottom: 0; }

.field label,
.field > label:first-child {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.field input,
.field select,
.field textarea,
input.input,
select.input,
textarea.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
[data-theme="light"] .field input,
[data-theme="light"] .field select,
[data-theme="light"] .field textarea,
[data-theme="light"] input.input,
[data-theme="light"] select.input,
[data-theme="light"] textarea.input {
  background: #ffffff;
  border-color: var(--line);
}

.field textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field input[readonly],
.field textarea[readonly] {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

.field .hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  vertical-align: -2px;
}

@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   16. ÁRVORE
   ===================================================================== */
.tree-view {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 18px 20px;
}
.tree-node {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 13px;
}
.tree-node .lvl {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
}
.tree-node .meta {
  color: var(--text-dim);
  font-size: 11px;
}

/* =====================================================================
   17. MENSAGENS DE ERRO / SUCESSO
   ===================================================================== */
.error,
.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(255, 90, 110, 0.30);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(74, 201, 155, 0.30);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =====================================================================
   18. EMPTY STATE
   ===================================================================== */
.empty {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 13px;
}

/* =====================================================================
   19. LOGIN — split-screen editorial
   ===================================================================== */
body.landing-body {
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

.login-back {
  position: absolute;
  top: 22px;
  left: 24px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.login-back i { width: 14px; height: 14px; }
.login-back:hover { color: var(--text-primary); background: var(--bg-elevated); }

.login-toggle-wrap {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 5;
}

.login-layout,
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.login-hero {
  position: relative;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(74,158,255,0.15) 0%, transparent 50%),
    linear-gradient(225deg, rgba(199,155,93,0.10) 0%, transparent 60%),
    var(--bg-deep);
}
[data-theme="light"] .login-hero {
  background:
    linear-gradient(135deg, rgba(44,108,201,0.10) 0%, transparent 55%),
    linear-gradient(225deg, rgba(141,102,52,0.07) 0%, transparent 60%),
    #ffffff;
}
.login-hero-inner { max-width: 480px; }

.hero-title,
.login-hero h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.hero-title .serif-italic,
.hero-title .serif,
.login-hero h1 .serif,
.login-hero h1 .serif-italic {
  display: inline-block;
  font-size: 1.04em;
  color: var(--accent);
}
.hero-sub,
.login-hero p {
  color: var(--text-muted);
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.55;
  max-width: 440px;
}

.hero-pills,
.login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}
.hero-pill,
.login-feature {
  background: var(--bg-hover);
  border: 1px solid var(--line-soft);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
[data-theme="light"] .hero-pill,
[data-theme="light"] .login-feature {
  background: var(--bg-elevated);
  border-color: var(--line);
}

.login-form-wrap {
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
[data-theme="light"] .login-form-wrap { border-left: 1px solid var(--line-soft); }

.login-form {
  width: 100%;
  max-width: 380px;
}
.login-brand,
.brand-mini {
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 28px;
}
.login-brand .serif,
.login-brand .serif-italic,
.brand-mini .serif {
  color: var(--accent);
  font-weight: 400;
}
.login-form h1,
.login-form h2 {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.login-form .login-sub,
.login-form .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.login-form .field { margin-bottom: 16px; }

.login-form .input-with-icon {
  position: relative;
}
.login-form .input-with-icon > i,
.login-form .input-with-icon > .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}
.login-form .input-with-icon input {
  padding-left: 38px;
}
.login-form .input-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
}
.login-form .input-toggle:hover { color: var(--text-muted); }
.login-form .input-toggle i { width: 16px; height: 16px; }

.login-form .form-meta,
.login-form .forgot {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 18px;
}
.login-form .form-meta a,
.login-form .forgot a {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.login-form .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 14px;
  border-radius: 99px;
  font-weight: 600;
}

.login-divider,
.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-dim);
  font-size: 13px;
}
.login-divider::before,
.login-divider::after,
.divider-or::before,
.divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.btn-google[disabled] { color: var(--text-muted); cursor: not-allowed; }
.btn-google .google-icon { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .login-layout, .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 80px 24px 40px; min-height: auto; }
  .login-hero-inner { margin-top: 0; }
  .hero-title, .login-hero h1 { font-size: 34px; }
  .hero-sub, .login-hero p { font-size: 15px; }
  .hero-pills, .login-features { display: none; }
  .login-form-wrap { padding: 40px 24px 60px; }
}

/* =====================================================================
   20. INDICADORES — abas
   ===================================================================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
}
.tabs a {
  padding: 12px 18px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.tabs a:hover { color: var(--text-primary); }
.tabs a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* =====================================================================
   21. THEME SWITCH (sol + lua, sem chrome)
   ===================================================================== */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.theme-switch-btn {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-dim);
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.theme-switch-btn:hover {
  color: var(--text-muted);
  background: var(--bg-hover);
}
.theme-switch-btn i { width: 16px; height: 16px; stroke-width: 1.8; }
[data-theme="dark"]  .theme-switch-btn[data-theme-set="dark"],
[data-theme="light"] .theme-switch-btn[data-theme-set="light"] {
  color: var(--accent);
}

/* =====================================================================
   22. ANIMAÇÕES (preservadas + novas)
   ===================================================================== */
@keyframes anim-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-fade-in { animation: anim-fade-in .4s ease-out both; }

@keyframes anim-blur-in {
  from { opacity: 0; filter: blur(8px); transform: translateY(12px); }
  to   { opacity: 1; filter: blur(0);   transform: translateY(0); }
}
.anim-blur-in { animation: anim-blur-in .55s ease-out both; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Entrada automática de panels e KPIs */
.panel, .kpi {
  animation: anim-fade-in .4s ease both;
}

.anim-delay-1 { animation-delay: .05s; }
.anim-delay-2 { animation-delay: .10s; }
.anim-delay-3 { animation-delay: .15s; }
.anim-delay-4 { animation-delay: .20s; }

/* SVG charts — barras crescem do chão, linhas se desenham */
.chart-bar {
  transform-origin: bottom center;
  transform: scaleY(0);
  animation: chart-bar-grow .65s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes chart-bar-grow {
  to { transform: scaleY(1); }
}
.chart-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: chart-line-draw 1.2s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes chart-line-draw {
  to { stroke-dashoffset: 0; }
}

/* Anima KPI numérico via JS app.js (data-count). CSS apenas suaviza. */
.kpi-value, .kpi .value {
  transition: color .3s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   23. CACHE STRATEGY — version badge + toast
   ===================================================================== */
.app-version-badge {
  position: fixed;
  right: 12px;
  bottom: 10px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.55;
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
  z-index: 40;
  font-variant-numeric: tabular-nums;
}
[data-theme="light"] .app-version-badge { opacity: 0.7; }

.version-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-glow);
  color: var(--text-primary);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
  max-width: calc(100vw - 40px);
}
[data-theme="light"] .version-toast {
  background: #ffffff;
}
.version-toast.is-visible { opacity: 1; transform: translateY(0); }
.version-toast-text { font-weight: 500; }
.version-toast-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.version-toast-btn:hover { filter: brightness(1.05); }
.version-toast-close {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}
.version-toast-close:hover { color: var(--text-primary); }

/* =====================================================================
   24. LANDING (index.php) — pública
   ===================================================================== */
.streaks, .dot-grid, .hero-bg, .preview-frame, .features-dots {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line-soft);
}
.topbar.is-scrolled {
  backdrop-filter: blur(8px);
  background: rgba(5, 8, 16, 0.85);
}
[data-theme="light"] .topbar.is-scrolled { background: rgba(238, 242, 248, 0.9); }

.topbar-brand img {
  height: 28px;
  width: auto;
  filter: var(--logo-filter);
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.topbar-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s ease;
}
.topbar-nav a:hover,
.topbar-nav a.active { color: var(--text-primary); }
.topbar-nav .btn { margin-left: 4px; }

.hero {
  position: relative;
  padding: 100px 40px 80px;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 22px auto 18px;
  max-width: 880px;
}
.hero h1 .accent {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}
.hero .sub {
  color: var(--text-muted);
  font-size: clamp(15px, 1.5vw, 18px);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.55;
}
.hero .sub .accent { color: var(--accent); font-weight: 600; }
.hero-ctas {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.intro-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.intro-pill:hover { color: var(--text-primary); border-color: var(--line); }
.intro-pill .sep { width: 1px; height: 16px; background: var(--line-soft); }
.intro-pill .arrow-wrap {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-grid;
  place-items: center;
}
.intro-pill .arrow-wrap i { width: 14px; height: 14px; }

.features {
  padding: 40px 40px 100px;
  max-width: 1100px;
  margin: 0 auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  transition: border-color .2s ease, transform .2s ease;
}
.feature-card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-grid;
  place-items: center;
  margin-bottom: 18px;
}
.feature-icon i { width: 20px; height: 20px; stroke-width: 1.8; }
.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.feature-link {
  color: var(--accent);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
}
.feature-link:hover { color: var(--accent-deep); }

.landing-footer {
  padding: 20px 60px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-deep);
}
.landing-footer-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 1200px;
  margin: 0 auto;
}
.landing-footer-link { color: var(--text-muted); }
.landing-footer-link:hover { color: var(--text-primary); }
.landing-footer-version {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* glass-card legado */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
}

@media (max-width: 860px) {
  .features-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 24px 50px; }
  .features { padding: 20px 24px 60px; }
  .topbar { padding: 14px 20px; }
  .topbar-nav { gap: 14px; }
  .topbar-nav a:not(.btn) { display: none; }
}

/* =====================================================================
   25. SCROLLBAR
   ===================================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.10);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.20); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(10, 14, 26, 0.15); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(10, 14, 26, 0.25); }

/* =====================================================================
   26. RESPONSIVO
   ===================================================================== */
@media (max-width: 1024px) {
  .grid-2, .grid-2-equal { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }
  .main { padding: 20px; }
  .panel { padding: 16px; }
}
@media (max-width: 520px) {
  h1, .page-header h1 { font-size: 22px; }
  .kpi { padding: 14px 16px; }
  .kpi-value, .kpi .value { font-size: 22px; }
}
