/* ============================================================
   AgentAIShield — Dashboard Styles v2
   Glassmorphism · Animations · World-class dark UI
   ============================================================ */

/* ─── App Shell ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w, 240px);
  background: linear-gradient(180deg, rgba(15, 15, 25, 0.97) 0%, rgba(10, 10, 18, 0.99) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 280ms var(--ease);
  overflow: hidden;
}
@media (min-width: 768px) {
  .sidebar { transform: translateX(0); }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  color: #ffffff;
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 14px 10px 6px;
}
.nav-section-label:first-child { padding-top: 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  transition: all 160ms var(--ease);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
}
.nav-item i { font-size: 16px; flex-shrink: 0; }
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.nav-item.active {
  background: rgba(99,102,241,0.14);
  color: var(--primary);
}
.nav-item.active i { color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

/* ── Collapsible nav groups (accordion) ─────────────────────── */
.nav-group { margin-bottom: 2px; }
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.nav-group-toggle:hover { background: rgba(255,255,255,0.03); color: var(--text-2); }
.nav-group-arrow {
  font-size: 12px;
  transition: transform 200ms var(--ease);
}
.nav-group:not(.open) .nav-group-arrow { transform: rotate(-90deg); }
.nav-group-items {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 250ms ease, opacity 200ms ease;
  opacity: 1;
}
.nav-group:not(.open) .nav-group-items {
  max-height: 0;
  opacity: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--danger-dim);
  color: var(--danger);
  line-height: 1.6;
}

.sidebar-footer {
  padding: 10px 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms;
}
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { opacity: 1; pointer-events: all; }

/* ─── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-left: 0;
}
@media (min-width: 768px) {
  .topbar { margin-left: var(--sidebar-w, 240px); padding: 0 28px; }
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }

.page-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 6px;
  transition: background 160ms;
}
.hamburger-btn:hover { background: var(--surface-2); }
@media (min-width: 768px) { .hamburger-btn { display: none; } }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  padding: 4px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: all 160ms var(--ease);
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none !important;
  transition: background 120ms;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item i { font-size: 15px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Main Content ───────────────────────────────────────────── */
.main-content {
  min-height: 100vh;
  margin-left: 0;
  margin-top: 0;
  padding-top: 0;
}
@media (min-width: 768px) { .main-content { margin-left: var(--sidebar-w, 240px); } }

.main-inner { padding: 20px 16px 8px; max-width: 1400px; }
@media (min-width: 768px) { .main-inner { padding: 8px 28px 12px; } }
@media (min-width: 1200px) { .main-inner { padding: 8px 40px 16px; } }
/* Eliminate gap from empty/hidden containers above main content */
#billing-warning-banner[style*="display: none"],
#billing-warning-banner[style*="display:none"] { margin: 0; padding: 0; height: 0; overflow: hidden; }
#announcements-container { margin-top: 0; }
#announcements-container:empty { display: none; margin: 0; padding: 0; }

/* ─── Glassmorphism Cards ────────────────────────────────────── */
.dash-card {
  background: rgba(13, 13, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 240ms var(--ease), box-shadow 240ms var(--ease), transform 240ms var(--ease);
  position: relative;
  overflow: hidden;
}
.dash-card.overflow-visible {
  overflow: visible;
}
.dash-card:hover {
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 8px 32px rgba(99,102,241,0.07);
  transform: translateY(-1px);
}
.dash-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.03) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

/* card — no hover */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 200ms;
}
.card:hover { border-color: var(--border-light); }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ─── KPI / Metric Cards ─────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.kpi-card {
  background: rgba(13, 13, 20, 0.7);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 240ms var(--ease), box-shadow 240ms var(--ease), transform 240ms var(--ease);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(99,102,241,0.15);
}
.kpi-card * { pointer-events: none; }
.kpi-card { pointer-events: auto; }
.kpi-card:hover {
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 8px 32px rgba(99,102,241,0.07);
  transform: translateY(-1px);
}

.kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.kpi-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.kpi-left {
  flex: 1;
  min-width: 0;
}
.kpi-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.kpi-sparkline {
  width: 100px;
  height: 60px;
  opacity: 0.85;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.kpi-card:hover .kpi-sparkline {
  opacity: 1;
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
}
.kpi-delta.up { color: var(--success); background: var(--success-dim); }
.kpi-delta.down { color: var(--danger); background: var(--danger-dim); }
.kpi-delta.neutral { color: var(--text-3); background: rgba(255,255,255,0.04); }

/* ─── Count-up animation ─────────────────────────────────────── */
.count-up { display: inline-block; }

/* ─── Bar Charts (inline SVG) ────────────────────────────────── */
.sparkline-wrap {
  width: 80px;
  height: 36px;
  flex-shrink: 0;
}
.sparkline-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Bar chart styles */
.bar-chart .bar {
  transform-origin: bottom;
  animation: bar-grow 0.4s ease-out forwards;
  transition: opacity 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

.bar-chart .bar.live {
  animation: bar-grow 0.4s ease-out forwards, pulse-bar 2s ease-in-out infinite 0.4s;
  filter: url(#pulse-glow-6366f1) brightness(1.1);
}

.bar-chart .bar:hover {
  opacity: 1 !important;
  filter: brightness(1.2);
}

/* Tooltip on hover */
.bar-chart .bar:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  animation: tooltip-fade-in 0.2s ease-out forwards;
}

/* Bar chart animations */
@keyframes bar-grow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes pulse-bar {
  0%, 100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.8;
    filter: brightness(1.3);
  }
}

@keyframes tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile: narrower bars */
@media (max-width: 768px) {
  .sparkline-wrap {
    width: 70px;
  }
}

/* ─── Skeleton Loading ───────────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; border-radius: 4px; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; border-radius: 4px; }
.skeleton-value { height: 32px; border-radius: 6px; margin-bottom: 8px; width: 60%; }
.skeleton-card {
  background: rgba(13,13,20,0.7);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 14px;
  padding: 20px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

/* ─── Circular Gauge (SVG) ───────────────────────────────────── */
.gauge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gauge-svg {
  transform: rotate(-90deg);
  transform-origin: center;
}
.gauge-track {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}
.gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.29; /* 2π × 54 */
  stroke-dashoffset: 339.29;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.gauge-fill.animated { stroke-dashoffset: var(--dash-offset, 339.29); }
.gauge-center {
  position: absolute;
  text-align: center;
  line-height: 1;
}
.gauge-score { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.gauge-grade { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Large gauge (trust page) */
.gauge-lg .gauge-track { stroke-width: 10; }
.gauge-lg .gauge-fill { stroke-width: 10; stroke-dasharray: 534.07; }
.gauge-lg .gauge-score { font-size: 48px; }

/* ─── Grade Badges ───────────────────────────────────────────── */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  flex-shrink: 0;
}
.grade-badge.grade-a-plus { background: rgba(16,185,129,0.2); color: #10b981; box-shadow: 0 0 12px rgba(16,185,129,0.25); }
.grade-badge.grade-a     { background: rgba(52,211,153,0.15); color: #34d399; }
.grade-badge.grade-b-plus { background: rgba(59,130,246,0.15); color: #60a5fa; }
.grade-badge.grade-b     { background: rgba(99,102,241,0.15); color: #818cf8; }
.grade-badge.grade-c     { background: rgba(245,158,11,0.15); color: #fbbf24; }
.grade-badge.grade-d     { background: rgba(249,115,22,0.15); color: #fb923c; }
.grade-badge.grade-f     { background: rgba(239,68,68,0.15); color: #f87171; box-shadow: 0 0 12px rgba(239,68,68,0.2); }

/* ─── Status Dots ────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-dot.success { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.status-dot.blocked { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.status-dot.error   { background: var(--danger); }

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}
.status-dot.pulse { animation: dot-pulse 2s ease-in-out infinite; }

/* ─── Agent Card (Trust) ─────────────────────────────────────── */
.agent-card {
  background: rgba(13,13,20,0.7);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 14px;
  padding: 18px;
  transition: all 240ms var(--ease);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.agent-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 8px 32px rgba(99,102,241,0.08);
  transform: translateY(-2px);
}
.agent-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 32px rgba(99,102,241,0.12);
}

.factor-bar-wrap { margin: 4px 0; }
.factor-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 11px;
}
.factor-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.factor-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badge pills */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.trust-badge.earned { box-shadow: 0 0 8px rgba(99,102,241,0.3); }
.trust-badge.unearned { opacity: 0.4; filter: grayscale(0.7); }

/* ─── Drawer / Slide-in Panel ────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 301;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.drawer.open { transform: translateX(0); }
.drawer::-webkit-scrollbar { width: 4px; }
.drawer::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.drawer-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}
.drawer-close {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 160ms;
}
.drawer-close:hover { background: rgba(255,255,255,0.1); }

/* ─── Requests Table ─────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
tbody tr { transition: background 120ms; cursor: pointer; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child td { border-bottom: none; }

/* Expanded row */
.req-detail-row td {
  background: rgba(99,102,241,0.04);
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: default;
}

/* Latency colors */
.latency-fast  { color: var(--success) !important; }
.latency-med   { color: var(--warning) !important; }
.latency-slow  { color: var(--danger) !important; }

/* Flag badges */
.flag-pii      { color: var(--danger); font-size: 13px; }
.flag-injection { color: var(--warning); font-size: 13px; }
.flag-policy   { color: var(--info); font-size: 13px; }

/* ─── Filters bar ────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(13,13,20,0.7);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 12px;
  margin-bottom: 16px;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 160ms;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--border-light); color: var(--text); }
.filter-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

/* ─── Security Alerts ────────────────────────────────────────── */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(13,13,20,0.4);
  margin-bottom: 6px;
  transition: border-color 160ms;
}
.alert-item:hover { border-color: rgba(255,255,255,0.08); }
.alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.alert-item.critical .alert-icon { background: rgba(239,68,68,0.15); color: var(--danger); }
.alert-item.warning  .alert-icon { background: rgba(245,158,11,0.15); color: var(--warning); }
.alert-item.info     .alert-icon { background: rgba(59,130,246,0.15); color: var(--info); }

.severity-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 5px;
}
.severity-critical { background: rgba(239,68,68,0.15); color: var(--danger); }
.severity-warning  { background: rgba(245,158,11,0.12); color: var(--warning); }
.severity-info     { background: rgba(59,130,246,0.12); color: var(--info); }

/* ─── Activity Feed ──────────────────────────────────────────── */
.activity-feed-container {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.activity-feed-container::-webkit-scrollbar { width: 4px; }
.activity-feed-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms;
  font-size: 12px;
}
.activity-row:hover { background: rgba(255,255,255,0.03); }
.activity-row.expanded { background: rgba(99,102,241,0.05); border: 1px solid rgba(99,102,241,0.15); }
.activity-agent { font-weight: 500; color: var(--text); font-size: 12px; }
.activity-time  { color: var(--text-3); font-size: 11px; white-space: nowrap; }

/* ─── Trust Score overview ───────────────────────────────────── */
.trust-hero {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.trust-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.1), transparent 70%);
  pointer-events: none;
}

/* Grade distribution */
.grade-dist-bar {
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  gap: 2px;
}
.grade-dist-segment {
  height: 100%;
  border-radius: 2px;
  transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Toast Notifications ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  pointer-events: all;
  min-width: 260px;
  max-width: 360px;
  animation: toast-in 280ms var(--ease);
}
@keyframes toast-in {
  from { transform: translateX(16px) translateY(4px); opacity: 0; }
  to   { transform: translateX(0) translateY(0); opacity: 1; }
}
.toast.success { border-left: 3px solid var(--success); }
.toast.success i { color: var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.error   i { color: var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.info    i { color: var(--info); }
.toast i { font-size: 17px; flex-shrink: 0; }

/* ─── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: modal-in 240ms var(--ease);
}
@keyframes modal-in {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close {
  width: 28px; height: 28px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background 160ms;
}
.modal-close:hover { background: rgba(255,255,255,0.1); }
.modal > form, .modal > div:not(.modal-header) { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 160ms, box-shadow 160ms;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Toggle switch — Discord-style (see aais-toggle.css for full component) */
/* .toggle is an alias for .aais-toggle for backward compatibility */
.toggle { display: inline-block; cursor: pointer; position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.toggle > .toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 3px;
}
.toggle > .toggle-slider::after {
  content: '✕';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: rgba(148,163,184,0.7);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34,1.2,0.64,1), background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transform: translateX(0);
}
.toggle input:checked + .toggle-slider { background: #6366f1; border-color: #6366f1; }
.toggle input:checked + .toggle-slider::after { content: '✓'; background: #fff; color: #6366f1; font-size: 10px; transform: translateX(20px); }
.toggle input:focus-visible + .toggle-slider { outline: 2px solid #6366f1; outline-offset: 2px; }

/* ─── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-primary { background: var(--primary-dim); color: var(--primary); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger); }
.badge-info    { background: var(--info-dim);    color: var(--info); }
.badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-2); }
.badge-purple  { background: var(--violet-dim); color: var(--violet); }

/* Enrollment method badges */
.badge-human { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-agent { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-sdk { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Claim status badges */
.badge-unclaimed { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-claimed { background: rgba(16, 185, 129, 0.15); color: #34d399; }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state i { font-size: 40px; color: var(--text-3); }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-2); }
.empty-state p { font-size: 13px; color: var(--text-3); max-width: 300px; }

/* Empty state CSS art */
.empty-art {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(99,102,241,0.08);
  border: 2px dashed rgba(99,102,241,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* ─── Loading overlay ────────────────────────────────────────── */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(99,102,241,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* ─── Section headers ────────────────────────────────────────── */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-section-header h2 { margin-top: 0; }
.dash-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-section-title i { font-size: 16px; }

/* ─── Two-column layouts ─────────────────────────────────────── */
.dash-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 900px) {
  .dash-row-2 { grid-template-columns: 1fr 1fr; }
  .dash-row-2-wide { grid-template-columns: 3fr 2fr; }
  .dash-row-2-cost { grid-template-columns: 2fr 1fr 1fr; }
}

/* ─── Agent grid ─────────────────────────────────────────────── */
.agent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 700px)  { .agent-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .agent-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .agent-grid { grid-template-columns: repeat(4, 1fr); } }

/* ─── Threat timeline ────────────────────────────────────────── */
.threat-event {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}
.threat-event:last-child { border-bottom: none; }
.threat-event-line {
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: -10px;
  width: 1px;
  background: rgba(255,255,255,0.06);
}

/* ─── Plan upgrade card ──────────────────────────────────────── */
.plan-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.plan-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(139,92,246,0.15), transparent 70%);
  pointer-events: none;
}

/* ─── Usage progress bar ─────────────────────────────────────── */
.usage-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
}
.usage-bar-fill.warning { background: var(--warning); }
.usage-bar-fill.danger  { background: var(--danger); }

/* ─── Billing page bars ──────────────────────────────────────── */
.billing-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 900ms cubic-bezier(0.4, 0, 0.2, 1);
}
.billing-bar-pulse {
  animation: billing-bar-breathe 2s ease-in-out infinite;
}
@keyframes billing-bar-breathe {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ─── Dashboard agent bar pulse ─────────────────────────────── */
.dash-bar-pulse {
  animation: billing-bar-breathe 2s ease-in-out infinite;
}

/* ─── Audit log ──────────────────────────────────────────────── */
.audit-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 120ms;
}
.audit-row:hover { background: rgba(255,255,255,0.025); }
.audit-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: rgba(99,102,241,0.1);
  color: var(--primary);
}

/* ─── Sort/filter toolbar ────────────────────────────────────── */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sort-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.sort-btn:hover { border-color: var(--border-light); color: var(--text-2); }
.sort-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

/* ─── Text highlight (PII/injection) ────────────────────────── */
.pii-highlight {
  background: rgba(245,158,11,0.25);
  border-bottom: 1.5px solid var(--warning);
  border-radius: 2px;
  padding: 0 2px;
  cursor: help;
}
.injection-highlight {
  background: rgba(239,68,68,0.2);
  border-bottom: 1.5px solid var(--danger);
  border-radius: 2px;
  padding: 0 2px;
  cursor: help;
}

/* ─── Alerts / Info boxes ────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-info    { background: var(--info-dim); border: 1px solid rgba(59,130,246,0.2); color: #93c5fd; }
.alert-warning { background: var(--warning-dim); border: 1px solid rgba(245,158,11,0.2); color: #fcd34d; }
.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ─── Responsive helpers ─────────────────────────────────────── */
.hidden-mobile { display: none; }
@media (min-width: 640px) { .hidden-mobile { display: initial; } }

.w-full { width: 100%; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ─── Page transitions ───────────────────────────────────────── */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter {
  animation: page-fade-in 280ms var(--ease);
}

/* ─── Data grid / cost grid ──────────────────────────────────── */
.data-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 900px) { .data-grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ─── PII category table ─────────────────────────────────────── */
.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.cat-row:last-child { border-bottom: none; }

/* ─── Injection pattern card ─────────────────────────────────── */
.pattern-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(13,13,20,0.4);
  margin-bottom: 6px;
}

/* ─── Notification Panel ─────────────────────────────────────── */
.notification-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 4px);
  right: 60px;
  width: 320px;
  max-height: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.notification-panel.open { display: block; }
.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.notification-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}
.notification-empty {
  text-align: center;
  padding: 32px 16px;
}
.notification-item {
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s;
  cursor: pointer;
}
.notification-item:hover { background: rgba(255,255,255,0.03); }
.notification-item + .notification-item { margin-top: 2px; }
.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
}
#notification-btn { position: relative; }


/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES — Premium SaaS quality (Vercel/Linear)
   Every dark-specific rgba/bg gets flipped for clean light mode
   ═══════════════════════════════════════════════════════════════ */

/* ─── App Shell: Sidebar ─────────────────────────────────────── */
[data-theme="light"] .sidebar {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 1px 0 0 #e2e8f0;
  border-right: 1px solid #e2e8f0;
}
[data-theme="light"] .sidebar-logo {
  color: #0f172a;
}
[data-theme="light"] .sidebar-logo-text {
  color: #0f172a;
}

/* ─── Nav items ──────────────────────────────────────────────── */
[data-theme="light"] .nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
[data-theme="light"] .nav-item.active {
  background: rgba(99,102,241,0.08);
  color: #6366f1;
}
[data-theme="light"] .sidebar-user:hover {
  background: #f1f5f9;
}

/* ─── Topbar ─────────────────────────────────────────────────── */
[data-theme="light"] .topbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid #e2e8f0;
}

/* ─── Glassmorphism Cards → Clean white cards ────────────────── */
[data-theme="light"] .dash-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .dash-card::before {
  background: none;
}
[data-theme="light"] .dash-card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
}

/* ─── KPI Cards ──────────────────────────────────────────────── */
[data-theme="light"] .kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .kpi-card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
[data-theme="light"] .kpi-delta.neutral {
  background: rgba(0,0,0,0.04);
  color: #64748b;
}

/* ─── Agent Cards ────────────────────────────────────────────── */
[data-theme="light"] .agent-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .agent-card:hover {
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
[data-theme="light"] .agent-card.selected {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1, 0 4px 16px rgba(99,102,241,0.12);
}

/* ─── Skeleton ───────────────────────────────────────────────── */
[data-theme="light"] .skeleton-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
}

/* ─── Table ──────────────────────────────────────────────────── */
[data-theme="light"] thead th {
  background: #f8fafc;
  color: #64748b;
}
[data-theme="light"] tbody td {
  border-bottom-color: #f1f5f9;
}
[data-theme="light"] tbody tr:hover td {
  background: #f8fafc;
}
[data-theme="light"] .req-detail-row td {
  background: rgba(99,102,241,0.04);
}

/* ─── Filters bar ────────────────────────────────────────────── */
[data-theme="light"] .filters-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  backdrop-filter: none;
}
[data-theme="light"] .filter-chip {
  background: #f8fafc;
}

/* ─── Security Alert Items ───────────────────────────────────── */
[data-theme="light"] .alert-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
[data-theme="light"] .alert-item:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

/* ─── Alert text colors (flip from dark pastels) ─────────────── */
[data-theme="light"] .alert-info    { color: #2563eb; }
[data-theme="light"] .alert-warning { color: #d97706; }
[data-theme="light"] .alert-success { color: #059669; }
[data-theme="light"] .alert-danger  { color: #dc2626; }

/* ─── Activity feed ──────────────────────────────────────────── */
[data-theme="light"] .activity-row:hover {
  background: #f1f5f9;
}
[data-theme="light"] .activity-row.expanded {
  background: rgba(99,102,241,0.05);
  border: 1px solid rgba(99,102,241,0.15);
}

/* ─── Drawer / Slide panel ───────────────────────────────────── */
[data-theme="light"] .drawer-close {
  background: rgba(0,0,0,0.05);
}
[data-theme="light"] .drawer-close:hover {
  background: rgba(0,0,0,0.1);
  color: #0f172a;
}

/* ─── Modal ──────────────────────────────────────────────────── */
[data-theme="light"] .modal-close {
  background: rgba(0,0,0,0.05);
}
[data-theme="light"] .modal-close:hover {
  background: rgba(0,0,0,0.1);
  color: #0f172a;
}

/* ─── Gauge track (SVG) ──────────────────────────────────────── */
[data-theme="light"] .gauge-track {
  stroke: rgba(0,0,0,0.08);
}

/* ─── Factor bar track ───────────────────────────────────────── */
[data-theme="light"] .factor-bar-track {
  background: rgba(0,0,0,0.08);
}

/* ─── Progress / usage bars ──────────────────────────────────── */
[data-theme="light"] .usage-bar-wrap {
  background: rgba(0,0,0,0.06);
}

/* ─── Toggle switch light theme ──────────────────────────────── */
[data-theme="light"] .toggle > .toggle-slider,
[data-theme="light"] .toggle-switch .toggle-slider,
[data-theme="light"] .aais-toggle-slider {
  background: rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.15);
}
[data-theme="light"] .toggle > .toggle-slider::after,
[data-theme="light"] .toggle-switch .toggle-slider::after,
[data-theme="light"] .aais-toggle-slider::after {
  background: rgba(100,116,139,0.75);
}

/* ─── Badge neutral ──────────────────────────────────────────── */
[data-theme="light"] .badge-neutral {
  background: rgba(0,0,0,0.06);
  color: #475569;
}

/* ─── Audit row hover ────────────────────────────────────────── */
[data-theme="light"] .audit-row:hover {
  background: #f8fafc;
}

/* ─── Category rows ──────────────────────────────────────────── */
[data-theme="light"] .cat-row {
  border-bottom-color: #f1f5f9;
}

/* ─── Pattern cards ──────────────────────────────────────────── */
[data-theme="light"] .pattern-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

/* ─── Threat timeline ────────────────────────────────────────── */
[data-theme="light"] .threat-event {
  border-bottom-color: #f1f5f9;
}
[data-theme="light"] .threat-event-line {
  background: #e2e8f0;
}

/* ─── Trust hero card ────────────────────────────────────────── */
[data-theme="light"] .trust-hero {
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.04));
  border-color: rgba(99,102,241,0.15);
}
[data-theme="light"] .trust-hero::before {
  background: radial-gradient(circle, rgba(99,102,241,0.06), transparent 70%);
}

/* ─── Sort buttons ───────────────────────────────────────────── */
[data-theme="light"] .sort-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .sort-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

/* ─── Dropdown shadow ────────────────────────────────────────── */
[data-theme="light"] .dropdown-menu {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
[data-theme="light"] * {
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.18);
}

/* ─── Grade badges — better contrast on white ────────────────── */
[data-theme="light"] .grade-badge.grade-a-plus { background: rgba(16,185,129,0.12); box-shadow: none; }
[data-theme="light"] .grade-badge.grade-f       { background: rgba(239,68,68,0.12); box-shadow: none; }

/* ─── Status dots — subtle glow on white ────────────────────── */
[data-theme="light"] .status-dot.success { box-shadow: 0 0 5px rgba(16,185,129,0.35); }
[data-theme="light"] .status-dot.blocked { box-shadow: 0 0 5px rgba(239,68,68,0.35); }
[data-theme="light"] .status-dot.warning { box-shadow: 0 0 5px rgba(245,158,11,0.35); }

/* ─── Empty state art ────────────────────────────────────────── */
[data-theme="light"] .empty-art {
  background: rgba(99,102,241,0.06);
  border-color: rgba(99,102,241,0.2);
}

/* ─── Time Tabs (SDK Overview) ────────────────────────────── */
.time-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.time-tab:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--primary);
}
.time-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Event Cards (Events Timeline) ───────────────────────── */
.event-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ─── Filter Groups ────────────────────────────────────────── */
.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ─── Data Tables Enhancement ──────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.data-table tbody tr {
  transition: background 0.2s;
}
.data-table tbody tr:hover {
  background: var(--surface-2);
}

/* ─── Session Replay Controls ────────────────────────────────── */
.replay-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--surface-glass);
  border-radius: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.replay-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
}
.replay-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.replay-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.replay-btn i {
  font-size: 16px;
}
#replay-slider {
  flex: 1;
  min-width: 200px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  outline: none;
  -webkit-appearance: none;
}
#replay-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}
#replay-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}
#replay-time {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
}
#replay-speed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.replay-event-active {
  border-left: 3px solid var(--primary) !important;
  background: rgba(99,102,241,0.08) !important;
  box-shadow: 0 0 12px rgba(99,102,241,0.15);
}
.replay-event-future {
  opacity: 0.3;
  filter: grayscale(0.5);
}
.state-inspector {
  background: var(--surface-glass);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid rgba(99,102,241,0.15);
  animation: inspector-slide-in 0.3s ease-out;
}
@keyframes inspector-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.inspector-section {
  margin-bottom: 16px;
}
.inspector-section:last-child {
  margin-bottom: 0;
}
.inspector-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inspector-content {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: var(--text);
  max-height: 200px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Consolas', monospace;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.inspector-metadata {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  font-size: 12px;
}
.inspector-metadata-item {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px 10px;
}
.inspector-metadata-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.inspector-metadata-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.inspector-flags {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inspector-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.inspector-flag i {
  font-size: 14px;
}
.inspector-flag.warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);
}
.inspector-flag.safe {
  background: rgba(16,185,129,0.12);
  color: var(--success);
}

