/* =============================================
   ErOS IO Admin Dashboard — styles.css
   Design: WeeEats-inspired clean light UI
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ─────────────────────────── */
:root {
  --bg:          #F8F9FA;
  --surface:     #FFFFFF;
  --surface-2:   #F3F4F6;
  --border:      #E5E7EB;
  --border-2:    #D1D5DB;

  --text:        #1A1D23;
  --text-muted:  #6B7280;
  --text-dim:    #9CA3AF;

  --green:       #00E5A0;
  --green-active:#00B87A;
  --green-dim:   rgba(0,229,160,0.08);
  --green-soft:  rgba(0,184,122,0.12);

  --positive:    #10B981;
  --positive-bg: rgba(16,185,129,0.08);

  --negative:    #EF4444;
  --negative-bg: rgba(239,68,68,0.08);

  --warning:     #F59E0B;
  --warning-bg:  rgba(245,158,11,0.08);

  --info:        #3B82F6;
  --info-bg:     rgba(59,130,246,0.08);

  --purple:      #8B5CF6;
  --purple-bg:   rgba(139,92,246,0.08);

  --danger:      #EF4444;
  --danger-bg:   rgba(239,68,68,0.08);
  --danger-dim:  rgba(239,68,68,0.08);

  --sidebar-w:   240px;
  --topbar-h:    64px;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;
  --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.12);

  --t-fast: 120ms ease;
  --t-mid:  220ms ease;
  --t-slow: 360ms cubic-bezier(.4,0,.2,1);

  --density-pad: 24px;
  --row-h:       44px;
}

[data-density="compact"] { --density-pad: 16px; --row-h: 36px; font-size: 13px; }
[data-density="spacious"]{ --density-pad: 32px; --row-h: 52px; }

/* Dark theme override */
[data-theme="dark"] {
  --bg:         #1D2139;
  --surface:    #252B4A;
  --surface-2:  #2A3158;
  --border:     #2F3660;
  --border-2:   #3A4270;
  --text:       #E6EDF3;
  --text-muted: #8B949E;
  --text-dim:   #5A6480;
  --shadow:     0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --positive:   #00E5A0;
  --positive-bg:rgba(0,229,160,0.1);
  --negative:   #FF4D6A;
  --negative-bg:rgba(255,77,106,0.1);
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }
img, svg { display: block; }

/* ─── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ============================================
   LOGIN PAGE
   ============================================ */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}
.login-logo-mark {
  width: 40px;
  height: 40px;
  background: var(--green);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo-mark svg { color: #fff; }
.login-logo-text strong { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; display: block; }
.login-logo-text span  { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--positive); }

.login-title { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.login-field input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-size: 14px;
}
.login-field input:focus { border-color: var(--positive); box-shadow: 0 0 0 3px var(--positive-bg); }
.login-field input.error { border-color: var(--negative); }

.login-error { font-size: 12px; color: var(--negative); margin-top: 5px; display: none; }
.login-error.visible { display: block; }

.login-btn {
  width: 100%;
  background: var(--positive);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  letter-spacing: 0.1px;
}
.login-btn:hover { background: #0ea374; box-shadow: 0 4px 12px rgba(0,184,122,0.3); }
.login-btn:active { transform: scale(0.99); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-footer { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-dim); }

/* ============================================
   APP SHELL
   ============================================ */
#app { display: none; height: 100vh; overflow: hidden; }
#app.visible { display: flex; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--green);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-logo-mark svg { color: #fff; }
.sidebar-logo-name   { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.sidebar-logo-badge  { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--positive); line-height: 1; margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--green-dim); color: var(--green-active); font-weight: 600; }
.nav-item.active .nav-icon svg { color: var(--green-active); }

.nav-icon { width: 18px; min-width: 18px; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 17px; height: 17px; color: inherit; }
.nav-label { flex: 1; }

.nav-badge {
  background: var(--negative);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-active);
  text-transform: uppercase;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }
.sidebar-user-info { flex: 1; overflow: hidden; }

.sidebar-logout {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-logout:hover { background: var(--danger-bg); color: var(--negative); }
.sidebar-logout svg { width: 15px; height: 15px; }

/* ============================================
   MAIN AREA
   ============================================ */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: relative;
  z-index: 50;
}

.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.3px; }

.period-selector {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.period-btn { padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); transition: background var(--t-fast), color var(--t-fast); white-space: nowrap; }
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border-radius: var(--radius-sm); }

