/* ===== BASE RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

:root {
  /* SilverShield Brand Colors */
  --teal: #0A6E75;
  --teal-light: #0D8B94;
  --teal-dark: #085A60;
  --teal-bg: rgba(10, 110, 117, 0.08);
  --teal-bg-2: rgba(10, 110, 117, 0.15);
  --navy: #1B2A4A;
  --navy-light: #243658;
  --navy-dark: #141F38;
  --gold: #D4A843;
  --gold-light: #E0BD6A;
  --gold-dark: #B8912D;
  --gold-bg: rgba(212, 168, 67, 0.1);

  /* Surfaces */
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F9F8F5;
  --surface-hover: #F3F0EC;
  --border: #E5E2DC;
  --border-strong: #D4D1CA;

  /* Text */
  --text: #28251D;
  --text-muted: #5A5957;
  --text-faint: #9A9895;
  --text-inverse: #FFFFFF;

  /* Semantic */
  --success: #16A34A;
  --success-bg: rgba(22, 163, 74, 0.08);
  --success-border: rgba(22, 163, 74, 0.2);
  --warning: #D97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --warning-border: rgba(217, 119, 6, 0.2);
  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --danger-border: rgba(220, 38, 38, 0.2);
  --info: #2563EB;
  --info-bg: rgba(37, 99, 235, 0.08);
  --info-border: rgba(37, 99, 235, 0.2);

  /* Typography */
  --font-display: 'Cabinet Grotesk', 'General Sans', sans-serif;
  --font-body: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(40, 37, 29, 0.05);
  --shadow-md: 0 4px 12px rgba(40, 37, 29, 0.08);
  --shadow-lg: 0 8px 24px rgba(40, 37, 29, 0.1);

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Sidebar */
  --sidebar-width: 260px;
  --topbar-height: 60px;
}

body {
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ===== APP LAYOUT ===== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* sidebar overlay: always positioned out of grid flow */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 42, 74, 0.4);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
  display: none;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== SIDEBAR ===== */
.sidebar {
  grid-column: 1;
  grid-row: 1;
  background: var(--navy);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
}

.sidebar-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo svg {
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  color: #fff;
}

.logo-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* Navigation */
.sidebar-nav {
  padding: var(--space-3) var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(10, 110, 117, 0.35);
  color: #fff;
}

.nav-item.active svg {
  color: var(--gold);
}

.nav-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-badge.warning {
  background: var(--warning);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-4) var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xs);
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.9);
}

.user-plan {
  font-size: var(--text-xs);
  color: var(--gold);
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  flex-shrink: 0;
  z-index: 50;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: var(--space-2);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--navy);
  letter-spacing: -0.01em;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  background: none;
  border: none;
  cursor: pointer;
}

.topbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--surface);
}

/* ===== CONTENT ===== */
.content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
  background: var(--bg);
}

/* ===== DASHBOARD ===== */
.welcome-banner {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.welcome-text h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  margin-bottom: var(--space-1);
}

.welcome-text p {
  font-size: var(--text-sm);
  opacity: 0.85;
}

.shield-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255,255,255,0.15);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.shield-icon {
  position: relative;
  width: 48px;
  height: 48px;
}

.shield-icon svg {
  width: 48px;
  height: 48px;
}

.shield-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(22, 163, 74, 0.5);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.shield-label {
  font-weight: 600;
  font-size: var(--text-sm);
}

.shield-sublabel {
  font-size: var(--text-xs);
  opacity: 0.8;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon.teal { background: var(--teal-bg); color: var(--teal); }
.kpi-icon.gold { background: var(--gold-bg); color: var(--gold-dark); }
.kpi-icon.blue { background: var(--info-bg); color: var(--info); }
.kpi-icon.green { background: var(--success-bg); color: var(--success); }

.kpi-icon svg {
  width: 20px;
  height: 20px;
}

.kpi-trend {
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

.kpi-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--navy);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.2;
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.kpi-sublabel {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--navy);
}

.card-body {
  padding: var(--space-4) var(--space-5);
}