/* ─── Agent Flow Visualization ────────────────────────────────── */
.flow-visualization {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  flex-shrink: 0;
}
.flow-node-box {
  background: rgba(99,102,241,0.12);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(99,102,241,0.2);
}
.flow-node-events {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
}
.flow-arrow {
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

/* Light theme overrides */
[data-theme="light"] .replay-controls {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
[data-theme="light"] #replay-slider {
  background: #e2e8f0;
}
[data-theme="light"] .state-inspector {
  background: #ffffff;
  border-color: rgba(99,102,241,0.2);
}
[data-theme="light"] .inspector-content {
  background: #f8fafc;
}
[data-theme="light"] .inspector-metadata-item {
  background: #f8fafc;
}
[data-theme="light"] .inspector-flag {
  background: #f8fafc;
}
[data-theme="light"] .flow-visualization {
  background: #f8fafc;
}
[data-theme="light"] .flow-node-box {
  background: rgba(99,102,241,0.08);
}

/* ─── Mobile Responsive Fixes ──────────────────────────────── */
@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .filter-group {
    width: 100%;
  }
  .time-tab {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ─── Demo Mode Toggle — Discord-style ────────────────────── */
.demo-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
}
.demo-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.demo-switch input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.demo-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 3px;
}
.demo-slider::after {
  content: '✕';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: rgba(148,163,184,0.7);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34,1.2,0.64,1), background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transform: translateX(0);
}
.demo-switch input:checked + .demo-slider { background: #6366f1; border-color: #6366f1; }
.demo-switch input:checked + .demo-slider::after { content: '✓'; background: #fff; color: #6366f1; font-size: 10px; transform: translateX(20px); }
.demo-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.demo-banner {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: white;
  text-align: center;
  padding: 6px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}
.demo-banner.active { display: block; }
@media (min-width: 768px) {
  .demo-banner { left: var(--sidebar-w, 240px); }
}

/* ── Spotlights ─────────────────────────────────── */
.spotlight-dot {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #6366f1;
  border-radius: 50%;
  animation: spotlightPulse 2s ease-in-out infinite;
  z-index: 10;
}
@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); }
}
.spotlight-tooltip {
  position: fixed;
  z-index: 10000;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: fadeIn 0.2s ease;
}
.spotlight-tooltip p { 
  margin: 0 0 10px; 
  font-size: 13px; 
  line-height: 1.4;
  color: var(--text);
}
.spotlight-tooltip-actions { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.spotlight-try { 
  color: white; 
  font-weight: 600; 
  font-size: 13px; 
  text-decoration: none;
  background: #6366f1;
  padding: 8px 16px;
  border-radius: 6px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.spotlight-try:hover, .spotlight-try:active {
  background: #5558e6;
}
.spotlight-dismiss {
  background: rgba(255,255,255,0.06); 
  border: 1px solid var(--border); 
  border-radius: 6px;
  color: var(--text-2); 
  font-size: 13px;
  font-weight: 500;
  cursor: pointer; 
  padding: 8px 16px;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.spotlight-dismiss:hover, .spotlight-dismiss:active { 
  color: var(--text);
  background: rgba(255,255,255,0.1);
}

/* ── Getting Started Page ──────────────────────── */
.gs-container { 
  max-width: 900px; 
  margin: 0 auto; 
  padding: 20px; 
}
.gs-welcome { 
  text-align: center; 
  margin-bottom: 32px; 
}
.gs-welcome h1 { 
  font-size: 28px; 
  margin-bottom: 8px;
  color: var(--text);
}
.gs-subtitle { 
  color: var(--text-muted); 
  font-size: 16px; 
}

.gs-role-selector { 
  text-align: center; 
  margin-bottom: 32px; 
}
.gs-role-selector h3 {
  color: var(--text);
  margin-bottom: 8px;
}
.gs-role-selector > p {
  color: var(--text-muted);
  margin-bottom: 16px;
}
.gs-role-cards { 
  display: flex; 
  gap: 16px; 
  justify-content: center; 
  margin-top: 16px; 
  flex-wrap: wrap; 
}
.gs-role-card {
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 8px;
  padding: 24px 20px; 
  border-radius: 16px;
  background: var(--surface-glass); 
  border: 2px solid var(--border);
  cursor: pointer; 
  transition: all 0.2s; 
  min-width: 160px;
}
.gs-role-card:hover { 
  border-color: #6366f1; 
  transform: translateY(-2px); 
}
.gs-role-card.selected { 
  border-color: #6366f1; 
  background: rgba(99,102,241,0.1); 
}
.gs-role-title { 
  font-weight: 700; 
  font-size: 15px;
  color: var(--text);
}
.gs-role-desc { 
  font-size: 12px; 
  color: var(--text-muted); 
  text-align: center; 
}

.gs-demo-cta {
  display: flex; 
  align-items: center; 
  gap: 16px;
  padding: 20px; 
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.1));
  border: 1px solid rgba(139,92,246,0.2);
  margin-bottom: 32px;
}
.gs-demo-icon { 
  flex-shrink: 0; 
}
.gs-demo-text { 
  flex: 1; 
}
.gs-demo-text h3 { 
  margin: 0 0 4px; 
  font-size: 16px;
  color: var(--text);
}
.gs-demo-text p { 
  margin: 0; 
  font-size: 13px; 
  color: var(--text-muted); 
}
.gs-demo-btn { 
  white-space: nowrap; 
}

.gs-progress-section { 
  margin-bottom: 32px; 
}
.gs-progress-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 8px; 
}
.gs-progress-header h3 { 
  margin: 0; 
  font-size: 16px;
  color: var(--text);
}
.gs-progress-count { 
  font-size: 13px; 
  color: var(--text-muted); 
}
.gs-progress-bar { 
  height: 8px; 
  background: var(--border); 
  border-radius: 4px; 
  overflow: hidden; 
}
.gs-progress-fill { 
  height: 100%; 
  background: linear-gradient(90deg, #6366f1, #8b5cf6); 
  border-radius: 4px; 
  transition: width 0.5s; 
}

.gs-checklist-section { 
  margin-bottom: 24px; 
}
.gs-difficulty { 
  font-size: 14px; 
  font-weight: 600; 
}
.gs-checklist { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  margin-top: 12px; 
}

.gs-task {
  display: flex; 
  align-items: center; 
  gap: 12px;
  padding: 12px 16px; 
  border-radius: 12px;
  background: var(--surface-glass); 
  border: 1px solid var(--border);
  cursor: pointer; 
  transition: all 0.2s;
}
.gs-task:hover { 
  border-color: #6366f1; 
  transform: translateX(2px);
}
.gs-task.completed { 
  opacity: 0.6; 
}
.gs-task-check { 
  width: 22px; 
  height: 22px; 
  border-radius: 50%; 
  border: 2px solid var(--border); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-shrink: 0; 
}
.gs-task.completed .gs-task-check { 
  background: #22c55e; 
  border-color: #22c55e; 
  color: white; 
}
.gs-task-info { 
  flex: 1; 
}
.gs-task-label { 
  font-weight: 600; 
  font-size: 14px;
  color: var(--text);
}
.gs-task-desc { 
  font-size: 12px; 
  color: var(--text-muted); 
  margin-top: 2px; 
}
.gs-task-arrow { 
  color: var(--text-muted); 
  font-size: 16px;
}

.gs-badges-section { 
  margin-bottom: 32px; 
}
.gs-badges-section h3 {
  color: var(--text);
  margin-bottom: 12px;
}
.gs-badges { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
  margin-top: 12px; 
}
.gs-badge {
  padding: 8px 16px; 
  border-radius: 20px;
  background: var(--surface-glass); 
  border: 1px solid var(--border);
  font-size: 13px; 
  display: flex; 
  align-items: center; 
  gap: 6px;
}
.gs-badge.earned { 
  background: rgba(99,102,241,0.1); 
  border-color: #6366f1; 
}
.gs-badge.locked { 
  opacity: 0.4; 
}

.gs-quick-links { 
  margin-bottom: 32px; 
}
.gs-quick-links h3 {
  color: var(--text);
  margin-bottom: 12px;
}
.gs-quick-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
  gap: 12px; 
  margin-top: 12px; 
}
.gs-quick-card {
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 8px;
  padding: 20px; 
  border-radius: 12px;
  background: var(--surface-glass); 
  border: 1px solid var(--border);
  text-decoration: none; 
  color: var(--text); 
  transition: all 0.2s;
  font-size: 13px; 
  font-weight: 600;
}
.gs-quick-card i { 
  font-size: 28px; 
}
.gs-quick-card:hover { 
  border-color: #6366f1; 
  transform: translateY(-2px); 
}