.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
  border: 1px solid transparent;
}
.topbar-icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.topbar-icon-btn svg { width: 18px; height: 18px; }

.topbar-notif-badge {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--negative);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--green-active);
  cursor: pointer;
  text-transform: uppercase;
  transition: box-shadow var(--t-fast);
}
.topbar-avatar:hover { box-shadow: 0 0 0 3px var(--green-soft); }

.avatar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.avatar-dropdown.open { display: block; }
.avatar-dropdown-header { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.avatar-dropdown-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.avatar-dropdown-email { font-size: 11px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.avatar-dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.avatar-dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.avatar-dropdown-item svg { width: 14px; height: 14px; }
.avatar-dropdown-item.danger { color: var(--negative); }
.avatar-dropdown-item.danger:hover { background: var(--danger-bg); }

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content { flex: 1; overflow-y: auto; overflow-x: hidden; }

.page { display: none; padding: var(--density-pad); min-height: 100%; animation: fadeIn 200ms ease; }
.page.active { display: block; }

@keyframes fadeIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }

/* ============================================
   KPI CARDS
   ============================================ */
.kpi-grid { display: grid; gap: 16px; }
.kpi-grid-4 { grid-template-columns: repeat(4,1fr); }
.kpi-grid-3 { grid-template-columns: repeat(3,1fr); }
.kpi-grid-2 { grid-template-columns: repeat(2,1fr); }
.kpi-grid-8 { grid-template-columns: repeat(4,1fr); }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.kpi-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 4px; }
.kpi-desc  { font-size: 11px; color: var(--text-muted); opacity: 0.75; margin-bottom: 10px; line-height: 1.3; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.8px; line-height: 1; margin-bottom: 10px; }
.kpi-value-green { color: #00E5A0; }

/* Badge de tendência para KPIs do P&L — cor permanece preta no número */
.kpi-trend { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; margin-left: 10px; vertical-align: middle; }
.kpi-trend.up   { background: rgba(0, 229, 160, 0.15); color: #00865A; }
.kpi-trend.down { background: rgba(255, 77, 106, 0.12); color: #C22E48; }
.kpi-card-compact { padding: 14px 16px; }
.kpi-card-compact .kpi-label { margin-bottom: 6px; }
.kpi-card-compact .kpi-value { font-size: 22px; margin-bottom: 0; }

.new-users-block { }
.new-users-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.new-users-icon   { width: 16px; height: 16px; color: #00E5A0; }
.new-users-title  { font-size: 13px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.6px; }

/* ============================================
   P&L — Profit & Loss
   ============================================ */
.pl-layout { display: grid; grid-template-columns: 60% 40%; gap: 16px; align-items: flex-start; }
.pl-col-left, .pl-col-right { min-width: 0; }

.pl-health {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text);
}
.pl-health.lucro     { background: rgba(0,229,160,0.08);  border-color: rgba(0,229,160,0.3); color: var(--positive); }
.pl-health.prejuizo  { background: rgba(255,77,106,0.08); border-color: rgba(255,77,106,0.3); color: var(--negative); }
.pl-health.breakeven { background: rgba(255,183,0,0.08);  border-color: rgba(255,183,0,0.3);  color: var(--warning); }

/* Linhas discretas de métrica (Índices / vs Mês Anterior) */
.pl-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 13px; color: var(--text-muted); }
.pl-row + .pl-row { border-top: 1px solid var(--border); }
.pl-row-val { font-size: 13px; font-weight: 600; color: var(--text); }
.pl-row-val.pos { color: var(--positive); }
.pl-row-val.neg { color: var(--negative); }

/* Seções dentro do card de Lançamentos */
.pl-section        { }
.pl-section + .pl-section { margin-top: 16px; }
.pl-section-title  { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; padding: 6px 0 8px; }
.pl-category-title { font-size: 12px; font-weight: 600; color: var(--text); padding: 6px 0; display: flex; justify-content: space-between; align-items: center; }
.pl-category-title .pl-cat-sub { font-size: 11px; font-weight: 500; color: var(--text-muted); }

.pl-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-radius: var(--radius-sm); font-size: 13px; transition: background var(--t-fast); }
.pl-item:hover { background: var(--surface-2); }
.pl-item + .pl-item { border-top: 1px solid var(--border); }
.pl-item-main { flex: 1; min-width: 0; }
.pl-item-desc { font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; }
.pl-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pl-item-recurring { font-size: 9px; color: var(--info); padding: 1px 5px; background: var(--info-bg); border-radius: 3px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.pl-item-val { font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; }
.pl-item.entrada .pl-item-val { color: var(--positive); }
.pl-item.saida   .pl-item-val { color: var(--negative); }
.pl-item-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast); }
.pl-item:hover .pl-item-actions { opacity: 1; }
.pl-item-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px; display: flex; align-items: center; }
.pl-item-btn:hover { background: var(--surface); color: var(--text); }