/* Activity Feed */
.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: var(--surface-2);
  margin: 0 calc(var(--space-5) * -1);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-dot.red { background: var(--danger); }
.activity-dot.orange { background: var(--warning); }
.activity-dot.green { background: var(--success); }
.activity-dot.blue { background: var(--info); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.4;
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: 2px;
}

/* Chart */
.chart-container {
  padding: var(--space-4) var(--space-5) var(--space-5);
  height: 280px;
  position: relative;
}

/* Protection Score Ring */
.score-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-5);
}

.score-ring {
  position: relative;
  width: 140px;
  height: 140px;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--teal);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ===== CALL GUARDIAN ===== */
.page-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
}

.call-list {
  list-style: none;
}

.call-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.call-item:last-child { border-bottom: none; }

.call-item:hover {
  background: var(--surface-2);
  margin: 0 calc(var(--space-5) * -1);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.call-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: var(--text-xs);
  color: #fff;
}

.call-avatar.safe { background: var(--success); }
.call-avatar.caution { background: var(--warning); }
.call-avatar.danger { background: var(--danger); }

.call-info {
  flex: 1;
  min-width: 0;
}

.call-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
}

.call-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.risk-score {
  text-align: right;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.risk-badge.safe { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.risk-badge.caution { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.risk-badge.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

/* Voice Registry */
.voice-list {
  list-style: none;
}

.voice-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.voice-item:last-child { border-bottom: none; }

.voice-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.voice-info {
  flex: 1;
}

.voice-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.voice-relation {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  background: var(--teal-dark);
}

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

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #B91C1C;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-full {
  width: 100%;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label {
  font-size: var(--text-sm);
  font-weight: 500;
}

.toggle-sublabel {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--teal);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ===== FINANCIAL ===== */
.accounts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.account-type {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.account-balance {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.account-label {
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: var(--space-1);
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.alert-banner.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
}

.alert-banner.danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.alert-icon.warning { color: var(--warning); }
.alert-icon.danger { color: var(--danger); }

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}

.alert-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

.alert-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Transaction List */
.transaction-list {
  list-style: none;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.transaction-item:last-child { border-bottom: none; }

.txn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.txn-icon.normal { background: var(--surface-hover); color: var(--text-muted); }
.txn-icon.flagged { background: var(--warning-bg); color: var(--warning); }
.txn-icon.held { background: var(--danger-bg); color: var(--danger); }

.txn-info { flex: 1; min-width: 0; }

.txn-name {
  font-weight: 500;
  font-size: var(--text-sm);
}

.txn-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.txn-amount {
  font-weight: 600;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.txn-status {
  font-size: var(--text-xs);
  text-align: right;
}

/* ===== COMMUNICATION ===== */
.email-list {
  list-style: none;
}

.email-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.email-item:last-child { border-bottom: none; }

.email-item:hover {
  background: var(--surface-2);
  margin: 0 calc(var(--space-5) * -1);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.email-status-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-status-icon.safe { background: var(--success-bg); color: var(--success); }
.email-status-icon.flagged { background: var(--warning-bg); color: var(--warning); }
.email-status-icon.blocked { background: var(--danger-bg); color: var(--danger); }

.email-content { flex: 1; min-width: 0; }

.email-subject {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
}

.email-preview {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-meta {
  text-align: right;
  flex-shrink: 0;
}

.email-time {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.email-rating {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 2px;
}

.email-rating.safe { color: var(--success); }
.email-rating.flagged { color: var(--warning); }
.email-rating.blocked { color: var(--danger); }

/* SMS Section */
.sms-list {
  list-style: none;
}

.sms-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.sms-item:last-child { border-bottom: none; }

.sms-bubble {
  flex: 1;
  background: var(--surface-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
}

.sms-sender {
  font-weight: 600;
  font-size: var(--text-xs);
  margin-bottom: 2px;
}

/* ===== FAMILY GUARDIAN ===== */
.family-circle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) 0;
  flex-wrap: wrap;
}

.family-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: transform var(--transition);
}

.family-member:hover {
  transform: translateY(-4px);
}

.family-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
  color: #fff;
  position: relative;
}

.family-avatar.primary { background: var(--teal); }
.family-avatar.secondary { background: var(--navy); }
.family-avatar.accent { background: var(--gold-dark); }
.family-avatar.info { background: var(--info); }

.family-avatar .online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: var(--success);
  border: 3px solid var(--surface);
  border-radius: var(--radius-full);
}

.family-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
}

.family-relation {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: -4px;
}

.family-alert-level {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.family-alert-level.high { background: var(--danger-bg); color: var(--danger); }
.family-alert-level.medium { background: var(--warning-bg); color: var(--warning); }
.family-alert-level.low { background: var(--info-bg); color: var(--info); }

/* Emergency Button */
.emergency-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) 0;
  gap: var(--space-3);
}

.emergency-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--danger);
  color: #fff;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
  border: none;
  font-size: var(--text-base);
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.emergency-btn:hover {
  background: #B91C1C;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.emergency-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  max-width: 400px;
}

/* ===== DIGITAL LITERACY ===== */
.current-module {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  color: #fff;
  margin-bottom: var(--space-6);
}

.module-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: var(--space-2);
}

.module-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: var(--radius-full);
  transition: width 1s var(--ease);
}