@media (max-width: 768px) {
  .gs-container {
    padding: 16px;
  }
  .gs-welcome h1 {
    font-size: 24px;
  }
  .gs-role-cards {
    flex-direction: column;
  }
  .gs-role-card {
    min-width: 100%;
  }
  .gs-demo-cta {
    flex-direction: column;
    text-align: center;
  }
  .gs-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Toggle Switch (policies page) — Discord-style */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-switch .toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 3px;
}
.toggle-switch .toggle-slider::before { display: none; }
.toggle-switch .toggle-slider::after {
  content: '✕';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: rgba(148,163,184,0.7);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34,1.2,0.64,1), background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transform: translateX(0);
}
.toggle-switch input:checked + .toggle-slider { background: #6366f1; border-color: #6366f1; }
.toggle-switch input:checked + .toggle-slider::after { content: '✓'; background: #fff; color: #6366f1; font-size: 10px; transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid #6366f1; outline-offset: 2px; }

/* === Onboarding System === */

/* Progress Bar */
.onboarding-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  min-height: 60px;
  overflow: visible;
}
.onboarding-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Onboarding Welcome */
.onboarding-welcome {
  text-align: center;
  padding: 40px 20px 32px;
}
.onboarding-welcome h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}
.onboarding-welcome p {
  font-size: 15px;
  color: var(--text-3);
}

