/* ═══════════════════════════════════════════════════════════════════════════
   ThinkReport — Design System
   Font: Inter (Google Fonts)
   Accent: Indigo #6366f1 / Violet #8b5cf6
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ─── CSS Custom Properties ────────────────────────────────────────────── */

:root {
  /* Layout */
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 64px;
  --topbar-height: 60px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;

  /* Light Mode Palette */
  --color-bg:        #f0f2f8;
  --color-surface:   #ffffff;
  --color-surface-2: #f8fafc;
  --color-surface-3: #f1f5f9;
  --color-border:    #e2e8f0;
  --color-border-2:  #cbd5e1;
  --color-text:      #0f172a;
  --color-text-2:    #334155;
  --color-muted:     #64748b;
  --color-muted-2:   #94a3b8;

  /* Accent */
  --color-accent:    #6366f1;
  --color-accent-2:  #8b5cf6;
  --color-accent-3:  #a78bfa;
  --color-accent-bg: rgba(99,102,241,0.08);
  --color-accent-bg-2: rgba(99,102,241,0.15);

  /* Sidebar */
  --sidebar-bg:      #0f1117;
  --sidebar-text:    #94a3b8;
  --sidebar-active:  #f1f5f9;
  --sidebar-hover-bg: rgba(255,255,255,0.06);
  --sidebar-active-bg: rgba(99,102,241,0.18);

  /* Status Colors */
  --color-success:   #10b981;
  --color-warning:   #f59e0b;
  --color-danger:    #ef4444;
  --color-info:      #3b82f6;
  --color-purple:    #8b5cf6;
  --color-cyan:      #06b6d4;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.12);

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 350ms cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --color-bg:        #070b15;
  --color-surface:   #0f1623;
  --color-surface-2: #131d2e;
  --color-surface-3: #172138;
  --color-border:    #1e2a42;
  --color-border-2:  #253347;
  --color-text:      #e2e8f0;
  --color-text-2:    #cbd5e1;
  --color-muted:     #94a3b8;
  --color-muted-2:   #64748b;
  --color-accent-bg: rgba(99,102,241,0.12);
  --color-accent-bg-2: rgba(99,102,241,0.2);
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
}

/* ─── Reset & Base ─────────────────────────────────────────────────────── */

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background var(--transition-slow), color var(--transition-slow);
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--color-border); }

/* ─── App Layout ───────────────────────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition);
  min-width: 0;
}

.main-content {
  flex: 1;
  padding: 28px 32px;
  overflow-x: hidden;
}

/* ─── Sidebar ──────────────────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: var(--topbar-height);
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 15px; font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-subtitle {
  font-size: 10px;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

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

.nav-section-label {
  font-size: 10px; font-weight: 600;
  color: rgba(148,163,184,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 20px 4px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  margin: 1px 8px;
  border-radius: var(--border-radius-sm);
}

.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: #f1f5f9;
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  border-left-color: var(--color-accent);
}

.nav-item svg { flex-shrink: 0; }
.nav-item-label { font-size: 13.5px; font-weight: 500; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ─── Topbar ───────────────────────────────────────────────────────────── */

