:root {
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-elevated: #222535;
  --bg-hover: #2a2d3e;
  --border: rgba(255,255,255,0.07);
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --gold: #f59e0b;
  --green: #10b981;
  --blue: #3b82f6;
  --red: #ef4444;
  --orange: #f97316;
  --text: #e2e8f0;
  --text-dim: #64748b;
  --text-bright: #f8fafc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }

/* Layout principal */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--bg-card);
  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; }
.sidebar-logo { padding: 20px 16px 12px; border-bottom: 1px solid var(--border); }
.sidebar-logo .logo-text { font-size: 16px; font-weight: 800; color: var(--purple-light); }
.sidebar-logo .logo-sub { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-section { padding: 16px 8px 4px; font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding-left: 12px; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; margin: 1px 8px; cursor: pointer; font-size: 13px; color: var(--text-dim);
  transition: background 0.15s, color 0.15s; }
.sidebar-item:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-item.active { background: rgba(124,58,237,0.15); color: var(--purple-light); font-weight: 600; }
.sidebar-item .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-item .badge-count { margin-left: auto; background: var(--red); color: white;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; }

/* Main content */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

/* Topbar */
.topbar { height: var(--topbar-h); background: var(--bg-card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 50; }
.topbar .page-title { font-size: 16px; font-weight: 700; }
.topbar .breadcrumb { font-size: 12px; color: var(--text-dim); }
.topbar .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar .admin-badge { background: rgba(124,58,237,0.2); color: var(--purple-light);
  padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; }

/* Content area */
.content { padding: 24px; flex: 1; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; position: relative; overflow: hidden; }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.kpi-card.purple::before { background: var(--purple); }
.kpi-card.blue::before   { background: var(--blue); }
.kpi-card.green::before  { background: var(--green); }
.kpi-card.gold::before   { background: var(--gold); }
.kpi-card.red::before    { background: var(--red); }
.kpi-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.kpi-value { font-size: 32px; font-weight: 900; color: var(--text-bright); line-height: 1; }
.kpi-sub { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.kpi-icon { position: absolute; top: 16px; right: 16px; font-size: 24px; opacity: 0.4; }

/* Data cards */
.data-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 20px; overflow: hidden; }
.data-card-header { padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; }
.data-card-title { font-size: 14px; font-weight: 700; }
.data-card-body { padding: 20px; }

/* Tabelas */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 14px; color: var(--text-dim);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table tr.clickable { cursor: pointer; }
.data-table .avatar-cell { display: flex; align-items: center; gap: 10px; }
.data-table .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--purple);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  flex-shrink: 0; }

/* Score bar inline */
.score-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); width: 80px; display: inline-block; vertical-align: middle; }
.score-bar-fill { height: 100%; border-radius: 3px; }