/* Step Cards */
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.onboarding-step:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.onboarding-step.completed {
  border-left: 3px solid #10b981;
}
.onboarding-step-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.onboarding-step-info {
  flex: 1;
  min-width: 0;
}
.onboarding-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.onboarding-step-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.onboarding-step-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.onboarding-step-badge.complete {
  background: rgba(16,185,129,0.15);
  color: #10b981;
}
.onboarding-step-badge.action {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  cursor: pointer;
}

/* Dashboard Banner */
.onboarding-banner {
  margin-bottom: 16px;
  animation: slideDown 0.3s ease;
}
.onboarding-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 12px;
}
.onboarding-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.onboarding-banner-text { flex: 1; }
.onboarding-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.onboarding-banner-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.onboarding-banner-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.onboarding-banner-cta {
  white-space: nowrap;
}
.onboarding-banner-dismiss {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}
.onboarding-banner-dismiss:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

/* Help Panel */
.help-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 20px;
  box-shadow: -8px 0 32px rgba(0,0,0,0.3);
}
.help-panel.open { right: 0; }
.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.help-panel-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.help-panel-header button {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.help-search {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 20px;
  outline: none;
}
.help-section { margin-bottom: 20px; }
.help-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.help-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  margin-bottom: 2px;
}
.help-link:hover { background: rgba(255,255,255,0.04); }
.help-link i:first-child { font-size: 20px; flex-shrink: 0; }
.help-link div { flex: 1; }
.help-link strong { font-size: 13px; display: block; }
.help-link span { font-size: 11px; color: var(--text-3); }
.help-link i:last-child { font-size: 14px; color: var(--text-3); }

