/* ============================================================
   GLR Consultoria — Design System
   ============================================================ */

/* Tokens do Design System v2 (19/10/2026) — SaaS analítico: superfícies
   neutras, uma cor de destaque (índigo GLR), semântica só em status/variação.
   Tema escuro em :root; tema claro (padrão) em body.light. */
:root {
  --bg-base: #0b0c10;
  --bg-surface: #111318;
  --bg-card: #15171d;
  --bg-card-hover: #1b1e25;
  --bg-input: #15171d;
  --bg-subtle: #1a1d24;
  --border: rgba(255,255,255,0.075);
  --border-strong: rgba(255,255,255,0.13);
  --border-active: rgba(129,132,248,0.55);

  --text-primary: #eceef3;
  --text-secondary: #a3a8b6;
  --text-muted: #6b7080;

  --accent: #7c7ff5;
  --accent-light: #9ea1ff;
  --accent-strong: #6366f1;
  --accent-glow: rgba(124,127,245,0.14);
  --on-accent: #ffffff;

  --green: #34c38f;
  --green-bg: rgba(52,195,143,0.13);
  --red: #f26d6d;
  --red-bg: rgba(242,109,109,0.13);
  --yellow: #f2b44b;
  --yellow-bg: rgba(242,180,75,0.13);
  --orange: #f59a5b;
  --orange-bg: rgba(245,154,91,0.13);
  --purple: #a78bfa;
  --purple-bg: rgba(167,139,250,0.13);
  --cyan: #4cc9e0;
  --cyan-bg: rgba(76,201,224,0.13);

  --sidebar-w: 248px;
  --sidebar-mini-w: 72px;
  --header-h: 60px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --font-ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-num: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.28);
  --shadow: 0 12px 32px rgba(0,0,0,0.38);
  --ring: 0 0 0 3px rgba(124,127,245,0.28);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ── Modo Claro (padrão) ───────────────────────────────────── */
body.light {
  --bg-base: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --bg-input: #ffffff;
  --bg-subtle: #f3f4f7;
  --border: #e8eaef;
  --border-strong: #d7dae2;
  --border-active: rgba(79,70,229,0.45);

  --text-primary: #10131c;
  --text-secondary: #4a5062;
  --text-muted: #8a90a1;

  --accent: #4f46e5;
  --accent-light: #4f46e5;
  --accent-strong: #4338ca;
  --accent-glow: rgba(79,70,229,0.08);
  --on-accent: #ffffff;

  --green: #0f9f6e;
  --green-bg: rgba(15,159,110,0.09);
  --red: #d93f3f;
  --red-bg: rgba(217,63,63,0.08);
  --yellow: #b7791f;
  --yellow-bg: rgba(183,121,31,0.10);
  --orange: #d9622b;
  --orange-bg: rgba(217,98,43,0.08);
  --purple: #7c3aed;
  --purple-bg: rgba(124,58,237,0.08);
  --cyan: #0e8aa6;
  --cyan-bg: rgba(14,138,166,0.08);

  --shadow-xs: 0 1px 2px rgba(16,19,28,0.04);
  --shadow-sm: 0 1px 3px rgba(16,19,28,0.06), 0 1px 2px rgba(16,19,28,0.04);
  --shadow: 0 16px 40px rgba(16,19,28,0.10), 0 2px 6px rgba(16,19,28,0.05);
  --ring: 0 0 0 3px rgba(79,70,229,0.18);
}
body.light .dre-tbl tr:hover td { background: rgba(0,0,0,.02); }
/* Logo branca → preta no modo claro (inverte e troca o blend de screen p/ multiply) */
body.light .sidebar-logo img {
  filter: invert(1) hue-rotate(180deg);
  mix-blend-mode: multiply !important;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ---- Layout ---- */
#app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

/* Fundo escuro atrás do menu mobile — toca em qualquer lugar fora
   do menu pra fechar (o botão de 3 riscos fica escondido atrás do
   próprio menu quando ele abre, então precisa de outro jeito de fechar) */
#sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
#sidebar.open ~ #sidebar-backdrop,
#sidebar.open + #sidebar-backdrop {
  display: block;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: white; letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-text { line-height: 1.2; }
.logo-text strong { display: block; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.logo-text span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-section { padding: 10px 8px 2px; }
.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  margin-bottom: 1px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: none;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item.active .nav-icon { color: var(--accent-light); }

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.65; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.green { background: var(--bg-card-hover); color: var(--green); }
.nav-badge.yellow { background: var(--bg-card-hover); color: var(--yellow); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.user-card:hover { background: var(--bg-card); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}

.user-info strong { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-info span { font-size: 11px; color: var(--text-muted); }

/* ---- Main Content ---- */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
#header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title { font-size: 18px; font-weight: 700; flex: 1; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 280px;
  transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--border-active); }
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13.5px;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }

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

/* ---- Page Content ---- */
#page-content { flex: 1; padding: 24px; overflow-y: auto; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-hover {
  transition: all 0.2s ease;
  cursor: pointer;
}
.card-hover:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ---- KPI Cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.2s, background 0.2s;
}
.kpi-card:hover { border-color: var(--border-active); background: var(--bg-card-hover); }

.kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.kpi-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.kpi-delta { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

/* ---- Section Headers ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.section-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Grid Layouts ---- */
.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(300px, 1fr)); gap: 16px; }

/* ---- Charts ---- */
.chart-container { position: relative; }
.chart-wrapper { height: 220px; position: relative; }
.chart-wrapper-lg { height: 300px; position: relative; }
.chart-wrapper-sm { height: 160px; position: relative; }

/* ---- Table ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody td { padding: 12px 14px; color: var(--text-secondary); vertical-align: middle; }
tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ---- Status Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.status-crescimento { background: var(--green-bg); color: var(--green); }
.status-ativo { background: rgba(99,102,241,0.12); color: var(--accent-light); }
.status-queda { background: var(--orange-bg); color: var(--orange); }
.status-risco { background: var(--red-bg); color: var(--red); }

.prio-urgente { background: var(--red-bg); color: var(--red); }
.prio-alta { background: var(--orange-bg); color: var(--orange); }
.prio-media { background: var(--yellow-bg); color: var(--yellow); }
.prio-baixa { background: var(--green-bg); color: var(--green); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #5558e8; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---- Progress Bars ---- */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ---- Score Ring ---- */
.score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring-label {
  position: absolute;
  text-align: center;
}
.score-ring-label .score-val { font-size: 22px; font-weight: 800; }
.score-ring-label .score-sub { font-size: 10px; color: var(--text-muted); }

/* ---- Filters ---- */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--border-active); color: var(--text-primary); }
.filter-select option { background: var(--bg-surface); }

/* ---- Timeline ---- */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 20px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { display: flex; gap: 16px; margin-bottom: 20px; position: relative; }
.timeline-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  border: 2px solid var(--bg-card);
  z-index: 1;
}
.timeline-content { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.timeline-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.timeline-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.timeline-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ---- Kanban ---- */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kanban-col-title { font-size: 13px; font-weight: 700; }
.kanban-count { background: var(--bg-card); border: 1px solid var(--border); border-radius: 99px; padding: 2px 8px; font-size: 11px; font-weight: 600; color: var(--text-muted); }

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.task-card:hover { border-color: rgba(99,102,241,0.3); background: var(--bg-card-hover); }
.task-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.task-meta { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }

/* ---- Calendar ---- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-name { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 8px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-day {
  min-height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  transition: border-color 0.15s;
}
.cal-day.other-month { opacity: 0.35; }
.cal-day.today { border-color: var(--accent); }
.cal-day-num { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.cal-day.today .cal-day-num { color: var(--accent-light); }
.cal-event {
  font-size: 10.5px;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ---- Score ---- */
.score-criteria { display: flex; flex-direction: column; gap: 12px; }
.criteria-item { }
.criteria-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.criteria-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.criteria-val { font-size: 13px; font-weight: 700; color: var(--text-primary); }

/* ---- Opportunity Cards ---- */
.opp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all 0.2s;
  cursor: pointer;
}
.opp-card:hover { border-color: var(--border-active); background: var(--bg-card-hover); transform: translateY(-1px); }
.opp-impact { font-size: 22px; font-weight: 800; color: var(--green); }

