/* ============================================================
   Impulse Maps — Dashboard: design tokens + header unificado
   Tema escuro = padrão (visual original). Tema claro via
   html[data-theme="light"] (toggle no header, salvo em localStorage).
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --panel: #13131a;
  --panel-2: #1a1a24;
  --panel-3: #1e1e2e;
  --border: #23232f;
  --border-2: #2a2a3c;
  --text: #e2e8f0;
  --heading: #f1f5f9;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f52d9;
  --accent-soft: rgba(99, 102, 241, .14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .12);
  --yellow: #f59e0b;
  --yellow-soft: rgba(245, 158, 11, .12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, .12);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, .12);
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, .12);
  --header-bg: rgba(19, 19, 26, .88);
  --shadow: 0 4px 24px rgba(0, 0, 0, .35);
  --chart-grid: rgba(148, 163, 184, .12);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f4f9;
  --panel: #ffffff;
  --panel-2: #f1f2f8;
  --panel-3: #e9ebf4;
  --border: #e3e5ef;
  --border-2: #d5d8e6;
  --text: #2a3040;
  --heading: #171c2b;
  --muted: #5a6478;
  --muted-2: #8a93a8;
  --accent: #4f52d9;
  --accent-hover: #4245c4;
  --accent-soft: rgba(79, 82, 217, .10);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, .10);
  --yellow: #b45309;
  --yellow-soft: rgba(180, 83, 9, .10);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, .09);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, .09);
  --blue: #0284c7;
  --blue-soft: rgba(2, 132, 199, .09);
  --header-bg: rgba(255, 255, 255, .88);
  --shadow: 0 4px 20px rgba(23, 28, 43, .08);
  --chart-grid: rgba(90, 100, 120, .14);
  color-scheme: light;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .25s ease, color .25s ease;
}

/* ---------- Header unificado ---------- */
.im-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 12px 24px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.im-brand { display: flex; flex-direction: column; gap: 1px; text-decoration: none; }
.im-brand h1 { font-size: 17px; font-weight: 700; color: var(--heading); white-space: nowrap; }
.im-brand h1 .im-accent { color: var(--accent); }
.im-brand .im-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.im-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; }
.im-nav a {
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.im-nav a:hover { color: var(--text); background: var(--panel-2); }
.im-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 600;
}

.im-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.im-user { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.im-user strong { color: var(--text); font-weight: 600; }

.im-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.im-btn:hover { background: var(--panel-3); border-color: var(--muted-2); }

.im-theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  line-height: 1;
}
.im-theme-toggle:hover { background: var(--panel-3); border-color: var(--muted-2); }
.im-theme-toggle .im-ico-sun { display: none; }
.im-theme-toggle .im-ico-moon { display: inline; }
html[data-theme="light"] .im-theme-toggle .im-ico-sun { display: inline; }
html[data-theme="light"] .im-theme-toggle .im-ico-moon { display: none; }

@media (max-width: 760px) {
  .im-header { padding: 10px 14px; }
  .im-nav { order: 3; width: 100%; margin-left: 0; }
  .im-user { display: none; }
}

/* ---------- Footer padrão ---------- */
.im-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 12px;
  color: var(--muted-2);
}
.im-footer a { color: var(--accent); text-decoration: none; }