.help-whatsnew-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.help-whatsnew-item h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 6px 0 4px;
}
.help-whatsnew-item p {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* Blue Dot for new features */
.nav-item .blue-dot {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  position: absolute;
  top: 8px;
  right: 8px;
  box-shadow: 0 0 6px rgba(59,130,246,0.5);
  animation: pulse-dot 2s ease infinite;
}
.nav-item { position: relative; }

/* Onboarding nav badge */
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(99,102,241,0.15);
  color: #6366f1;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Feature Toast */
.feature-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1001;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-toast-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.feature-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.feature-toast-dismiss {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
}
.feature-toast-body {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 12px;
}
.feature-toast-actions {
  display: flex;
  gap: 8px;
}

/* Celebration animation */
.celebration-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: celebrate 1.5s ease forwards;
  pointer-events: none;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
@keyframes celebrate {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

/* Help button in header */
.help-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.help-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: rgba(99,102,241,0.3);
}

/* Empty state upgrades */
.empty-state-premium {
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 0 auto;
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 40px var(--glow-color, rgba(99,102,241,0.2));
}
.empty-state-premium h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state-premium p {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 24px;
}
.empty-state-code {
  background: #0a0a12;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: left;
  margin-bottom: 24px;
  position: relative;
}
.empty-state-code pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
}
.empty-state-code .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}
.empty-state-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* === Expandable Onboarding Steps === */
.onboarding-step-expandable {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.onboarding-step-expandable:hover {
  border-color: rgba(99,102,241,0.25);
}
.onboarding-step-expandable.completed {
  border-left: 3px solid #10b981;
}
.onboarding-step-expandable.expanded {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.onboarding-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  transition: background 0.15s;
}
.onboarding-step-header:hover {
  background: rgba(255,255,255,0.02);
}

/* Step expand content */
.step-expand {
  border-top: 1px solid var(--border);
  padding: 0 18px 18px;
  animation: slideDown 0.2s ease;
}
.step-expand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.step-expand-body {
  /* content container */
}

/* Tabs */
.step-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
}
.step-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.step-tab:hover { color: var(--text-2); }
.step-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.step-tab i { font-size: 14px; }