.pl-subtotal { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pl-total    { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 4px; font-size: 13px; font-weight: 700; color: var(--text); }
.pl-empty    { padding: 10px 4px; color: var(--text-muted); font-size: 12px; font-style: italic; }

#pl-anual-table td.pos { color: var(--positive); }
#pl-anual-table td.neg { color: var(--negative); }

/* ============================================
   MOTOR AI — Inteligência
   ============================================ */
.int-total-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
.int-total-label { color: var(--text-muted); }
.int-total-val   { font-weight: 700; color: var(--text); font-size: 14px; }

.int-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }

/* Contexto: 4 cards empilhados + donut */
.int-contexto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.int-contexto-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.int-contexto-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.int-contexto-donut-canvas-wrap { position: relative; width: 260px; height: 260px; }
.int-contexto-donut-canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.int-contexto-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.int-contexto-donut-total { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.int-contexto-donut-sublabel { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 4px; }
.int-contexto-legend { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 16px; justify-content: center; }
.int-contexto-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.int-contexto-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
@media (max-width: 900px) {
  .int-contexto-grid { grid-template-columns: 1fr; }
}

/* Dificuldade: botão "Ver detalhes" + área expansível */
.kpi-card .int-kpi-toggle { margin-top: 8px; background: none; border: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--accent, #58A6FF); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.kpi-card .int-kpi-toggle:hover { text-decoration: underline; }
.kpi-card .int-kpi-toggle-chevron { transition: transform var(--t-fast, 150ms); display: inline-block; }
.kpi-card .int-kpi-toggle.open .int-kpi-toggle-chevron { transform: rotate(180deg); }
.int-collapsible { max-height: 0; overflow: hidden; transition: max-height 320ms ease; }
.int-collapsible.open { max-height: 800px; }

/* Barra horizontal genérica para distribuições */
.int-bar-row { display: grid; grid-template-columns: 140px 1fr 90px; align-items: center; gap: 12px; padding: 7px 0; }
.int-bar-row + .int-bar-row { border-top: 1px solid var(--border); }
.int-bar-label { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.int-bar-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.int-bar-fill  { height: 100%; border-radius: 999px; background: var(--positive); transition: width var(--t-medium); }
.int-bar-val   { font-size: 12px; font-weight: 600; color: var(--text); text-align: right; }

/* Cores temáticas para tons */
.int-bar-fill.blue   { background: #58A6FF; }
.int-bar-fill.green  { background: #00E5A0; }
.int-bar-fill.yellow { background: #FFB800; }
.int-bar-fill.red    { background: #FF4D6A; }
.int-bar-fill.purple { background: #A78BFA; }
.int-bar-fill.gray   { background: #8B949E; }
.int-bar-fill.teal   { background: #2DD4BF; }
.int-bar-fill.pink   { background: #F472B6; }

/* Lista ordenada de erros/complicadores */
.int-list { display: flex; flex-direction: column; gap: 2px; }
.int-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.int-list-item:last-child { border-bottom: none; }
.int-list-rank { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.int-list-label { flex: 1; color: var(--text); }
.int-list-count { font-weight: 600; color: var(--text-muted); font-size: 12px; }

.int-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 12px; font-style: italic; }

.int-analise-content { font-size: 14px; line-height: 1.65; color: var(--text); }
.int-analise-content h1, .int-analise-content h2, .int-analise-content h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 14px 0 6px; }
.int-analise-content p { margin: 0 0 10px; }
.int-analise-content ul { margin: 6px 0 10px 20px; }
.int-analise-content li { margin-bottom: 4px; }
.kpi-value.sm { font-size: 22px; }

.kpi-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.kpi-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
}
.kpi-delta.up   { background: var(--positive-bg); color: var(--positive); }
.kpi-delta.down { background: var(--negative-bg); color: var(--negative); }
.kpi-delta.flat { background: var(--warning-bg);  color: var(--warning);  }
.kpi-delta svg { width: 10px; height: 10px; }

.kpi-meta-text { color: var(--text-muted); font-size: 12px; }

.kpi-icon {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon.green  { background: var(--positive-bg); color: var(--positive); }
.kpi-icon.danger { background: var(--danger-bg);   color: var(--negative); }
.kpi-icon.warn   { background: var(--warning-bg);  color: var(--warning);  }
.kpi-icon.info   { background: var(--info-bg);     color: var(--info);     }
.kpi-icon.purple { background: var(--purple-bg);   color: var(--purple);   }
.kpi-icon svg { width: 16px; height: 16px; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-title-group { display: flex; flex-direction: column; }
.card-body { padding: 20px; }
.card-actions { display: flex; align-items: center; gap: 8px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }

.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

/* ============================================
   CHART CONTAINERS
   ============================================ */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { display: block; width: 100% !important; max-width: 100%; }

.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-item.dimmed { opacity: 0.35; }

/* ============================================
   TABLES
   ============================================ */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 12px 14px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text); }

tbody tr { border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: rgba(248,249,250,0.6); }
tbody tr:hover { background: var(--surface-2); }
tbody tr.selected { background: var(--green-dim); }
tbody tr.clickable { cursor: pointer; }

tbody td { padding: 12px 14px; font-size: 13px; color: var(--text); vertical-align: middle; }
td.muted   { color: var(--text-muted); }
td.nowrap  { white-space: nowrap; }

.tbl-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--positive); }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
  width: 30px; height: 30px; min-width: 30px;
  border-radius: 50%;
  background: var(--green-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--green-active);
  text-transform: uppercase;
  border: 1.5px solid var(--border);
}
.user-cell-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.user-cell-email { font-size: 11px; color: var(--text-muted); }
.user-cell-info  { display: flex; flex-direction: column; }

.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--t-fast); }
tbody tr:hover .row-actions { opacity: 1; }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-green   { background: var(--positive-bg); color: var(--positive); }
.badge-danger  { background: var(--danger-bg);   color: var(--negative); }
.badge-warning { background: var(--warning-bg);  color: var(--warning);  }
.badge-info    { background: var(--info-bg);     color: var(--info);     }
.badge-muted   { background: var(--surface-2);   color: var(--text-muted); border: 1px solid var(--border); }
.badge-purple  { background: var(--purple-bg);   color: var(--purple);   }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: all var(--t-fast);
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 14px; height: 14px; }

.btn-primary { background: var(--positive); color: #fff; }
.btn-primary:hover { background: #0ea374; box-shadow: 0 4px 12px rgba(16,185,129,0.25); }

.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }

.btn-danger { background: var(--negative); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,0.25); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { opacity: 0.88; }

.btn-icon {
  width: 30px; height: 30px; padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn-icon svg { width: 13px; height: 13px; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-sm svg { width: 12px; height: 12px; }

.btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================
   FORMS
   ============================================ */
.form-group  { margin-bottom: 16px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

label.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}
.input:focus { border-color: var(--positive); box-shadow: 0 0 0 3px var(--positive-bg); }
.input::placeholder { color: var(--text-dim); }
.input:read-only { background: var(--surface-2); opacity: 0.75; cursor: not-allowed; }

select.input,
select.input:read-only {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  padding-right: 32px;
  background-color: var(--surface);
}

textarea.input { resize: vertical; min-height: 80px; }

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; flex: 1; }
.input-group .btn   { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.input-hint  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.input-error { font-size: 11px; color: var(--negative);   margin-top: 4px; display: none; }
.input-error.visible { display: block; }
.input.invalid { border-color: var(--negative); }

/* Toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; font-weight: 500; color: var(--text); }
.toggle-desc  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.toggle-info  { display: flex; flex-direction: column; }
.toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-2);
  border-radius: 22px; cursor: pointer;
  transition: background var(--t-mid);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-mid);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--positive); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

.range-input {
  width: 100%; -webkit-appearance: none;
  height: 5px; border-radius: 3px;
  background: var(--border-2); outline: none; cursor: pointer;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--positive); cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-muted);
}
.checkbox-item input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--positive); cursor: pointer; }
.checkbox-item:hover { color: var(--text); }

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar { position: relative; display: flex; align-items: center; }
.search-bar svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.search-bar .input { padding-left: 34px; }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.filter-bar .search-bar { flex: 1; min-width: 200px; }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
  background: var(--surface);
}
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.page-btn:hover { background: var(--surface-2); color: var(--text); }
.page-btn.active { background: var(--positive); border-color: var(--positive); color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-size-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  padding: 4px 8px; font-size: 12px; cursor: pointer; outline: none;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms cubic-bezier(.34,1.3,.7,1);
}
.modal-lg { max-width: 700px; }
.modal-sm { max-width: 380px; }

@keyframes modalIn { from { opacity:0; transform:scale(0.94) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 22px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.modal-confirm-input {
  width: 100%; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--text); outline: none;
  font-size: 13px; margin-top: 10px;
  transition: border-color var(--t-fast);
}
.modal-confirm-input:focus { border-color: var(--negative); }
.modal-confirm-text { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.modal-confirm-warn { font-size: 12px; color: var(--negative); margin-top: 8px; font-weight: 500; }

/* ============================================
   SLIDE-OVER
   ============================================ */
.slideover-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.2); backdrop-filter: blur(2px); z-index: 800; display: none; }
.slideover-overlay.open { display: block; }

.slideover {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 810;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t-slow);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.slideover.open { transform: translateX(0); }

.slideover-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface); z-index: 1;
}
.slideover-title { font-size: 15px; font-weight: 700; color: var(--text); }
.slideover-close { width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.slideover-close:hover { background: var(--surface-2); color: var(--text); }
.slideover-close svg { width: 15px; height: 15px; }
.slideover-body { flex: 1; padding: 22px; }

.slideover-user-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px; padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.slideover-avatar {
  width: 52px; height: 52px; min-width: 52px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  color: var(--green-active); text-transform: uppercase;
}
.slideover-user-name  { font-size: 16px; font-weight: 700; color: var(--text); }
.slideover-user-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.slideover-user-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.slideover-section { margin-bottom: 22px; }
.slideover-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 12px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { display: flex; flex-direction: column; gap: 3px; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.detail-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); }
.detail-value { font-size: 13px; color: var(--text); font-weight: 500; }

.action-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.payment-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.payment-row:last-child { border-bottom: none; }
.payment-row-amount { font-weight: 700; color: var(--positive); }

.session-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.session-row:last-child { border-bottom: none; }

/* ============================================
   TOAST
   ============================================ */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }

.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 280px; max-width: 380px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 260ms cubic-bezier(.34,1.3,.7,1);
  border-left: 3px solid var(--border-2);
}
@keyframes toastIn { from { opacity:0; transform:translateX(20px) scale(0.95); } to { opacity:1; transform:translateX(0) scale(1); } }
.toast.hiding { animation: toastOut 200ms ease forwards; }
@keyframes toastOut { to { opacity:0; transform:translateX(20px) scale(0.95); } }
.toast.success { border-left-color: var(--positive); }
.toast.error   { border-left-color: var(--negative); }
.toast.warning { border-left-color: var(--warning);  }
.toast.info    { border-left-color: var(--info);     }