/* Status badges */
.status { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; white-space: nowrap; }
.status.active    { background: rgba(16,185,129,0.15); color: #34d399; }
.status.pending   { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status.risk      { background: rgba(239,68,68,0.15);  color: #f87171; }
.status.completed { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status.assigned  { background: rgba(124,58,237,0.15); color: #a78bfa; }
.status.received  { background: rgba(100,116,139,0.15);color: #94a3b8; }
.status.enrolled  { background: rgba(16,185,129,0.2);  color: #34d399; font-size: 12px; }
.status.approved  { background: rgba(16,185,129,0.15); color: #34d399; }
.status.rejected  { background: rgba(239,68,68,0.15);  color: #f87171; }

/* Filtros/search */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-input { background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; color: var(--text); font-size: 13px; min-width: 220px; }
.search-input:focus { outline: none; border-color: var(--purple); }
.filter-select { background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 13px; cursor: pointer; }

/* Buttons */
.btn { border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.97); }
.btn-primary  { background: var(--purple); color: white; }
.btn-success  { background: var(--green);  color: white; }
.btn-danger   { background: var(--red);    color: white; }
.btn-ghost    { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:hover { opacity: 0.85; }

/* Profile panel (slide-in) */
.profile-panel { position: fixed; top: 0; right: -680px; width: 680px; bottom: 0;
  background: var(--bg-card); border-left: 1px solid var(--border); z-index: 200;
  transition: right 0.3s ease; overflow-y: auto; }
.profile-panel.open { right: 0; }
.panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 190;
  display: none; }
.panel-overlay.open { display: block; }
.panel-header { padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0;
  background: var(--bg-card); z-index: 1; }
.panel-close { background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; }

/* Radar (small, admin) */
.radar-sm { display: flex; justify-content: center; }

/* Score breakdown */
.score-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score-item { background: var(--bg-elevated); border-radius: 8px; padding: 12px; }
.score-item-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.score-item-value { font-size: 22px; font-weight: 900; }

/* Alert risk item */
.risk-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); border-radius: 10px; margin-bottom: 8px; }
.risk-item .risk-icon { font-size: 20px; flex-shrink: 0; }
.risk-item .risk-reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.risk-tag { font-size: 11px; background: rgba(239,68,68,0.15); color: #f87171;
  padding: 2px 8px; border-radius: 99px; }

/* Timeline de evolução */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content:''; position: absolute; left: 6px; top: 0; bottom: 0;
  width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-dot { position: absolute; left: -17px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--purple); border: 2px solid var(--bg-card); }
.timeline-date { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.timeline-content { font-size: 13px; }

/* DISC bars */
.disc-bar-group { display: flex; flex-direction: column; gap: 8px; }
.disc-bar-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.disc-bar-item .disc-label { width: 20px; font-weight: 800; }
.disc-bar-item .disc-bar { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.08); }
.disc-bar-item .disc-fill { height: 100%; border-radius: 5px; }
.disc-D { background: #ef4444; }
.disc-I { background: #f59e0b; }
.disc-S { background: #10b981; }
.disc-C { background: #3b82f6; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 4px; }
.funnel-step { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 8px; background: var(--bg-elevated); }
.funnel-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.06); }
.funnel-fill { height: 100%; border-radius: 4px; background: var(--blue); }
.funnel-count { font-size: 18px; font-weight: 800; width: 36px; text-align: right; }
.funnel-label { font-size: 12px; color: var(--text-dim); width: 90px; }
.funnel-xp { font-size: 11px; color: var(--gold); width: 60px; text-align: right; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 16px; font-size: 13px; color: var(--text-dim); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.tab.active { color: var(--purple-light); border-bottom-color: var(--purple); font-weight: 600; }
.tab:hover { color: var(--text); }

/* Modais */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; max-width: 560px; width: 100%; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; }

/* Relatório imprimível */
@media print {
  /* Override dark CSS variables to light theme */
  :root {
    --bg: #ffffff !important;
    --bg-card: #ffffff !important;
    --bg-elevated: #f3f4f6 !important;
    --bg-hover: #e5e7eb !important;
    --border: #d1d5db !important;
    --text: #111827 !important;
    --text-dim: #6b7280 !important;
    --text-bright: #030712 !important;
    --purple: #7c3aed !important;
    --purple-light: #6d28d9 !important;
  }

  /* Hide all admin UI */
  .sidebar, .topbar, .btn, .btn-primary, .btn-success, .btn-danger, .btn-ghost,
  .filter-bar, .profile-panel, .panel-overlay, .modal-overlay,
  .page-header .btn, .tabs, .admin-toast, .no-print { display: none !important; }

  /* Reset layout */
  html, body { background: #fff !important; color: #111827 !important; }
  .layout { display: block !important; }
  .main { margin-left: 0 !important; padding: 0 !important; }
  .page-content { padding: 0 !important; }

  /* Hide non-report content */
  #listaCard, .page-header { display: none !important; }

  /* Show only report area */
  #reportArea { display: block !important; }

  /* Report container */
  .report-container {
    background: #fff !important;
    border-radius: 0 !important;
    padding: 20px !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    color: #111827 !important;
  }

  /* Report header */
  .report-header { border-bottom: 2px solid #d1d5db !important; }
  .report-title { color: #030712 !important; }
  .report-subtitle { color: #6b7280 !important; }

  /* Meta grid */
  .report-meta-item { background: #f3f4f6 !important; border: 1px solid #e5e7eb !important; }
  .report-meta-label { color: #6b7280 !important; }
  .report-meta-value { color: #111827 !important; }

  /* Section titles */
  .report-section-title { color: #6d28d9 !important; border-bottom-color: #d1d5db !important; }
  .report-section { break-inside: avoid; }

  /* Score breakdown */
  .score-breakdown { grid-template-columns: 1fr 1fr !important; }
  .score-item { background: #f3f4f6 !important; border: 1px solid #e5e7eb !important; }
  .score-item-label { color: #6b7280 !important; }
  .score-item-value { color: #111827 !important; }

  /* Component bars */
  .component-bar-track { background: #e5e7eb !important; }
  .component-bar-label { color: #111827 !important; }
  .component-bar-value { color: #111827 !important; }

  /* DISC bars */
  .disc-bar { background: #e5e7eb !important; }
  .disc-bar-item { color: #111827 !important; }

  /* Score bar */
  .score-bar { background: #e5e7eb !important; }

  /* Data cards */
  .data-card {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    break-inside: avoid;
  }
  .data-card-title { color: #6b7280 !important; }
  .data-card-value { color: #111827 !important; }

  /* Timeline */
  .timeline::before { background: #d1d5db !important; }
  .timeline-dot { background: #7c3aed !important; border-color: #fff !important; }
  .timeline-date { color: #6b7280 !important; }

  /* Status badges — make them print-safe */
  .status { border: 1px solid currentColor !important; }
  .status.active    { background: #d1fae5 !important; color: #065f46 !important; }
  .status.pending   { background: #fef3c7 !important; color: #92400e !important; }
  .status.risk      { background: #fee2e2 !important; color: #991b1b !important; }
  .status.completed { background: #dbeafe !important; color: #1e40af !important; }

  /* Tables */
  table { border-collapse: collapse !important; }
  th, td { border: 1px solid #e5e7eb !important; color: #111827 !important; }
  th { background: #f3f4f6 !important; }
  tr:nth-child(even) td { background: #f9fafb !important; }

  /* Page break rules */
  .report-section, .data-card { page-break-inside: avoid; }
  .report-header { page-break-after: avoid; }

  /* SVG radar — ensure visible */
  svg text { fill: #111827 !important; }
  svg line, svg polygon, svg polyline { stroke: #d1d5db !important; }
}

/* Charts SVG */
.chart-bar-group { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.chart-bar { background: linear-gradient(180deg, var(--purple), #4c1d95); border-radius: 4px 4px 0 0;
  flex: 1; transition: height 0.5s ease; min-width: 20px; position: relative; cursor: pointer; }
.chart-bar:hover { opacity: 0.8; }
.chart-bar .bar-label { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: var(--text-dim); white-space: nowrap; }
.chart-bar .bar-value { position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; white-space: nowrap; }

/* Toast */
.admin-toast { position: fixed; top: 20px; right: 20px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-left: 3px solid var(--green); color: var(--text);
  padding: 12px 18px; border-radius: 10px; font-size: 13px; z-index: 9999;
  animation: toastIn 0.3s ease; }
@keyframes toastIn { from{transform:translateX(20px);opacity:0} to{transform:translateX(0);opacity:1} }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 3px; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.col-60-40 { display: grid; grid-template-columns: 60fr 40fr; gap: 20px; }
.col-50-50 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Hability bars horizontal */
.hab-bar-group { display: flex; flex-direction: column; gap: 10px; }
.hab-bar-item { display: flex; align-items: center; gap: 10px; }
.hab-bar-label { font-size: 12px; color: var(--text-dim); width: 130px; flex-shrink: 0; }
.hab-bar-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; }
.hab-bar-fill { height: 100%; border-radius: 4px; background: var(--purple); transition: width 0.6s ease; }
.hab-bar-pct { font-size: 12px; font-weight: 700; width: 36px; text-align: right; }

/* Panel tabs */
.panel-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.panel-tab { padding: 10px 14px; font-size: 12px; color: var(--text-dim); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; white-space: nowrap; }
.panel-tab.active { color: var(--purple-light); border-bottom-color: var(--purple); font-weight: 600; }
.panel-content { padding: 20px; }
.panel-section { margin-bottom: 20px; }
.panel-section-title { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; font-weight: 600; }

/* Misc */
.text-muted { color: var(--text-dim); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-gold { color: var(--gold); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple-light); }
.fw-bold { font-weight: 700; }
.fw-900 { font-weight: 900; }
.fs-sm { font-size: 12px; }
.fs-xs { font-size: 11px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Mission card (instagram approval) */
.approval-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.approval-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.approval-card-title { font-size: 14px; font-weight: 700; }
.approval-card-xp { font-size: 13px; font-weight: 800; color: var(--gold); }
.approval-card-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.approval-card-body { background: rgba(255,255,255,0.03); border-radius: 8px; padding: 12px; margin-bottom: 12px; font-size: 13px; color: var(--text); border-left: 3px solid var(--border); }
.approval-card-actions { display: flex; gap: 8px; }

/* Funnel visual (horizontal) */
.funnel-horizontal { display: flex; align-items: center; gap: 0; margin-bottom: 20px; }
.funnel-stage { flex: 1; background: var(--bg-elevated); padding: 16px 12px; text-align: center;
  border-right: 1px solid var(--border); position: relative; }
.funnel-stage:first-child { border-radius: 10px 0 0 10px; }
.funnel-stage:last-child { border-radius: 0 10px 10px 0; border-right: none; }
.funnel-stage-count { font-size: 28px; font-weight: 900; color: var(--text-bright); }
.funnel-stage-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.funnel-stage-pct { font-size: 12px; color: var(--green); font-weight: 700; margin-top: 2px; }
.funnel-arrow { font-size: 18px; color: var(--text-dim); flex-shrink: 0; margin: 0 -1px; z-index: 1; }

/* Report print layout */
.report-container { background: var(--bg-card); border-radius: 12px; padding: 32px; max-width: 900px; }
.report-header { border-bottom: 2px solid var(--border); padding-bottom: 20px; margin-bottom: 24px; }
.report-title { font-size: 20px; font-weight: 900; color: var(--text-bright); }
.report-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.report-meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.report-meta-item { background: var(--bg-elevated); border-radius: 8px; padding: 10px 14px; }
.report-meta-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.report-meta-value { font-size: 15px; font-weight: 700; margin-top: 3px; }
.report-section { margin-bottom: 28px; }
.report-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--purple-light); margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.component-bars { display: flex; flex-direction: column; gap: 8px; }
.component-bar-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.component-bar-label { width: 140px; flex-shrink: 0; }
.component-bar-track { flex: 1; height: 10px; background: rgba(255,255,255,0.06); border-radius: 5px; }
.component-bar-fill { height: 100%; border-radius: 5px; }
.component-bar-value { width: 40px; text-align: right; font-weight: 700; font-size: 12px; }

/* Inline select in table */
.inline-select { background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px; color: var(--text); font-size: 12px; cursor: pointer; }
.inline-select:focus { outline: none; border-color: var(--purple); }

/* ─── TABELAS SEMPRE COM SCROLL HORIZONTAL ──── */
.data-card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ─── HAMBURGER BUTTON ──────────────────────── */
.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--bg-elevated); }

/* Overlay para fechar sidebar no mobile */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  display: none;
}
.sidebar-overlay.open { display: block; }
.sidebar.mobile-open {
  display: flex !important;
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
}

/* ─── RESPONSIVE ────────────────────────────── */
@media (max-width: 1024px) {
  .col-60-40 { grid-template-columns: 1fr; }
  .col-50-50 { grid-template-columns: 1fr; }
  .grid-2    { grid-template-columns: 1fr; }
  .grid-3    { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Sidebar oculta por padrão, abre via hamburger */
  .sidebar { display: none; }
  .main { margin-left: 0; }

  /* Hamburger visível */
  .hamburger-btn { display: inline-flex; align-items: center; }

  /* Topbar */
  .topbar { padding: 0 12px; height: auto; min-height: var(--topbar-h); flex-wrap: wrap; gap: 8px; }
  .topbar .breadcrumb { display: none; }
  .topbar .topbar-right { gap: 8px; flex-wrap: wrap; margin-left: auto; }
  .topbar .admin-badge { font-size: 11px; padding: 3px 8px; }

  /* Conteúdo */
  .content { padding: 16px; }

  /* KPI grid 2 colunas */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-value { font-size: 26px; }
  .kpi-card { padding: 14px; }
  .kpi-icon { font-size: 18px; top: 12px; right: 12px; }

  /* Grids */
  .grid-3 { grid-template-columns: 1fr; }
  .score-breakdown { grid-template-columns: 1fr 1fr; }

  /* Tabelas */
  .data-table { font-size: 12px; min-width: 480px; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .score-bar { width: 50px; }

  /* Filtros */
  .filter-bar { gap: 8px; }
  .search-input { min-width: 0; flex: 1; }
  .filter-select { font-size: 12px; }

  /* Profile panel — largura total no mobile */
  .profile-panel { width: min(680px, 100vw); right: -100vw; }
  .profile-panel.open { right: 0; }

  /* Funnel horizontal → scroll */
  .funnel-horizontal { overflow-x: auto; padding-bottom: 4px; }

  /* Modal */
  .modal { padding: 16px; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 90vh; }

  /* Panel tabs scroll */
  .panel-tabs { overflow-x: auto; scrollbar-width: none; padding: 0 12px; }
  .panel-tabs::-webkit-scrollbar { display: none; }
  .panel-content { padding: 16px; }

  /* Hab bars */
  .hab-bar-label { width: 90px; font-size: 11px; }
  .component-bar-label { width: 100px; font-size: 11px; }

  /* Approval cards */
  .approval-card-actions { flex-wrap: wrap; }
  .approval-card-meta { flex-wrap: wrap; gap: 6px; }

  /* Report */
  .report-container { padding: 16px; }
  .report-meta-grid { grid-template-columns: 1fr 1fr; }

  /* Admin toast — canto inferior mobile */
  .admin-toast { top: auto; bottom: 16px; right: 16px; left: 16px; font-size: 13px; }
}

@media (max-width: 480px) {
  /* KPI 2 colunas compactas */
  .kpi-grid { gap: 8px; }
  .kpi-value { font-size: 22px; }
  .kpi-label { font-size: 10px; }
  .kpi-sub { font-size: 10px; }

  /* Botões da topbar ocultos — economiza espaço */
  .topbar-right .btn { display: none; }
  .topbar-right .btn-export-mobile { display: inline-flex; } /* botão opcional explícito */

  /* Score breakdown 1 coluna */
  .score-breakdown { grid-template-columns: 1fr; }

  /* Funnel horizontal vira vertical */
  .funnel-horizontal { flex-direction: column; overflow-x: visible; }
  .funnel-stage { border-right: none; border-bottom: 1px solid var(--border); border-radius: 0; }
  .funnel-stage:first-child { border-radius: 8px 8px 0 0; }
  .funnel-stage:last-child  { border-bottom: none; border-radius: 0 0 8px 8px; }

  /* Report */
  .report-meta-grid { grid-template-columns: 1fr; }

  /* Data card header */
  .data-card-header { flex-wrap: wrap; gap: 8px; }
  .data-card-header .btn-sm { font-size: 11px; padding: 4px 8px; }
}