/* ---- Alert Cards ---- */
.alert-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.alert-card:hover { background: var(--bg-card-hover); }
.alert-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.alert-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.alert-desc { font-size: 12.5px; color: var(--text-secondary); }
.alert-card.lido { opacity: 0.55; }

/* ---- IA Chat ---- */
.ia-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  max-height: 700px;
}
.ia-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ia-msg { display: flex; gap: 10px; }
.ia-msg.user { flex-direction: row-reverse; }
.ia-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.6;
}
.ia-bubble.bot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.ia-bubble.user-msg {
  background: var(--accent);
  color: white;
}
.ia-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.ia-input-area {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.ia-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}
.ia-input:focus { border-color: var(--border-active); }
.ia-input::placeholder { color: var(--text-muted); }

.ia-chip {
  display: inline-flex;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.ia-chip:hover { border-color: var(--border-active); color: var(--accent-light); background: var(--accent-glow); }

/* ---- Divider ---- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }
.empty-state-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 2px; background: var(--bg-card); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; width: fit-content; }
.tab-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: all 0.15s;
}
.tab-btn.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}
.tab-btn:not(.active):hover { color: var(--text-primary); background: var(--bg-card-hover); }

/* ---- Sparkline ---- */
.sparkline { display: flex; align-items: flex-end; gap: 2px; height: 32px; }
.spark-bar { flex: 1; border-radius: 2px; min-width: 4px; transition: opacity 0.15s; }
.spark-bar:hover { opacity: 0.8; }

/* ---- Tooltip ---- */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-wrap:hover .tooltip-box { opacity: 1; pointer-events: auto; transform: translateY(0); }
.tooltip-box {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s;
  z-index: 999;
}

/* ---- Ranking List ---- */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ranking-item:last-child { border-bottom: none; }
.ranking-num { font-size: 12px; font-weight: 700; color: var(--text-muted); width: 20px; flex-shrink: 0; }
.ranking-name { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.ranking-val { font-size: 13px; font-weight: 700; }

/* ---- Page Transitions ---- */
.page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-260px); width: 260px; }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  #main { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .search-box { display: none; }

  /* Header mais compacto — evita quebrar/estourar em telas estreitas */
  #header { padding: 0 14px; gap: 8px; }
  .header-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-actions { gap: 6px; }
  .icon-btn { width: 32px; height: 32px; }

  #page-content { padding: 14px; }

  /* Tabelas: a maioria das páginas já envolve <table> num wrapper com
     overflow-x:auto, mas nem todas — isso garante rolagem horizontal
     em qualquer tabela que sobrar, sem precisar editar cada página */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modais mais enxutos em telas pequenas */
  .modal { padding: 18px; }
  .modal-title { font-size: 16px; }
}
@media (max-width: 640px) {
  /* A maioria dos grids do app usa grid-template-columns inline (não classes) —
     isso força qualquer grid de 2+ colunas a empilhar em 1 coluna no celular,
     cobrindo o app inteiro sem precisar editar cada página individualmente. */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
  #page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--border-active); }
.form-select option { background: var(--bg-surface); }
.form-textarea { resize: vertical; min-height: 80px; font-family: inherit; }

/* ---- Misc ---- */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-orange { color: var(--orange); }
.text-accent { color: var(--accent-light); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* Dashboard v2 — segue o Design System (sem paleta própria desde 19/10/2026) */
.dash-v2 .kpi-value { font-variant-numeric: tabular-nums; }

/* Assinatura: quando um KPI muda de valor numa atualização (manual ou
   automática), o card pisca uma vez na direção da mudança — reforça
   visualmente que o dado é vivo, não só decoração. */
.dash-v2 .kpi-flash { display: contents; }

.dash-v2 .kpi-flash-up {
  animation: dashFlashUp 1.6s ease-out;
}
.dash-v2 .kpi-flash-down {
  animation: dashFlashDown 1.6s ease-out;
}
@keyframes dashFlashUp {
  0%   { background: var(--green-bg); border-color: var(--green); }
  100% { background: var(--bg-card); border-color: var(--border); }
}
@keyframes dashFlashDown {
  0%   { background: var(--red-bg); border-color: var(--red); }
  100% { background: var(--bg-card); border-color: var(--border); }
}
@media (prefers-reduced-motion: reduce) {
  .dash-v2 .kpi-flash-up, .dash-v2 .kpi-flash-down { animation: none; }
}

/* Dashboard — resumo do gráfico Vendas por Dia & Comissão GLR */
.dvd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 4px 0 16px; }
.dvd-kpis:empty { display: none; }
.dvd-kpi { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card-hover); }
.dvd-rot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.dvd-rot i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dvd-kpi b { font-size: 18px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dvd-kpi small { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   DESIGN SYSTEM v2 — componentes (19/10/2026)
   Camada única por cima dos estilos antigos: muda a aparência de
   todo o produto sem tocar na lógica das telas. Regras:
   • superfícies neutras + 1 destaque (--accent); cor semântica só
     em status/variação;
   • bordas finas, quase sem sombra, cantos 14px nos cards;
   • rótulos em caixa normal, números grandes e tabulares.
   ============================================================ */

body { background: var(--bg-base); letter-spacing: -0.005em; }
::selection { background: var(--accent-glow); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar { background: var(--bg-surface); border-right: 1px solid var(--border); width: var(--sidebar-w); transition: width .22s var(--ease), transform .3s var(--ease); scrollbar-width: thin; }
.sidebar-logo { flex-direction: row !important; align-items: center !important; gap: 10px !important; padding: 16px 16px 14px !important; border-bottom: none; }
.sidebar-logo img { width: 36px !important; height: 36px !important; border-radius: 10px; flex: none; }
.logo-text { text-align: left !important; min-width: 0; }
.logo-text strong { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.logo-text span { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--text-muted); white-space: nowrap; }
.sidebar-section { padding: 6px 10px 2px; }
.sidebar-section-title { font-size: 11px; font-weight: 550; text-transform: none; letter-spacing: 0; color: var(--text-muted); padding: 10px 10px 6px; white-space: nowrap; }
.nav-item { height: 34px; padding: 0 10px; gap: 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 2px; white-space: nowrap; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.nav-item.active { background: var(--accent-glow); color: var(--accent-light); box-shadow: none; font-weight: 600; }
.nav-item.active .nav-icon { color: var(--accent-light); opacity: 1; }
.nav-icon { width: 17px; height: 17px; opacity: .75; stroke-width: 1.8; }
.nav-badge { font-size: 10.5px; font-weight: 600; padding: 1px 7px; background: var(--bg-subtle); color: var(--text-secondary); }
.nav-badge.green { background: var(--green-bg); color: var(--green); }
.sidebar-footer { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.user-card { padding: 8px; border-radius: 10px; }
.user-card:hover { background: var(--bg-subtle); }
.user-avatar { width: 32px; height: 32px; background: var(--accent); font-size: 12px; font-weight: 650; }
.sb-recolher { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: none; background: none; border-radius: 8px; color: var(--text-muted); font-size: 12.5px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.sb-recolher:hover { background: var(--bg-subtle); color: var(--text-primary); }
.sb-recolher svg { flex: none; transition: transform .22s var(--ease); }

/* Sidebar recolhida (desktop) — só ícones, com dica ao passar o mouse */
@media (min-width: 901px) {
  body.sidebar-mini { --sidebar-w: var(--sidebar-mini-w); }
  body.sidebar-mini #sidebar { overflow-x: hidden; }
  body.sidebar-mini .logo-text, body.sidebar-mini .sidebar-section-title, body.sidebar-mini .nav-badge, body.sidebar-mini .user-info, body.sidebar-mini .sb-txt { display: none !important; }
  body.sidebar-mini .sidebar-logo { justify-content: center; padding: 16px 0 14px !important; }
  body.sidebar-mini .sidebar-section { padding: 4px 12px; border-top: 1px solid var(--border); }
  body.sidebar-mini .sidebar-section:first-of-type { border-top: none; }
  body.sidebar-mini .nav-item { font-size: 0; justify-content: center; padding: 0; height: 38px; }
  body.sidebar-mini .user-card, body.sidebar-mini .sb-recolher, body.sidebar-mini .sidebar-footer > button { justify-content: center; padding: 0 !important; font-size: 0 !important; }
  body.sidebar-mini .sb-recolher svg { transform: rotate(180deg); }
}
.sb-dica { position: fixed; z-index: 400; background: var(--text-primary); color: var(--bg-surface); font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 7px; pointer-events: none; white-space: nowrap; transform: translateY(-50%); box-shadow: var(--shadow-sm); }

/* ── Header ──────────────────────────────────────────────── */
#header { height: var(--header-h); background: color-mix(in srgb, var(--bg-base) 82%, transparent); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--border); padding: 0 28px; gap: 14px; }
.header-titulos { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.header-crumb { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-crumb:empty { display: none; }
.header-title { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; height: 36px; padding: 0 12px; width: 300px; color: var(--text-muted); }
.search-box:focus-within { border-color: var(--border-active); box-shadow: var(--ring); }
.search-box input { font-size: 13px; }
.header-actions { gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--text-secondary); }
.icon-btn:hover { background: var(--bg-surface); border-color: var(--border); color: var(--text-primary); }
.notif-dot { border-color: var(--bg-base); }
#page-content { padding: 28px 32px 48px; max-width: 1680px; width: 100%; margin: 0 auto; }

/* ── Tipografia de página ────────────────────────────────── */
.section-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.section-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.section-header { margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-xs); }
.card-hover:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border-strong); background: var(--bg-card); }
.opp-card, .alert-card, .task-card, .timeline-content, .kanban-col, .cal-day { border-color: var(--border); box-shadow: var(--shadow-xs); }
.opp-card:hover, .task-card:hover { transform: none; border-color: var(--border-strong); background: var(--bg-card); box-shadow: var(--shadow-sm); }

/* ── KPI ─────────────────────────────────────────────────── */
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.kpi-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); background: var(--bg-card); }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); text-transform: none; letter-spacing: 0; margin-bottom: 8px; }
.kpi-value { font-family: var(--font-num); font-size: 26px; font-weight: 650; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.kpi-delta { font-size: 12px; font-weight: 600; }
.kpi-delta.up, .kpi-delta.down { display: inline-flex; width: fit-content; padding: 2px 8px; border-radius: var(--radius-pill); }
.kpi-delta.up { background: var(--green-bg); }
.kpi-delta.down { background: var(--red-bg); }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-subtle) !important; color: var(--text-secondary); margin-bottom: 12px; }