.toast-icon { width: 18px; height: 18px; min-width: 18px; margin-top: 1px; }
.toast.success .toast-icon { color: var(--positive); }
.toast.error   .toast-icon { color: var(--negative); }
.toast.warning .toast-icon { color: var(--warning);  }
.toast.info    .toast-icon { color: var(--info);     }
.toast-icon svg { width: 100%; height: 100%; }
.toast-title   { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.toast-message { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.toast-content { flex: 1; }

/* ============================================
   SKELETON
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.6s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonPulse { 0% { background-position:200% 0; } 100% { background-position:-200% 0; } }

.skeleton-text  { height: 13px; margin-bottom: 6px; }
.skeleton-title { height: 22px; width: 55%; margin-bottom: 8px; }
.skeleton-kpi   { height: 88px; }
.skeleton-chart { height: 220px; }
.skeleton-row   { height: 46px; margin-bottom: 2px; border-radius: var(--radius-sm); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; gap: 12px; }
.empty-state-icon { width: 52px; height: 52px; border-radius: var(--radius); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-dim); border: 1px solid var(--border); }
.empty-state-icon svg { width: 22px; height: 22px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-state-text  { font-size: 13px; color: var(--text-muted); max-width: 280px; line-height: 1.5; }

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; border-radius: 99px; background: var(--positive); transition: width 600ms cubic-bezier(.4,0,.2,1); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--negative); }
.progress-lg { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress-lg .progress-fill { height: 100%; }

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.section-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ============================================
   BRIEFING NOTICE BAR (overview)
   ============================================ */
.briefing-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  background: rgba(0,229,160,0.07);
  border: 1px solid rgba(0,229,160,0.25);
  border-radius: var(--radius);
  margin-bottom: 20px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.briefing-notice:hover { background: rgba(0,229,160,0.13); border-color: rgba(0,229,160,0.4); }
.briefing-notice-icon  { width: 16px; height: 16px; flex-shrink: 0; color: var(--positive); }
.briefing-notice-text  { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.briefing-notice-chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-dim); }
[data-theme="dark"] .briefing-notice { background: rgba(0,229,160,0.06); border-color: rgba(0,229,160,0.2); }

/* ============================================
   AGENTE IA — 2-column layout
   ============================================ */
#page-agente { padding: var(--density-pad); overflow: visible; }

.agente-layout {
  display: flex;
  flex-direction: row;
  gap: 24px;
  overflow: visible;
  box-sizing: border-box;
  align-items: flex-start;
}

.agente-left {
  flex: 0 0 55%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: auto;
  overflow: visible;
  min-width: 0;
}

/* Briefing card cresce com o conteúdo, sem corte */
.agente-left > .card { height: auto; max-height: none; overflow: visible; }

.agente-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 20px;
  height: calc(100vh - 120px);
}