.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  font-size: 17px; font-weight: 700;
  color: var(--color-text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  cursor: pointer;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Theme Toggle ─────────────────────────────────────────────────────── */

.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover {
  background: var(--color-accent-bg);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ─── Cards ────────────────────────────────────────────────────────────── */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}
.card-title {
  font-size: 13px; font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card-body { padding: 20px; }

/* Glassmorphism variant */
.card-glass {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ─── KPI / Stats Cards ────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--stat-color, var(--color-accent));
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-label {
  font-size: 11px; font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 32px; font-weight: 800;
  color: var(--color-text);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-trend {
  font-size: 12px;
  color: var(--color-muted);
}
.stat-trend.up { color: var(--color-success); }
.stat-trend.down { color: var(--color-danger); }

.stat-card.indigo { --stat-color: #6366f1; }
.stat-card.green  { --stat-color: #10b981; }
.stat-card.orange { --stat-color: #f59e0b; }
.stat-card.red    { --stat-color: #ef4444; }
.stat-card.purple { --stat-color: #8b5cf6; }
.stat-card.cyan   { --stat-color: #06b6d4; }

/* ─── Charts Grid ──────────────────────────────────────────────────────── */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 20px;
}

.chart-label {
  font-size: 12px; font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px;
}
.chart-label::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--color-accent);
  border-radius: 2px;
}

.chart-container { position: relative; height: 200px; }

/* ─── Tables ───────────────────────────────────────────────────────────── */

.table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead tr {
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 12px 14px;
  color: var(--color-text-2);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--transition);
}
.data-table tbody tr:hover {
  background: var(--color-surface-2);
}

/* ─── Badges ───────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}

.badge-green  { background: rgba(16,185,129,0.12); color: #059669; }
.badge-blue   { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-cyan   { background: rgba(6,182,212,0.12);  color: #0891b2; }
.badge-orange { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-red    { background: rgba(239,68,68,0.12);  color: #dc2626; }
.badge-purple { background: rgba(139,92,246,0.12); color: #7c3aed; }
.badge-indigo { background: rgba(99,102,241,0.12); color: #4f46e5; }
.badge-gray   { background: rgba(100,116,139,0.1); color: #64748b; }

[data-theme="dark"] .badge-green  { background: rgba(16,185,129,0.18); color: #34d399; }
[data-theme="dark"] .badge-blue   { background: rgba(59,130,246,0.18); color: #60a5fa; }
[data-theme="dark"] .badge-cyan   { background: rgba(6,182,212,0.18);  color: #22d3ee; }
[data-theme="dark"] .badge-orange { background: rgba(245,158,11,0.18); color: #fbbf24; }
[data-theme="dark"] .badge-red    { background: rgba(239,68,68,0.18);  color: #f87171; }
[data-theme="dark"] .badge-purple { background: rgba(139,92,246,0.18); color: #a78bfa; }
[data-theme="dark"] .badge-indigo { background: rgba(99,102,241,0.18); color: #818cf8; }
[data-theme="dark"] .badge-gray   { background: rgba(100,116,139,0.15); color: #94a3b8; }

/* ─── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99,102,241,0.45);
  color: white; text-decoration: none;
}

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text-2);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-surface-3);
  color: var(--color-text);
  text-decoration: none;
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--color-danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.18);
  text-decoration: none;
}

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

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ─── Forms ────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-control {
  display: block; width: 100%;
  padding: 9px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-bg);
}
.form-control::placeholder { color: var(--color-muted-2); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

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

/* Compact input variant for use inside table cells */
.form-control-inline {
  display: inline-block;
  width: auto;
  padding: 4px 8px;
  font-size: 13px;
  background: var(--color-surface-2);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  color: var(--color-text);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.form-control-inline:hover {
  border-color: var(--color-border);
  background: var(--color-surface);
}
.form-control-inline:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-accent-bg);
}


/* ─── Toggle Switch ────────────────────────────────────────────────────── */

.toggle-switch {
  position: relative; display: inline-flex; align-items: center;
  gap: 8px; cursor: pointer;
}
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 40px; height: 22px;
  background: var(--color-border-2);
  border-radius: 11px;
  transition: background var(--transition);
  position: relative;
}
.toggle-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track {
  background: var(--color-accent);
}
.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
}
.toggle-label {
  font-size: 13px;
  color: var(--color-text-2);
}

/* ─── Progress Bar ─────────────────────────────────────────────────────── */

.progress-bar-wrap {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-bar-fill.over-target { background: linear-gradient(90deg, #10b981, #059669); }
.progress-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #d97706); }

/* ─── Team Member Card ─────────────────────────────────────────────────── */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.team-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.team-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.team-card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.member-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: white;
  overflow: hidden; flex-shrink: 0;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-name { font-size: 15px; font-weight: 700; color: var(--color-text); }
.member-role { font-size: 12px; color: var(--color-muted); margin-top: 2px; }

.team-hours {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 8px;
}
.hours-value {
  font-size: 26px; font-weight: 800;
  color: var(--color-text);
  letter-spacing: -1px;
}
.hours-target { font-size: 12px; color: var(--color-muted); margin-bottom: 4px; }

.source-split {
  display: flex; gap: 12px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
}
.source-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 4px;
}
.source-dot.projects { background: var(--color-accent); }
.source-dot.desk { background: var(--color-success); }

/* Untracked card style */
.team-card.untracked { opacity: 0.55; }
.team-card.untracked:hover { opacity: 0.8; }

/* ─── Settings Tabs ────────────────────────────────────────────────────── */

.settings-tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
}
.settings-tab {
  padding: 10px 18px;
  font-size: 13px; font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.settings-tab:hover { color: var(--color-text); text-decoration: none; }
.settings-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.settings-panel { display: none; }
.settings-panel.active { display: block; }

.settings-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
}
.settings-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px; font-weight: 700; color: var(--color-text);
}
.settings-section-body { padding: 20px; }

/* ─── Flash Messages ───────────────────────────────────────────────────── */

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  animation: fadeInSlide 0.3s ease;
}
.flash-success { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.flash-error   { background: rgba(239,68,68,0.1);  color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }
.flash-info    { background: var(--color-accent-bg); color: var(--color-accent); border: 1px solid var(--color-accent-bg-2); }

/* ─── Login Page ───────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg);
  padding: 24px;
}

.login-card {
  width: 100%; max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.4s ease;
}

.login-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: white;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}

.login-title { font-size: 24px; font-weight: 800; color: var(--color-text); margin-bottom: 4px; }
.login-sub { font-size: 14px; color: var(--color-muted); margin-bottom: 28px; }

/* ─── Connection Status ────────────────────────────────────────────────── */

.status-connected {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--color-success);
}
.status-connected::before {
  content: ''; width: 6px; height: 6px;
  background: var(--color-success); border-radius: 50%;
  animation: pulse 2s infinite;
}
.status-disconnected {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--color-warning);
}
.status-disconnected::before {
  content: ''; width: 6px; height: 6px;
  background: var(--color-warning); border-radius: 50%;
}

/* ─── Page Header ──────────────────────────────────────────────────────── */

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--color-text); }
.page-sub { font-size: 13px; color: var(--color-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ─── Empty State ──────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--color-text-2); }
.empty-state-sub { font-size: 14px; margin-bottom: 20px; }

/* ─── Sync Button / Loading ────────────────────────────────────────────── */

.loading-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
button.loading .loading-spinner { display: inline-block; }
button.loading .btn-text { display: none; }

/* ─── Divider Table Members ────────────────────────────────────────────── */

.member-group-label {
  padding: 12px 14px 6px;
  font-size: 10px; font-weight: 700;
  color: var(--color-muted-2);
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--color-border);
}

/* ─── Animations ───────────────────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

.animate-in { animation: fadeInUp 0.35s ease both; }
.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.10s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.20s; }

/* ─── Utilities ────────────────────────────────────────────────────────── */

.text-muted { color: var(--color-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ─── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-collapsed-width); }
  .sidebar-title, .sidebar-subtitle, .nav-item-label, .nav-section-label { display: none; }
  .main-wrapper { margin-left: var(--sidebar-collapsed-width); }
  .charts-grid { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}