/* Code blocks */
.step-code-section { margin-bottom: 10px; }
.step-code-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.step-code-block {
  background: #0a0a12;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #e2e8f0;
  overflow-x: auto;
}
.step-code-block pre {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
.step-code-block code {
  font-family: inherit;
}
.step-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text-3);
  font-size: 11px;
  font-family: inherit;
  padding: 4px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.step-copy-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* Success state */
.step-success {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 10px;
  padding: 14px;
}

/* Input */
.step-input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.step-input:focus {
  border-color: var(--primary);
}

/* Tip box */
.step-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.step-tip i { flex-shrink: 0; margin-top: 2px; }

/* Spinner animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ─── Mobile Bottom Navigation ──────────────────────────────── */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Hide sidebar on mobile */
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    z-index: 1000; /* Above mobile-bottom-nav (z-index: 900) so status widget is not hidden behind it */
  }

  /* Hide sidebar-footer status widget on mobile — it's covered by the bottom nav when sidebar is closed,
     and when the sidebar is open we don't need it since the user has the full nav visible */
  .sidebar-footer {
    display: none;
  }

  /* Adjust main content to not overlap bottom nav */
  .main-content {
    padding-bottom: 56px !important;
    margin-left: 0 !important;
  }

  /* Show bottom nav */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface, #12121f);
    border-top: 1px solid var(--border, rgba(255,255,255,0.07));
    z-index: 900;
    align-items: stretch;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-2, #94a3b8);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 150ms;
    padding: 4px 0;
    cursor: pointer;
  }

  .mobile-nav-item i {
    font-size: 22px;
    line-height: 1;
  }

  .mobile-nav-item.active,
  .mobile-nav-item:hover {
    color: #6366f1;
  }

  /* Topbar: shrink breadcrumbs on mobile */
  .topbar-breadcrumb { display: none; }
}