/* Chat card fills full right column (único elemento com altura fixa) */
.chat-card-full {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
}
.chat-card-full .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface-2);
  font-size: 13.5px;
}
.chat-card-full .chip-suggestions { flex-shrink: 0; }
.chat-card-full .chat-input-bar   { flex-shrink: 0; }

/* ============================================
   ANALYSIS CARDS
   ============================================ */
.analysis-cards-grid { display: flex; flex-direction: column; gap: 10px; }
.analysis-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.analysis-card-body { min-width: 0; }
.analysis-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.analysis-card-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.analysis-card-value { font-size: 20px; font-weight: 700; line-height: 1; margin-top: 4px; }
.analysis-card.positive .analysis-card-value { color: #00B87A; }
.analysis-card.attention .analysis-card-value { color: #FF4D6A; }
.analysis-card.neutral   .analysis-card-value { color: #58A6FF; }

/* ============================================
   AGENT BRIEFING (page agente — legacy compat)
   ============================================ */
.agent-briefing-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.agent-briefing-title  { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--positive); }
.agent-briefing-title svg { width: 15px; height: 15px; }
.agent-briefing-date   { font-size: 11px; color: var(--text-muted); }
.agent-briefing-text   { font-size: 13px; color: var(--text-muted); line-height: 1.65; }

/* ============================================
   FINANCEIRO
   ============================================ */
.cac-calc-results { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.calc-result-item { display: flex; flex-direction: column; align-items: center; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.calc-result-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; }
.calc-result-value { font-size: 22px; font-weight: 700; color: var(--text); }

.projection-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
.projection-card  { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.projection-period{ font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.projection-value { font-size: 22px; font-weight: 700; color: var(--positive); }

.mrr-goal-header { display: flex; align-items: center; justify-content: space-between; }
.mrr-goal-label  { font-size: 13px; color: var(--text-muted); }
.mrr-goal-values { font-size: 12px; color: var(--text-muted); display: flex; gap: 4px; }
.mrr-goal-current{ font-weight: 700; color: var(--text); }

.ratio-gauge { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ratio-bar   { flex: 1; height: 5px; background: var(--border-2); border-radius: 99px; overflow: hidden; }
.ratio-fill  { height: 100%; border-radius: 99px; background: var(--positive); transition: width 600ms ease; }
.ratio-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.calc-history-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.calc-history-row:last-child { border-bottom: none; }

/* ============================================
   ANALYTICS
   ============================================ */
.cohort-table { border-collapse: collapse; width: 100%; }
.cohort-table th, .cohort-table td { padding: 9px 11px; text-align: center; font-size: 12px; border: 1px solid var(--border); }
.cohort-table th { background: var(--surface-2); font-weight: 700; font-size: 11px; color: var(--text-muted); }
.cohort-table td:first-child { font-weight: 600; color: var(--text-muted); text-align: left; white-space: nowrap; }
.cohort-cell { border-radius: var(--radius-sm); font-weight: 600; }

.funnel-container { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.funnel-step { display: flex; align-items: center; gap: 12px; }
.funnel-bar-wrap { flex: 1; height: 38px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.funnel-bar-fill { height: 100%; background: var(--positive); opacity: 0.75; transition: width 600ms ease; border-radius: var(--radius-sm); }
.funnel-step:nth-child(2) .funnel-bar-fill { background: var(--info); }
.funnel-step:nth-child(3) .funnel-bar-fill { background: var(--warning); }
.funnel-step:nth-child(4) .funnel-bar-fill { background: var(--purple); }
.funnel-label { width: 180px; font-size: 12px; color: var(--text-muted); text-align: right; white-space: nowrap; }
.funnel-count { width: 80px; font-size: 13px; font-weight: 700; color: var(--text); text-align: right; }
.funnel-pct   { width: 46px; font-size: 12px; color: var(--text-muted); text-align: right; }

.heatmap-container { overflow-x: auto; padding: 4px; }
.heatmap-cell { width: 20px; height: 20px; border-radius: 3px; background: var(--surface-2); transition: transform var(--t-fast); cursor: default; border: 1px solid var(--border); }
.heatmap-cell:hover { transform: scale(1.2); z-index: 1; }
.heatmap-label { font-size: 10px; color: var(--text-dim); display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }

/* ============================================
   ALERTAS
   ============================================ */
.alert-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--surface-2); }
.alert-severity-icon { width: 36px; height: 36px; min-width: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.alert-severity-icon svg { width: 16px; height: 16px; }
.sev-critical { background: var(--danger-bg);   color: var(--negative); }
.sev-warning  { background: var(--warning-bg);  color: var(--warning);  }
.sev-info     { background: var(--info-bg);     color: var(--info);     }
.sev-ok       { background: var(--positive-bg); color: var(--positive); }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--text); }
.alert-desc  { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.alert-meta  { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.alert-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }

/* ============================================
   RELATÓRIOS
   ============================================ */
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.report-card-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.report-card-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.report-card-icon svg { width: 16px; height: 16px; }
.report-card-title { font-size: 13px; font-weight: 700; color: var(--text); }
.report-card-desc  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.report-card-body  { padding: 16px 18px; flex: 1; }
.report-card-footer{ display: flex; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }

/* ============================================
   AGENTE IA
   ============================================ */
.ai-quick-btns { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.ai-quick-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
}
.ai-quick-btn:hover { background: var(--positive-bg); border-color: var(--positive); color: var(--positive); }
.ai-quick-btn svg { width: 14px; height: 14px; }

.chat-container { display: flex; flex-direction: column; height: 420px; }
.chat-messages  { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.chat-msg       { display: flex; gap: 10px; max-width: 85%; }
.chat-msg.user  { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 30px; height: 30px; min-width: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.chat-msg.user  .chat-msg-avatar { background: var(--green-soft); color: var(--positive); border: 1.5px solid var(--positive); }
.chat-msg.agent .chat-msg-avatar { background: var(--info-bg);    color: var(--info);     border: 1.5px solid var(--info); }
.chat-msg-bubble { padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; }
.chat-msg.user  .chat-msg-bubble { background: var(--positive); color: #fff; border-radius: var(--radius-sm) var(--radius-sm) 0 var(--radius-sm); }
.chat-msg.agent .chat-msg-bubble { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 0; box-shadow: var(--shadow); }
.chat-msg-time  { font-size: 10px; color: var(--text-dim); margin-top: 4px; text-align: right; }
.chat-input-bar {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text); outline: none;
  font-size: 13px; resize: none;
  transition: border-color var(--t-fast);
}
.chat-input:focus { border-color: var(--positive); }
.chip-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.chip {
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.chip:hover { background: var(--positive-bg); border-color: var(--positive); color: var(--positive); }

/* ============================================
   EQUIPE
   ============================================ */
.team-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; box-shadow: var(--shadow); transition: box-shadow var(--t-fast), transform var(--t-fast); }
.team-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.team-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--green-soft); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: var(--positive); text-transform: uppercase; margin-bottom: 4px; }
.team-name  { font-size: 14px; font-weight: 700; color: var(--text); }
.team-email { font-size: 12px; color: var(--text-muted); }
.team-card-actions { display: flex; gap: 5px; margin-top: 6px; }

.perms-table { width: 100%; border-collapse: collapse; }
.perms-table th, .perms-table td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.perms-table th { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; color: var(--text-muted); background: var(--surface-2); }
.perms-table td:first-child { font-weight: 500; color: var(--text); }
.perm-check { color: var(--positive); }
.perm-cross { color: var(--negative); }

/* ============================================
   LOGS
   ============================================ */
.log-row-expanded { background: var(--surface-2) !important; }
.log-json { padding: 12px 16px; font-family: 'JetBrains Mono','Fira Code',monospace; font-size: 11px; color: var(--text-muted); line-height: 1.6; white-space: pre-wrap; word-break: break-all; max-height: 280px; overflow-y: auto; border-bottom: 1px solid var(--border); }
.log-refresh-indicator { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.log-refresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); }
.log-refresh-dot.paused { background: var(--text-dim); }

/* ============================================
   CONFIGURAÇÕES
   ============================================ */
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.settings-section-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.settings-section-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.settings-section-icon svg { width: 14px; height: 14px; }
.settings-section-title { font-size: 15px; font-weight: 700; color: var(--text); }
.settings-section-body { padding: 20px; }

.runway-display { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text); margin-top: 10px; }
.runway-value { font-size: 20px; font-weight: 700; color: var(--positive); }

/* ============================================
   SUPORTE
   ============================================ */
.support-search-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.support-result { padding: 16px 18px; border-top: 1px solid var(--border); display: none; background: var(--surface-2); }
.support-result.visible { display: block; }

.quick-action-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.quick-action-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 15px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); cursor: pointer;
  transition: all var(--t-fast); text-align: left;
}
.quick-action-btn:hover { background: var(--surface); border-color: var(--positive); box-shadow: var(--shadow-md); color: var(--text); }
.quick-action-icon { width: 36px; height: 36px; min-width: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.quick-action-icon svg { width: 16px; height: 16px; }
.quick-action-title { font-size: 13px; font-weight: 600; color: var(--text); }
.quick-action-desc  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ============================================
   EXPANSÃO
   ============================================ */
.latam-table { width: 100%; border-collapse: collapse; }
.latam-table th, .latam-table td { padding: 11px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.latam-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); background: var(--surface-2); }
.latam-checklist { display: flex; flex-direction: column; gap: 4px; }
.latam-check-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.latam-check-item svg { width: 12px; height: 12px; }
.latam-check-item.done { color: var(--positive); }

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.25); backdrop-filter: blur(6px); z-index: 600; display: none; align-items: flex-start; justify-content: center; padding-top: 90px; }
.search-overlay.open { display: flex; }
.search-popup { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 540px; overflow: hidden; box-shadow: var(--shadow-lg); }
.search-popup-input-wrap { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.search-popup-input-wrap svg { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; }
.search-popup-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 16px; }
.search-popup-results { max-height: 320px; overflow-y: auto; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; cursor: pointer; transition: background var(--t-fast); font-size: 13px; color: var(--text); }
.search-result-item:hover { background: var(--surface-2); }
.search-result-item svg { width: 14px; height: 14px; color: var(--text-muted); }