/* ── Botões ──────────────────────────────────────────────── */
.btn { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 600; font-family: inherit; letter-spacing: -0.005em; justify-content: center; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(16,19,28,.12), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Campos ──────────────────────────────────────────────── */
.form-input, .form-select, .form-textarea, .form-control, .filter-select, select.form-input {
  background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text-primary); font-size: 13px; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.form-input, .form-select, .form-control, .filter-select { min-height: 36px; padding: 0 12px; }
.form-textarea { padding: 10px 12px; }
.form-input:focus, .form-select:focus, .form-textarea:focus, .form-control:focus, .filter-select:focus { border-color: var(--border-active); box-shadow: var(--ring); }
.form-label { font-size: 12.5px; font-weight: 550; color: var(--text-secondary); text-transform: none; letter-spacing: 0; }

/* ── Tabelas ─────────────────────────────────────────────── */
table { font-size: 13px; }
thead th { font-size: 11.5px; font-weight: 550; color: var(--text-muted); text-transform: none; letter-spacing: 0; padding: 10px 14px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
thead th:first-child { border-top-left-radius: 10px; } thead th:last-child { border-top-right-radius: 10px; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--bg-card-hover); }
body.light tbody tr:hover { background: #fafbfc; }
tbody td { padding: 12px 14px; font-variant-numeric: tabular-nums; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { padding: 2px 9px; font-size: 11.5px; font-weight: 600; border-radius: var(--radius-pill); letter-spacing: 0; }
.status-ativo { background: var(--accent-glow); color: var(--accent-light); }

/* ── Abas (controle segmentado) ──────────────────────────── */
.tabs { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.tab-btn { height: 30px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--text-secondary); font-family: inherit; }
.tab-btn.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); font-weight: 600; }
.tab-btn:not(.active):hover { background: transparent; color: var(--text-primary); }

/* ── Modal, tooltip, vazio, divisor ──────────────────────── */
.modal-overlay { background: rgba(10,12,18,.45); backdrop-filter: blur(3px); }
.modal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 26px; }
.modal-title { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.tooltip-box { background: var(--text-primary); color: var(--bg-surface); border: none; font-size: 12px; }
.empty-state { padding: 48px 24px; }
.empty-state-title { color: var(--text-primary); font-weight: 600; }
.progress-bar { background: var(--bg-subtle); }

/* ── Skeleton (carregando) ───────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-card-hover) 50%, var(--bg-subtle) 75%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; border-radius: 8px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Página ──────────────────────────────────────────────── */
.page { animation: fadeIn .22s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { width: 272px; box-shadow: none; transform: translateX(-100%); }
  #sidebar.open { transform: none; box-shadow: var(--shadow); }
  #sidebar-toggle { display: flex !important; }
  #header { padding: 0 12px; }
  #page-content { padding: 16px 14px 40px; }
  .sb-recolher { display: none; }
  .btn { height: 38px; } .btn-sm { height: 34px; }
}

/* ── Dashboard executivo (Design System v2) ─────────────── */
.dx-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dx-h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; color: var(--text-primary); }
.dx-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.dx-acoes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dx-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.dx-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.dx-kpis { margin-bottom: 14px; }
.dx-kpis .kpi-flash { display: contents; }
.dx-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dx-kpi-ic { color: var(--text-muted); display: inline-flex; margin-top: -1px; }
.dx-kpi-sub { font-size: 12px; color: var(--text-muted); }
.dx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); margin-bottom: 22px; overflow: hidden; }
.dx-stat { display: flex; flex-direction: column; gap: 2px; padding: 13px 18px; border-right: 1px solid var(--border); min-width: 0; }
.dx-stat:last-child { border-right: none; }
.dx-stat-rot { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-stat b { font-size: 18px; font-weight: 650; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.dx-stat-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-pos { color: var(--green) !important; } .dx-neg { color: var(--red) !important; }
.dx-linha { display: grid; gap: 16px; margin-bottom: 16px; }
.dx-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dx-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dx-bloco { margin-bottom: 16px; }
.dx-canal { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.dx-canal-graf { width: 100%; max-width: 210px; }
.dx-canal #dash-canal-legenda { width: 100%; }
.dx-status { display: flex; gap: 20px; align-items: center; }
.dx-status-graf { width: 150px; flex: none; }
.dx-status > div:last-child { flex: 1; min-width: 0; }
.dx-leg { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.dx-leg:last-child { border-bottom: none; }
.dx-leg i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dx-leg span { flex: 1; } .dx-leg b { color: var(--text-primary); font-variant-numeric: tabular-nums; } .dx-leg small { color: var(--text-muted); width: 36px; text-align: right; }
.dx-lista { display: flex; flex-direction: column; margin: 0 -8px; }
.dx-li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.dx-li + .dx-li { border-top: 1px solid var(--border); border-radius: 0; }
.dx-li:hover { background: var(--bg-card-hover); }
.dx-li-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dx-li-txt b { font-size: 13.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-li-txt span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-li-txt em { font-style: normal; font-weight: 600; }
.dx-li-val { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dx-li-val small { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.dx-pos-n { width: 22px; height: 22px; border-radius: 7px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 11.5px; font-weight: 650; display: grid; place-items: center; flex: none; }
.dx-av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-glow); color: var(--accent-light); font-size: 12px; font-weight: 650; display: grid; place-items: center; flex: none; }
.dx-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dx-dot-neg { background: var(--red); } .dx-dot-ate { background: var(--yellow); } .dx-dot-pos { background: var(--green); } .dx-dot-neu { background: var(--accent); }
.dx-vazio { padding: 26px 8px; text-align: center; font-size: 13px; color: var(--text-muted); }
#dx-carteira thead th:first-child, #dx-carteira thead th:last-child { border-radius: 0; }
@media (max-width: 1100px) { .dx-2-1, .dx-1-1 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .dx-stat { border-right: none; border-bottom: 1px solid var(--border); } .dx-status { flex-direction: column; } }

/* ── ADS Shopee: setores (abas) e visual neutro (Design System v2) ── */
.ag-abas { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 6px 0 18px; }
.ag-abas-lista { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ag-aba { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 12px; font: inherit; font-size: 13.5px; font-weight: 550; color: var(--text-secondary); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: color .15s, border-color .15s; }
.ag-aba:hover { color: var(--text-primary); }
.ag-aba.on { color: var(--text-primary); border-bottom-color: var(--accent); font-weight: 600; }
.ag-aba-n { font-size: 11px; font-weight: 650; background: var(--red-bg); color: var(--red); padding: 1px 7px; border-radius: 99px; }
.ag-abas-per { margin: 0 0 8px; }
#ag-root .ag-periodos-kpi { display: none !important; }
.ag-setor { animation: fadeIn .2s var(--ease); }
.ag-resumo-pend { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); padding: 14px 18px; margin-bottom: 18px; }
.ag-resumo-ok { color: var(--text-muted); font-size: 13px; }
.ag-resumo-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.ag-resumo-li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.ag-resumo-li:hover .ag-resumo-t { color: var(--accent-light); }
.ag-resumo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); flex: none; }
.ag-resumo-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); font-weight: 550; }
.ag-resumo-tag { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
#ag-root .ag-topbar { border-left: 1px solid var(--border); box-shadow: var(--shadow-xs); }
#ag-root .ag-kpi { background: var(--bg-card); box-shadow: var(--shadow-xs); }
#ag-root .ag-kpi::before { display: none; }
#ag-root .ag-precisa-item { border-left-width: 2px; background: var(--bg-card); }
#ag-root .ag-tl-item, #ag-root .ag-log-item { border-left-width: 2px; }
#ag-root .ag-sec-titulo { font-weight: 650; letter-spacing: -0.01em; }
#ag-root .ag-hud-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
#ag-root .ag-hud-value { font-family: var(--font-num); font-weight: 650; letter-spacing: -0.02em; }
#ag-root .ag-contagem { background: var(--red-bg); color: var(--red); font-weight: 650; }
#ag-root .ag-nada { color: var(--text-secondary); background: var(--bg-card); border-color: var(--border); }
#ag-root .ag-hud-card, #ag-desempenho .ag-hud-card { background: var(--bg-card); box-shadow: var(--shadow-xs); }
#ag-root .ag-hud-card::before { display: none; }

/* Perfil do cliente — conta comissão GLR por conta */
.conta-comissao { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; row-gap: 1px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--green-bg); cursor: pointer; }
.conta-comissao input { accent-color: var(--green); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.conta-comissao span { font-size: 12px; font-weight: 600; color: var(--green); }
.conta-comissao small { grid-column: 2; font-size: 11px; color: var(--text-muted); }
.conta-sem-comissao .conta-comissao { background: var(--bg-subtle); }
.conta-sem-comissao .conta-comissao span { color: var(--text-secondary); }