/* ─── Settings Page — Mobile Layout ────────────────────────── */
.settings-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 767px) {
  .settings-grid-2col {
    grid-template-columns: 1fr;
  }

  /* Full-width buttons on mobile */
  .settings-btn-mobile {
    width: 100% !important;
  }
}

/* Avatar color swatch row */
.avatar-color-swatches {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.avatar-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 150ms, border-color 150ms;
  flex-shrink: 0;
}

.avatar-color-swatch:hover {
  transform: scale(1.15);
}

.avatar-color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

/* Avatar section redesigned for mobile-first */
.settings-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 20px 14px 16px;
  background: rgba(99,102,241,0.06);
  border-radius: 10px;
  border: 1px solid rgba(99,102,241,0.12);
}

.settings-avatar-section .avatar-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #a5b4fc;
  cursor: pointer;
  transition: background 150ms;
}

.settings-avatar-section .avatar-upload-label:hover {
  background: rgba(99,102,241,0.25);
}

.settings-avatar-section .avatar-type-hint {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

/* ─── Premium Visual Polish ──────────────────────────────────
   Discord-inspired dark UI enhancements — v2.1
   Added 2026-03-25 for premium look & feel
   ─────────────────────────────────────────────────────────── */

/* button[type="submit"] — premium gradient polish */
button[type="submit"]:not(.btn-danger):not(.btn-secondary):not(.btn-ghost):not([class*="btn-"]),
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: all 0.2s var(--ease);
}
button[type="submit"]:not(.btn-danger):not(.btn-secondary):not(.btn-ghost):not([class*="btn-"]):hover,
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4) !important;
  transform: translateY(-1px);
}
button[type="submit"]:not(.btn-danger):not(.btn-secondary):not(.btn-ghost):not([class*="btn-"]):active,
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
}

/* Section headers — more breathing room */
.section-title,
.card-title,
.settings-section-title {
  margin-bottom: 16px;
}

/* Input fields in dashboard — softer dark fill */
.dash-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.dash-card select,
.dash-card textarea,
.main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(.search-input),
.main-content select:not(.search-input),
.main-content textarea {
  background: rgba(15, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.dash-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.dash-card select:focus,
.dash-card textarea:focus,
.main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.main-content select:focus,
.main-content textarea:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(15, 15, 28, 0.9);
}

/* Sidebar logo area — subtle top gradient accent */
.sidebar-logo {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
}

/* Nav section labels — slightly more padding */
.nav-section-label {
  padding-top: 16px;
  padding-bottom: 8px;
}

/* Light theme overrides — don't apply dark gradients */
[data-theme="light"] button[type="submit"]:not(.btn-danger):not(.btn-secondary):not(.btn-ghost):not([class*="btn-"]),
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
}
[data-theme="light"] .dash-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
[data-theme="light"] .dash-card select,
[data-theme="light"] .dash-card textarea,
[data-theme="light"] .main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
[data-theme="light"] .main-content select,
[data-theme="light"] .main-content textarea {
  background: var(--bg-alt);
  border-color: var(--border);
}