/* ============================================
   COLLAPSIBLE
   ============================================ */
.collapsible-section { overflow: hidden; transition: max-height var(--t-slow); }
.collapsible-section.collapsed { max-height: 0 !important; }

/* ============================================
   UTILITIES
   ============================================ */
.text-green    { color: var(--positive);   }
.text-danger   { color: var(--negative);   }
.text-warning  { color: var(--warning);    }
.text-info     { color: var(--info);       }
.text-muted    { color: var(--text-muted); }
.text-dim      { color: var(--text-dim);   }
.font-bold     { font-weight: 700; }
.font-medium   { font-weight: 500; }
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.align-center  { align-items: center; }
.gap-6  { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.spin   { animation: spin 1s linear infinite; }
.pulse  { animation: pulse 2s ease-in-out infinite; }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.separator { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--text-dim); font-size: 11px; }
.separator::before, .separator::after { content:''; flex:1; height:1px; background:var(--border); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .kpi-grid-4 { grid-template-columns: repeat(2,1fr); }
  .kpi-grid-8 { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 960px) {
  :root { --sidebar-w: 200px; }
  .kpi-grid-8 { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cac-calc-results, .projection-cards { grid-template-columns: 1fr; }
  .ai-quick-btns { grid-template-columns: repeat(2,1fr); }
  .action-btn-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { position: fixed; left: -240px; z-index: 500; transition: left var(--t-slow); }
  .sidebar.mobile-open { left: 0; width: 240px; }
  .kpi-grid-4, .kpi-grid-3 { grid-template-columns: repeat(2,1fr); }
  .period-selector { display: none; }
  .slideover { width: 100%; }
  .quick-action-grid { grid-template-columns: 1fr; }
}