.progress-text {
  font-size: var(--text-xs);
  opacity: 0.8;
}

.module-actions {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-3);
}

.btn-gold {
  background: var(--gold);
  color: var(--navy);
}

.btn-gold:hover {
  background: var(--gold-dark);
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.1);
}

/* Module List */
.module-list {
  list-style: none;
}

.module-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.module-item:last-child { border-bottom: none; }

.module-item:hover {
  background: var(--surface-2);
  margin: 0 calc(var(--space-5) * -1);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.module-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.module-number.completed { background: var(--success); color: #fff; }
.module-number.active { background: var(--teal); color: #fff; }
.module-number.locked { background: var(--surface-hover); color: var(--text-faint); }

.module-info { flex: 1; }

.module-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.module-status {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Threat Brief */
.threat-brief {
  background: linear-gradient(135deg, var(--teal-bg-2) 0%, var(--teal-bg) 100%);
  border: 1px solid rgba(10, 110, 117, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.threat-brief-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.threat-brief-title {
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.threat-brief-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Quiz Score */
.quiz-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-4) 0;
}

.quiz-stat {
  text-align: center;
}

.quiz-stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.quiz-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ===== DETAIL PANEL (Overlay) ===== */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 42, 74, 0.4);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
}

.detail-overlay.active {
  opacity: 1;
  visibility: visible;
}

.detail-panel {
  width: 480px;
  max-width: 90vw;
  background: var(--surface);
  height: 100%;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 300ms var(--ease);
  box-shadow: var(--shadow-lg);
}

.detail-overlay.active .detail-panel {
  transform: translateX(0);
}

.detail-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.detail-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--navy);
}

.detail-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: all var(--transition);
}

.detail-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.detail-body {
  padding: var(--space-6);
}

.detail-section {
  margin-bottom: var(--space-6);
}

.detail-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.detail-row-label { color: var(--text-muted); }
.detail-row-value { font-weight: 600; }

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tab-btn {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .page-grid-2 {
    grid-template-columns: 1fr;
  }
  .accounts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 300ms var(--ease);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .content {
    padding: var(--space-4);
  }

  .topbar {
    padding: 0 var(--space-4);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
  }

  .family-circle {
    gap: var(--space-5);
  }

  .current-module {
    padding: var(--space-5);
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 400ms var(--ease) both;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }

/* Score ring animation */
@keyframes scoreGrow {
  from { stroke-dashoffset: 377; }
}

.score-ring-track {
  animation: scoreGrow 1.5s var(--ease) both;
}

/* Scrollbar */
.content::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* ===== UTILITY ===== */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.font-tabular { font-variant-numeric: tabular-nums lining-nums; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.gap-4 { gap: var(--space-4); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
