/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #060b14;
  color: #e2e8f0;
  height: 100vh;
  overflow: hidden;
}
.hidden { display: none !important; }
.accent { color: #00d4ff; }

/* ─── Login ─── */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  background: #060b14;
  z-index: 100;
  overflow-y: auto;
}
#threat-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.3;
}
.login-overlay {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 16px;
  padding: 40px 24px;
  max-width: 420px; width: 100%;
  min-height: 100vh;
  justify-content: center;
}
.login-brand {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.login-logo { width: 64px; height: 64px; filter: drop-shadow(0 0 18px rgba(0,212,255,0.45)); }
.login-wordmark {
  font-size: 36px; font-weight: 700; letter-spacing: -1px;
  color: #f1f5f9;
  text-shadow: 0 0 40px rgba(0,212,255,0.25);
}
.login-headline {
  font-size: 32px; font-weight: 700; line-height: 1.2;
  color: #f1f5f9; letter-spacing: -0.8px;
}
.login-sub { font-size: 13px; color: #64748b; letter-spacing: 0.5px; text-transform: uppercase; }
.login-card {
  width: 100%; background: rgba(15,23,42,0.85);
  border: 1px solid #1e293b; border-radius: 12px;
  padding: 24px; backdrop-filter: blur(12px);
  margin-top: 8px;
}
.login-card-header { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: #64748b; text-transform: uppercase; margin-bottom: 20px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .form-group { text-align: left; }
.login-form label { display: block; font-size: 11px; font-weight: 500; color: #94a3b8; margin-bottom: 6px; }
.login-form input { width: 100%; background: #0f172a; border: 1px solid #1e293b; border-radius: 7px; padding: 9px 12px; color: #e2e8f0; font-size: 13px; transition: border-color 0.15s; }
.login-form input:focus { outline: none; border-color: #00d4ff; }
.btn-login {
  width: 100%; padding: 10px;
  background: #00d4ff; color: #060b14;
  font-weight: 600; font-size: 13px;
  border: none; border-radius: 7px; cursor: pointer;
  transition: opacity 0.15s;
}
.btn-login:hover { opacity: 0.9; }
.login-hint { font-size: 11px; color: #334155; }
.login-links {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-links-sep { color: #334155; font-size: 12px; }
.btn-forgot {
  background: none; border: none;
  font-size: 12px; color: #475569; cursor: pointer;
  font-family: inherit; padding: 4px 0;
  transition: color 0.15s; text-align: center;
}
.btn-forgot:hover { color: #00d4ff; }
.twofa-icon {
  display: flex; justify-content: center;
  margin: 8px 0 14px;
}
.twofa-icon svg { width: 48px; height: 48px; }
.twofa-desc {
  font-size: 12px; color: #64748b; line-height: 1.5;
  text-align: center; margin-bottom: 16px;
}
.login-footer { font-size: 11px; color: #334155; margin-top: 4px; }

/* ─── App Layout ─── */
.app { display: flex; height: 100vh; width: 100vw; }

/* ─── Sidebar ─── */
.sidebar {
  width: 220px; min-width: 220px;
  background: #0a1120;
  border-right: 1px solid #1e293b;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  padding: 0 0 16px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 4px;
}
.sidebar-logo { width: 32px; height: 32px; flex-shrink: 0; }
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-name { font-size: 12px; font-weight: 600; color: #f1f5f9; }
.sidebar-tier { font-size: 9px; font-weight: 500; color: #475569; letter-spacing: 0.5px; margin-top: 1px; }

.sidebar-section-label {
  font-size: 9px; font-weight: 600; letter-spacing: 1px;
  color: #334155; text-transform: uppercase;
  padding: 14px 14px 6px;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 0 8px; }

.nav-item, a.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px; font-weight: 500; color: #64748b;
  background: none; border: none; cursor: pointer;
  width: 100%; text-align: left;
  transition: all 0.15s;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
a.nav-item { text-decoration: none; cursor: pointer; }
a.nav-child { text-decoration: none; cursor: pointer; }
.nav-item:hover { background: #111827; color: #cbd5e1; }
.nav-item.active { background: #0f2040; color: #00d4ff; }
.nav-item.has-children { justify-content: space-between; }
.nav-item.has-children > svg:first-child { flex-shrink: 0; }
.nav-item .chevron { width: 14px; height: 14px; margin-left: auto; transition: transform 0.2s; }
.nav-item.open .chevron { transform: rotate(180deg); }

.nav-children {
  display: none; flex-direction: column; gap: 1px;
  padding: 2px 0 2px 26px;
}
.nav-children.open { display: flex; }

.nav-child {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px; font-weight: 400; color: #475569;
  background: none; border: none; cursor: pointer;
  width: 100%; text-align: left;
  transition: all 0.15s;
}
.nav-child:hover { background: #111827; color: #cbd5e1; }
.nav-child.active { color: #00d4ff; background: #0f2040; }

/* Integrity Credits Widget */
.sidebar-credits {
  margin: 16px 10px 0;
  background: #0d1b2e;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px;
}
.credits-header {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: #94a3b8;
  margin-bottom: 6px;
}
.credits-header svg { width: 13px; height: 13px; }
.credits-sub { font-size: 11px; color: #475569; margin-bottom: 8px; line-height: 1.4; }
.credits-bar-track { height: 4px; background: #1e293b; border-radius: 2px; }
.credits-bar-fill { height: 4px; background: #00d4ff; border-radius: 2px; }

.sidebar-version { font-size: 10px; color: #1e293b; padding: 12px 14px 0; }

/* ─── Main Wrapper ─── */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ─── Topbar ─── */
.topbar {
  height: 52px;
  background: #080f1e;
  border-bottom: 1px solid #1e293b;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: #0f172a; border: 1px solid #1e293b;
  border-radius: 8px; padding: 6px 12px;
  width: 360px;
}
.topbar-search svg { width: 15px; height: 15px; color: #475569; flex-shrink: 0; }
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 13px; color: #94a3b8;
  font-family: inherit;
}
.topbar-search input::placeholder { color: #334155; }
.kbd {
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  background: #1e293b; color: #475569;
  padding: 2px 5px; border-radius: 4px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-icon {
  width: 32px; height: 32px;
  background: none; border: none; cursor: pointer;
  color: #475569; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; position: relative;
}
.topbar-icon svg { width: 17px; height: 17px; }
.topbar-icon:hover { background: #111827; color: #94a3b8; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 14px; height: 14px;
  background: #ef4444; border-radius: 50%;
  font-size: 8px; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center;
}
.topbar-avatar {
  width: 32px; height: 32px;
  background: #1d4ed8; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.user-menu {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #0d1b2e; border: 1px solid #1e293b; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 200px; z-index: 200;
  overflow: hidden;
}
.user-menu.open { display: block; }
.user-menu-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px;
}
.user-menu-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #1d4ed8; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-menu-name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.user-menu-email { font-size: 11px; color: #475569; margin-top: 1px; }
.user-menu-divider { border: none; border-top: 1px solid #1e293b; margin: 2px 0; }
.user-menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 14px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: #94a3b8; font-family: inherit;
  text-align: left; transition: background 0.1s, color 0.1s;
}
.user-menu-item:hover { background: rgba(255,255,255,0.04); color: #e2e8f0; }
.user-menu-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.user-menu-item.danger { color: #f87171; }
.user-menu-item.danger:hover { background: rgba(239,68,68,0.08); color: #fca5a5; }

/* ─── Topbar Panels ─── */
.topbar-panel {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #0d1b2e; border: 1px solid #1e293b; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 220px; z-index: 200; overflow: hidden;
}
.topbar-panel.open { display: block; }
.topbar-panel-title {
  font-size: 11px; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 12px 14px 8px;
}
.topbar-panel-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; font-size: 12px; color: #94a3b8;
  cursor: pointer; transition: background 0.1s, color 0.1s;
}
.topbar-panel-item:hover { background: rgba(255,255,255,0.04); color: #e2e8f0; }
.topbar-panel-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.topbar-panel-divider { border: none; border-top: 1px solid #1e293b; margin: 4px 0; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #0f1e30;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item:last-child { border-bottom: none; }
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #00d4ff; flex-shrink: 0; margin-top: 4px;
}
.notif-item:not(.unread) .notif-dot { background: transparent; }
.notif-msg { font-size: 12px; color: #cbd5e1; line-height: 1.4; }
.notif-time { font-size: 11px; color: #475569; margin-top: 2px; }

/* ─── Subscriptions ─── */
.subs-app-legend {
  display: flex; gap: 24px; margin-bottom: 16px; flex-wrap: wrap;
}
.subs-legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #64748b;
}
.subs-table th, .subs-table td { vertical-align: middle; }
.toggle-btn {
  width: 36px; height: 20px; border-radius: 10px;
  border: none; cursor: pointer; padding: 2px;
  display: inline-flex; align-items: center;
  transition: background 0.2s;
  position: relative;
}
.toggle-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.toggle-on { background: #00d4ff; justify-content: flex-end; }
.toggle-off { background: #1e293b; justify-content: flex-start; }
.toggle-knob {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ─── Page Content ─── */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

.page { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Dashboard Header ─── */
.page-header { margin-bottom: 24px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.8px;
  color: #64748b; text-transform: uppercase; margin-bottom: 10px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.green { background: #22c55e; box-shadow: 0 0 6px #22c55e88; }
.status-dot.yellow { background: #f59e0b; }
.status-dot.red { background: #ef4444; }
.status-dot.sm { width: 6px; height: 6px; }

.greeting { font-size: 32px; font-weight: 700; letter-spacing: -0.8px; color: #f1f5f9; margin-bottom: 8px; }
.greeting-sub { font-size: 14px; color: #64748b; line-height: 1.5; max-width: 600px; margin-bottom: 16px; }
.greeting-sub strong { color: #e2e8f0; }
.greeting-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-chip {
  display: flex; align-items: center; gap: 0;
  background: #0f172a; border: 1px solid #1e293b;
  border-radius: 7px; padding: 5px 10px;
  font-size: 12px;
}
.meta-label { color: #475569; margin-right: 6px; }
.meta-val { color: #94a3b8; font-weight: 500; }
.btn-new-monitor {
  display: flex; align-items: center; gap: 6px;
  background: #00d4ff; color: #060b14;
  font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 7px;
  border: none; cursor: pointer; transition: opacity 0.15s;
}
.btn-new-monitor svg { width: 13px; height: 13px; }
.btn-new-monitor:hover { opacity: 0.9; }

/* ─── KPI Grid ─── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.kpi-card {
  background: #0d1b2e;
  border: 1px solid #1e293b;
  border-radius: 12px; padding: 16px;
  position: relative; overflow: hidden;
}
.kpi-label { font-size: 10px; font-weight: 600; letter-spacing: 0.8px; color: #475569; text-transform: uppercase; margin-bottom: 8px; }
.kpi-value { font-size: 22px; font-weight: 700; color: #f1f5f9; letter-spacing: -0.5px; margin-bottom: 10px; }
.kpi-unit { font-size: 13px; font-weight: 400; color: #475569; }
.kpi-delta { font-size: 11px; font-weight: 500; }
.kpi-delta.up { color: #22c55e; }
.kpi-delta.down { color: #ef4444; }
.sparkline { display: block; width: 100%; height: 32px; }

/* ─── Section Header ─── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  color: #64748b; text-transform: uppercase;
}
.section-dot { width: 6px; height: 6px; border-radius: 50%; background: #00d4ff; }
.manage-link {
  font-size: 12px; color: #00d4ff; background: none; border: none;
  cursor: pointer; font-family: inherit; font-weight: 500;
}
.manage-link:hover { text-decoration: underline; }

/* ─── App Cards ─── */
.apps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 24px;
}
.app-card {
  background: #0d1b2e; border: 1px solid #1e293b;
  border-radius: 14px; padding: 18px;
  cursor: pointer; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
/* Default hover — generic lift */
.app-card:hover { border-color: #2d3f5c; transform: translateY(-2px); }

/* Per-app hover glow */
.app-card[data-app="link-submission"]:hover {
  border-color: rgba(129,140,248,0.6) !important;
  box-shadow: 0 6px 28px rgba(129,140,248,0.18), inset 0 0 0 1px rgba(129,140,248,0.12) !important;
  background: linear-gradient(135deg, #111830 0%, #0d1b2e 100%) !important;
  transform: translateY(-2px);
}
.app-card[data-app="mark-me"]:hover {
  border-color: rgba(167,139,250,0.6) !important;
  box-shadow: 0 6px 28px rgba(167,139,250,0.18), inset 0 0 0 1px rgba(167,139,250,0.12) !important;
  background: linear-gradient(135deg, #160e30 0%, #0d1b2e 100%) !important;
  transform: translateY(-2px);
}
.app-card[data-app="chiltern"]:hover {
  border-color: rgba(52,211,153,0.6) !important;
  box-shadow: 0 6px 28px rgba(52,211,153,0.15), inset 0 0 0 1px rgba(52,211,153,0.12) !important;
  background: linear-gradient(135deg, #0c201a 0%, #0d1b2e 100%) !important;
  transform: translateY(-2px);
}
.app-card[data-app="intelligence"]:hover {
  border-color: rgba(249,115,22,0.6) !important;
  box-shadow: 0 6px 28px rgba(249,115,22,0.15), inset 0 0 0 1px rgba(249,115,22,0.12) !important;
  background: linear-gradient(135deg, #1c1208 0%, #0d1b2e 100%) !important;
  transform: translateY(-2px);
}
.app-card[data-app="social-media"]:hover {
  border-color: rgba(56,189,248,0.6) !important;
  box-shadow: 0 6px 28px rgba(56,189,248,0.15), inset 0 0 0 1px rgba(56,189,248,0.12) !important;
  background: linear-gradient(135deg, #0c1820 0%, #0d1b2e 100%) !important;
  transform: translateY(-2px);
}
.app-card.access-off:hover { box-shadow: none !important; border-color: #1e293b !important; background: #0d1b2e !important; transform: none !important; }
.app-card.featured {
  background: linear-gradient(135deg, #1a103a 0%, #0f172a 60%, #0d1b2e 100%);
  border-color: #3b1fa3;
}
.app-card.featured:hover { border-color: #6d4fc5; }
.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.app-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
}
.app-icon svg { width: 26px; height: 26px; }
.app-icon.sm { width: 34px; height: 34px; border-radius: 9px; }
.app-icon.sm svg { width: 16px; height: 16px; }
.link-icon {
  background: rgba(129,140,248,0.1);
  border-color: rgba(129,140,248,0.2);
}
.mark-icon {
  background: rgba(167,139,250,0.1);
  border-color: rgba(167,139,250,0.2);
}
.chiltern-icon {
  background: rgba(52,211,153,0.1);
  border-color: rgba(52,211,153,0.2);
}
.intel-icon {
  background: rgba(249,115,22,0.1);
  border-color: rgba(249,115,22,0.2);
}
.social-icon {
  background: rgba(56,189,248,0.1);
  border-color: rgba(56,189,248,0.2);
}
/* Icon glows on card hover */
.app-card[data-app="link-submission"]:hover .app-icon {
  box-shadow: 0 0 16px rgba(129,140,248,0.25);
  border-color: rgba(129,140,248,0.45);
  transform: scale(1.06);
}
.app-card[data-app="mark-me"]:hover .app-icon {
  box-shadow: 0 0 16px rgba(167,139,250,0.25);
  border-color: rgba(167,139,250,0.45);
  transform: scale(1.06);
}
.app-card[data-app="chiltern"]:hover .app-icon {
  box-shadow: 0 0 16px rgba(52,211,153,0.25);
  border-color: rgba(52,211,153,0.45);
  transform: scale(1.06);
}
.app-card[data-app="intelligence"]:hover .app-icon {
  box-shadow: 0 0 16px rgba(249,115,22,0.25);
  border-color: rgba(249,115,22,0.45);
  transform: scale(1.06);
}
.app-card[data-app="social-media"]:hover .app-icon {
  box-shadow: 0 0 16px rgba(56,189,248,0.25);
  border-color: rgba(56,189,248,0.45);
  transform: scale(1.06);
}
.app-launch {
  width: 28px; height: 28px; border-radius: 7px;
  background: #111827; border: 1px solid #1e293b;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #475569; transition: all 0.15s;
}
.app-launch svg { width: 13px; height: 13px; }
.app-launch:hover { background: #1e293b; color: #94a3b8; }
.app-name { font-size: 15px; font-weight: 600; color: #f1f5f9; }
.app-desc { font-size: 12px; color: #475569; line-height: 1.5; flex: 1; }
.app-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.app-status { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: #22c55e; }
.app-stat { font-size: 11px; color: #334155; font-family: 'JetBrains Mono', monospace; }

/* ─── Bottom Grid ─── */
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ─── Cards ─── */
.card {
  background: #0d1b2e; border: 1px solid #1e293b;
  border-radius: 14px; overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #1e293b;
}
.card-title { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.card-sub { font-size: 11px; color: #475569; margin-top: 2px; }
.uptime-badge {
  display: flex; align-items: center; gap: 6px;
  background: #0a2e1a; border: 1px solid #166534;
  border-radius: 6px; padding: 4px 9px;
  font-size: 10px; font-weight: 600; color: #22c55e; letter-spacing: 0.5px;
}

/* Platform Status */
.status-list { padding: 8px 0; }
.status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 16px;
  transition: background 0.1s;
}
.status-row:hover { background: rgba(255,255,255,0.02); }
.status-name { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; }
.status-bar-icon { font-size: 9px; letter-spacing: -1px; }
.status-op { font-size: 11px; font-weight: 500; }
.status-op.operational { color: #22c55e; }
.status-op.degraded { color: #f59e0b; }

/* Signal Feed */
.live-badge {
  display: flex; align-items: center; gap: 6px;
  background: #0a1a0f; border: 1px solid #1a3a20;
  border-radius: 6px; padding: 4px 9px;
  font-size: 10px; font-weight: 600; color: #22c55e; letter-spacing: 0.5px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.signal-list { padding: 6px 0; }
.signal-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #0f1e30;
  transition: background 0.1s;
}
.signal-row:last-child { border-bottom: none; }
.signal-row:hover { background: rgba(255,255,255,0.02); }
.signal-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.signal-icon svg { width: 14px; height: 14px; }
.link-bg { background: rgba(129,140,248,0.1); }
.mark-bg { background: rgba(167,139,250,0.1); }
.plus-bg { background: rgba(251,191,36,0.1); }
.chiltern-bg { background: rgba(52,211,153,0.1); }
.search-bg { background: rgba(148,163,184,0.1); }
.signal-body { flex: 1; }
.signal-body p { font-size: 12px; color: #94a3b8; line-height: 1.4; }
.signal-link { color: #00d4ff; font-weight: 500; }
.signal-meta { font-size: 10px; color: #334155; font-family: 'JetBrains Mono', monospace; margin-top: 3px; display: block; }

/* ─── Simple Page Header ─── */
.page-header-simple {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-header-simple h1 { font-size: 22px; font-weight: 700; color: #f1f5f9; letter-spacing: -0.4px; }
.page-header-actions { display: flex; gap: 8px; }

/* ─── Buttons ─── */
.btn-primary {
  padding: 9px 18px;
  background: #00d4ff; color: #060b14;
  font-size: 13px; font-weight: 600;
  border: none; border-radius: 8px; cursor: pointer;
  font-family: inherit; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  padding: 8px 14px;
  background: #111827; color: #94a3b8;
  font-size: 12px; font-weight: 500;
  border: 1px solid #1e293b; border-radius: 8px; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.btn-secondary:hover { background: #1e293b; color: #e2e8f0; }
.btn-ghost {
  padding: 9px 14px;
  background: none; color: #64748b;
  font-size: 13px; border: none; cursor: pointer;
  font-family: inherit; transition: color 0.15s;
}
.btn-ghost:hover { color: #94a3b8; }
.btn-danger {
  padding: 9px 18px;
  background: #ef4444; color: white;
  font-size: 13px; font-weight: 600;
  border: none; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.btn-xs {
  padding: 4px 10px;
  background: #111827; color: #64748b;
  font-size: 11px; border: 1px solid #1e293b;
  border-radius: 5px; cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.btn-xs:hover { background: #1e293b; color: #e2e8f0; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Forms ─── */
.form-card { padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 11px; font-weight: 500; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea {
  background: #0a1120; border: 1px solid #1e293b;
  border-radius: 8px; padding: 9px 12px;
  color: #e2e8f0; font-size: 13px; font-family: inherit;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #00d4ff; }
.form-group select option { background: #0f172a; }
.form-check { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.form-check input[type="checkbox"] { accent-color: #00d4ff; width: 14px; height: 14px; }
.form-check label { font-size: 12px; color: #64748b; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ─── Tables ─── */
.table-card { padding: 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 11px 14px; text-align: left;
  font-size: 10px; font-weight: 600; letter-spacing: 0.8px;
  color: #475569; text-transform: uppercase;
  border-bottom: 1px solid #1e293b;
  background: #080f1e;
}
.data-table td {
  padding: 11px 14px; font-size: 12px; color: #94a3b8;
  border-bottom: 1px solid #0f1e30;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* ─── Badges ─── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-green { background: rgba(34,197,94,0.1); color: #22c55e; }
.badge-yellow { background: rgba(245,158,11,0.1); color: #f59e0b; }
.badge-red { background: rgba(239,68,68,0.1); color: #ef4444; }
.badge-blue { background: rgba(99,102,241,0.1); color: #818cf8; }
.badge-purple { background: rgba(167,139,250,0.1); color: #a78bfa; }

/* ─── User Status Summary Bar ─── */
.user-status-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.status-stat {
  background: #0d1b2e;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-stat-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.status-stat-dot.green  { background: #22c55e; box-shadow: 0 0 6px #22c55e55; }
.status-stat-dot.red    { background: #ef4444; box-shadow: 0 0 6px #ef444455; }
.status-stat-dot.yellow { background: #f59e0b; box-shadow: 0 0 6px #f59e0b55; }
.status-stat-dot.blue   { background: #818cf8; box-shadow: 0 0 6px #818cf855; }
.status-stat-info { display: flex; flex-direction: column; gap: 1px; }
.status-stat-value { font-size: 20px; font-weight: 700; color: #f1f5f9; letter-spacing: -0.5px; }
.status-stat-label { font-size: 10px; font-weight: 500; color: #475569; text-transform: uppercase; letter-spacing: 0.6px; }

/* ─── Upload / Dropzone ─── */
.upload-desc { font-size: 13px; color: #475569; margin-bottom: 16px; }
.upload-desc code { background: #111827; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #94a3b8; }
.dropzone {
  border: 2px dashed #1e293b; border-radius: 10px;
  padding: 40px; text-align: center;
  cursor: pointer; transition: border-color 0.15s;
  margin-bottom: 16px;
}
.dropzone:hover { border-color: #00d4ff; }
.dropzone svg { width: 48px; height: 48px; margin: 0 auto 12px; display: block; }
.dropzone p { font-size: 13px; color: #475569; }
.csv-preview { margin-top: 12px; }

/* ─── Training Cards ─── */
.cards-list { display: flex; flex-direction: column; gap: 12px; }
.training-card {
  display: flex; align-items: center; gap: 16px;
  background: #0d1b2e; border: 1px solid #1e293b;
  border-radius: 12px; padding: 16px;
}
.training-thumb {
  width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.training-thumb svg { width: 28px; height: 28px; }
.link-bg-soft { background: rgba(129,140,248,0.08); }
.mark-bg-soft { background: rgba(167,139,250,0.08); }
.chiltern-bg-soft { background: rgba(52,211,153,0.08); }
.training-info { flex: 1; }
.training-info h3 { font-size: 13px; font-weight: 600; color: #e2e8f0; margin-bottom: 4px; }
.training-info p { font-size: 12px; color: #475569; margin-bottom: 6px; }

/* ─── Modal ─── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6,11,20,0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.modal {
  background: #0d1b2e; border: 1px solid #1e293b;
  border-radius: 14px; padding: 24px;
  width: 360px;
}
.modal-title { font-size: 16px; font-weight: 700; color: #f1f5f9; margin-bottom: 10px; }
.modal-body { font-size: 13px; color: #64748b; margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; }

/* ─── User Row Actions ─── */
.user-actions { display: flex; gap: 6px; }
.action-btn {
  padding: 4px 9px;
  background: #0a1120; border: 1px solid #1e293b;
  border-radius: 5px; cursor: pointer; font-size: 11px;
  color: #64748b; font-family: inherit;
  transition: all 0.15s;
}
.action-btn:hover { color: #e2e8f0; border-color: #2d3f5c; }
.action-btn.danger { color: #ef4444; }
.action-btn.danger:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; }

/* ─── Chat FAB ─── */
#chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #0d1b2e 60%, #0a2040);
  border: 1.5px solid #00d4ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 0 0 0 rgba(0,212,255,0.4), 0 4px 20px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}
#chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(0,212,255,0.12), 0 8px 30px rgba(0,0,0,0.6);
}
.chat-fab-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 10px; height: 10px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #060b14;
}

/* ─── Chat Panel ─── */
.chat-panel {
  position: fixed;
  bottom: 92px;
  right: 28px;
  width: 360px;
  height: 520px;
  background: #060d1a;
  border: 1px solid #1a2d45;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 8999;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,212,255,0.08);
  animation: chatSlideIn 0.22s ease;
}
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Chat Header ─── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #0f1f35;
  background: #060d1a;
  flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 32px; height: 32px;
  background: rgba(0,212,255,0.07);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.chat-title { font-size: 13px; font-weight: 700; color: #e2e8f0; }
.chat-subtitle { font-size: 10px; color: #475569; margin-top: 1px; }
.chat-header-actions { display: flex; gap: 4px; }
.chat-icon-btn {
  width: 28px; height: 28px;
  background: transparent; border: none;
  border-radius: 7px; cursor: pointer;
  color: #475569;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.chat-icon-btn:hover { background: #0f1f35; color: #94a3b8; }

/* ─── Chat Messages ─── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }

/* ─── Welcome State ─── */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 8px;
}
.chat-welcome-icon {
  width: 52px; height: 52px;
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.chat-welcome-title { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-bottom: 6px; }
.chat-welcome-sub { font-size: 12px; color: #475569; line-height: 1.55; margin-bottom: 16px; }
.chat-starters { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.chat-starter {
  padding: 8px 12px;
  background: #0a1525;
  border: 1px solid #1a2d45;
  border-radius: 8px;
  color: #64748b;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.chat-starter:hover { border-color: rgba(0,212,255,0.3); color: #00d4ff; background: rgba(0,212,255,0.04); }

/* ─── Message Bubbles ─── */
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
}
.chat-msg.user { align-self: flex-end; align-items: flex-end; }
.chat-msg.ai { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.user .chat-bubble {
  background: rgba(0,212,255,0.12);
  border: 1px solid rgba(0,212,255,0.2);
  color: #e2e8f0;
  border-bottom-right-radius: 4px;
}
.chat-msg.ai .chat-bubble {
  background: #0a1525;
  border: 1px solid #1a2d45;
  color: #cbd5e1;
  border-bottom-left-radius: 4px;
}
.chat-msg-time {
  font-size: 10px;
  color: #334155;
  padding: 0 2px;
}

/* ─── Typing Indicator ─── */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: #0a1525;
  border: 1px solid #1a2d45;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 5px; height: 5px;
  background: #00d4ff;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ─── Chat Input ─── */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #0f1f35;
  background: #060d1a;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: #0a1525;
  border: 1px solid #1a2d45;
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 12.5px;
  font-family: inherit;
  padding: 9px 12px;
  resize: none;
  min-height: 36px;
  max-height: 100px;
  line-height: 1.5;
  transition: border-color 0.15s;
  overflow-y: auto;
}
.chat-input:focus { outline: none; border-color: rgba(0,212,255,0.35); }
.chat-input::placeholder { color: #334155; }
.chat-send-btn {
  width: 36px; height: 36px;
  background: #00d4ff;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  color: #060b14;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.chat-send-btn:hover { background: #00bfe8; transform: scale(1.05); }
.chat-send-btn:disabled { background: #1a2d45; color: #334155; cursor: not-allowed; transform: none; }

/* AI status dot */
.chat-subtitle.thinking { color: #00d4ff; }

/* ─── App Card Disabled State ─── */
.app-status.disabled { color: #475569; }
.app-status.disabled .status-dot { background: #334155 !important; box-shadow: none !important; }
.app-card.access-off { opacity: 0.45; pointer-events: none; }
.app-card.access-off .app-launch { pointer-events: none; }
