/* ══════════════════════════════════════════════════════════════════════════════
   ZelXDR · Dark Spectrum Edition
   Rocheston Security Platform
   ══════════════════════════════════════════════════════════════════════════════ */

/* Google Fonts loaded via <link> in layout head — not @import (avoids render-blocking) */

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  /* ── Brand palette ── */
  --accent:      #FFA42E;   /* primary orange accent */
  --accent-dim:  #cc7d1a;   /* darker accent for gradients */
  --accent-glow: rgba(255,164,46,0.25);

  /* ── Semantic color tokens (keep Gruvbox-named for badge/severity compat) ── */
  --gb-fg:       #f0e8d8;
  --gb-fg1:      #f0e8d8;
  --gb-fg2:      #ddd0b8;
  --gb-fg3:      #c4b498;
  --gb-fg4:      #a89880;

  --gb-red:      #cc241d;   --gb-red-b:    #fb4934;
  --gb-green:    #98971a;   --gb-green-b:  #b8bb26;
  --gb-yellow:   #cc7d1a;   --gb-yellow-b: #FFA42E;   /* accent drives yellow */
  --gb-blue:     #458588;   --gb-blue-b:   #83a598;
  --gb-purple:   #7c52aa;   --gb-purple-b: #a679d4;
  --gb-aqua:     #689d6a;   --gb-aqua-b:   #8ec07c;
  --gb-orange:   #cc7d1a;   --gb-orange-b: #FFA42E;
  --gb-gray:     #7a6e88;   --gb-gray-b:   #9a8eac;

  /* ── Surface system ── */
  --s0: #32012F;   /* sidebar / deepest: dark magenta */
  --s1: #451952;   /* page body: deep purple */
  --s2: #28162a;   /* cards / sections: very dark purple */
  --s3: #331c36;   /* hover / elevated */
  --s4: #1a0e1c;   /* borders */
  --s5: #211222;   /* muted borders */

  /* ── Layout ── */
  --sidebar-width:     256px;
  --sidebar-collapsed: 62px;
  --topnav-height:     56px;
  --content-padding:   24px;

  /* ── Semantic ── */
  --border:        rgba(255,255,255,0.12);
  --border-subtle: rgba(255,255,255,0.07);
  --border-focus:  var(--accent);
  --text-1: var(--gb-fg1);
  --text-2: var(--gb-fg2);
  --text-3: var(--gb-fg3);
  --text-4: var(--gb-fg4);

  /* ── Shadows ── */
  --shadow-xs:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.55);
  --shadow-md:  0 4px 18px rgba(0,0,0,0.6);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.65);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.75);

  /* ── Radii ── */
  --r-sm: 6px;   --r-md: 10px;   --r-lg: 14px;   --r-xl: 18px;   --r-full: 9999px;

  /* ── Motion ── */
  --ease: 0.16s ease;   --ease-slow: 0.3s ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--s1);
  color: var(--gb-fg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gb-blue-b); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--gb-yellow-b); }
img, svg { display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
code, pre { font-family: 'Fira Code', monospace; font-size: 0.875em; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--s2); }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--s5); }

/* ══════════════════════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

/* ══════════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--s0);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  transition: width var(--ease-slow);
  z-index: 100; overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-header { padding: 0; justify-content: center; gap: 0; }
.sidebar.collapsed .sidebar-brand  { display: none; }
.sidebar.collapsed #sidebarExpandAll { display: none; }
.sidebar.collapsed .sidebar-logo { display: none; }

/* ── Header ── */
.sidebar-header {
  display: flex; align-items: center; gap: 11px;
  padding: 0 15px;
  height: var(--topnav-height);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand { flex: 1; overflow: hidden; }
.sidebar-brand-name {
  font-size: 1.25rem; font-weight: 800; color: var(--gb-fg1);
  white-space: nowrap; letter-spacing: 0.5px;
}
.sidebar-brand-sub {
  font-size: 0.6rem; color: var(--gb-fg4);
  text-transform: uppercase; letter-spacing: 1.4px; margin-top: 1px;
}
.sidebar-toggle {
  background: none; border: none; color: var(--gb-fg4); padding: 4px;
  border-radius: var(--r-sm); transition: all var(--ease); flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--accent); background: rgba(255,164,46,0.12); }

/* ── Nav ── */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0 16px; }
.sidebar-nav::-webkit-scrollbar { width: 2px; }
.sidebar-copyright { padding: 10px 16px 14px; font-size: 0.68rem; color: var(--s4); text-align: center; letter-spacing: 0.03em; }
.sidebar.collapsed .sidebar-copyright { display: none; }

.nav-section { margin-bottom: 2px; }

.nav-section-header {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; margin: 0 6px;
  cursor: pointer; user-select: none;
  border-radius: var(--r-md);
  transition: background var(--ease);
  position: relative;
}
.nav-section-header:hover { background: rgba(235,219,178,0.07); }
.nav-section-header.open  { background: rgba(235,219,178,0.06); }

.nav-section-icon {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, currentColor 14%, transparent);
  transition: background var(--ease);
}
.nav-section-icon svg { width: 14px; height: 14px; }
.nav-section-header:hover .nav-section-icon {
  background: color-mix(in srgb, currentColor 22%, transparent);
}

.nav-section-label {
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--gb-fg3); flex: 1;
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--ease-slow);
}
.sidebar.collapsed .nav-section-label { opacity: 0; pointer-events: none; flex: 0; width: 0; overflow: hidden; padding: 0; margin: 0; }
.sidebar.collapsed .nav-section-header { padding: 8px 0; justify-content: center; margin: 0 8px; }

.nav-chevron {
  color: rgba(168,153,132,0.35);
  transition: transform var(--ease), color var(--ease); flex-shrink: 0;
}
.nav-section-header:hover .nav-chevron { color: rgba(168,153,132,0.6); }
.nav-section-header.open .nav-chevron { transform: rotate(90deg); }
.sidebar.collapsed .nav-chevron { display: none; }

.nav-section-items { padding: 2px 6px; display: none; }
.nav-section-items.open { display: block; }
.sidebar.collapsed .nav-section-items { display: none !important; }

.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 36px;
  border-radius: var(--r-sm);
  color: var(--gb-fg4); font-size: 0.88rem; font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all var(--ease); margin-bottom: 1px; position: relative;
}
.nav-item:hover { background: rgba(235,219,178,0.07); color: var(--gb-fg2); }
.nav-item.active {
  background: rgba(255,164,46,0.14);
  color: var(--accent); font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border-subtle); flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TOP NAV
   ══════════════════════════════════════════════════════════════════════════════ */
.topnav {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0;
  height: var(--topnav-height);
  background: rgba(69,25,82,0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  z-index: 90; transition: left var(--ease-slow);
}
.sidebar.collapsed ~ .main-container .topnav { left: var(--sidebar-collapsed); }

.topnav-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.79rem; flex: 1; min-width: 0; overflow: hidden;
}
.topnav-breadcrumb-sep { color: var(--s4); }
.topnav-breadcrumb-item { color: var(--gb-fg4); white-space: nowrap; }
.topnav-breadcrumb-item.current { color: var(--gb-fg2); font-weight: 600; }
.topnav-breadcrumb-item.clickable:hover { color: var(--gb-yellow-b); cursor: pointer; }
.topnav-spacer { flex: 1; }

.topnav-search { position: relative; width: 260px; }
.topnav-search-input {
  width: 100%;
  background: rgba(235,219,178,0.06);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--gb-fg2); padding: 6px 52px 6px 34px;
  font-size: 0.82rem; outline: none; transition: all var(--ease);
}
.topnav-search-input:focus {
  background: rgba(255,255,255,0.08); border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,164,46,0.18);
}
.topnav-search-input::placeholder { color: var(--gb-fg4); }
.topnav-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--gb-fg4); pointer-events: none;
}
.topnav-search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 2px;
}
.kbd {
  background: var(--s3); border: 1px solid var(--s4);
  border-radius: 4px; padding: 0 5px;
  font-size: 0.63rem; color: var(--gb-fg4); line-height: 1.8;
  font-family: 'Fira Code', monospace;
}

.topnav-actions { display: flex; align-items: center; gap: 3px; }
.topnav-btn {
  position: relative; background: none; border: none;
  color: var(--gb-fg4); width: 34px; height: 34px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease);
}
.topnav-btn:hover { color: var(--accent); background: rgba(255,164,46,0.12); }
.topnav-btn svg { width: 18px; height: 18px; }

.badge-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; background: var(--gb-red-b);
  border-radius: 50%; border: 2px solid var(--s0);
}
.badge-count {
  position: absolute; top: 3px; right: 1px;
  background: var(--gb-red-b); color: #fff;
  font-size: 0.58rem; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: var(--r-full); display: flex; align-items: center;
  justify-content: center; padding: 0 3px; border: 2px solid var(--s0);
}

.profile-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(235,219,178,0.06); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 4px 12px 4px 4px;
  cursor: pointer; transition: all var(--ease); margin-left: 4px;
}
.profile-chip:hover { background: rgba(235,219,178,0.1); border-color: rgba(250,189,47,0.3); }
.profile-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.profile-name { font-size: 0.8rem; font-weight: 600; color: var(--gb-fg2); max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tenant-badge {
  background: rgba(235,219,178,0.06); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 4px 12px;
  font-size: 0.74rem; color: var(--gb-fg3); cursor: pointer;
  transition: all var(--ease); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis;
}
.tenant-badge:hover { background: rgba(235,219,178,0.1); }

.env-badge {
  background: rgba(152,151,26,0.2); border: 1px solid rgba(184,187,38,0.3);
  color: var(--gb-green-b); border-radius: var(--r-sm); padding: 2px 8px;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════════════════════ */
.main-container {
  flex: 1; margin-left: var(--sidebar-width);
  transition: margin-left var(--ease-slow);
  min-height: 100vh; display: flex; flex-direction: column;
  min-width: 0; overflow-x: hidden;
}
.sidebar.collapsed ~ .main-container { margin-left: var(--sidebar-collapsed); }
.main-content { margin-top: var(--topnav-height); padding: var(--content-padding); flex: 1; min-width: 0; }

/* ══════════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px;
}
.page-header-icon {
  width: 46px; height: 46px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.page-header-icon svg { width: 22px; height: 22px; }
.page-header-text { flex: 1; }
.page-title { font-size: 1.35rem; font-weight: 800; color: var(--gb-fg1); letter-spacing: -0.3px; line-height: 1.25; }
.page-subtitle { font-size: 0.82rem; color: var(--gb-fg4); margin-top: 3px; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--s3); margin-bottom: 20px; }
.tab {
  padding: 8px 18px; font-size: 0.82rem; font-weight: 600; color: var(--gb-fg4);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--ease); border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab:hover { color: var(--gb-fg2); background: rgba(235,219,178,0.04); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════════════════════
   CARDS  — warm surface, clear elevation above body
   ══════════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--s2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color var(--ease);
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--border); }

.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle);
}
.card-title  { font-size: 0.9rem; font-weight: 700; color: var(--gb-fg2); }
.card-subtitle { font-size: 0.77rem; color: var(--gb-fg4); margin-top: 2px; }
.card-actions { display: flex; align-items: center; gap: 6px; }

/* Colored top-glow accent cards — top neon ledge + color wash */
.card-accent-red    { border-top: 2px solid var(--gb-red-b);    background-image: linear-gradient(180deg, rgba(251,73,52,0.10)  0%, transparent 40%); box-shadow: 0 -2px 12px -2px rgba(251,73,52,0.35); }
.card-accent-yellow { border-top: 2px solid var(--gb-yellow-b); background-image: linear-gradient(180deg, rgba(255,164,46,0.10) 0%, transparent 40%); box-shadow: 0 -2px 12px -2px rgba(255,164,46,0.35); }
.card-accent-green  { border-top: 2px solid var(--gb-green-b);  background-image: linear-gradient(180deg, rgba(184,187,38,0.10) 0%, transparent 40%); box-shadow: 0 -2px 12px -2px rgba(184,187,38,0.35); }
.card-accent-blue   { border-top: 2px solid var(--gb-blue-b);   background-image: linear-gradient(180deg, rgba(131,165,152,0.10)0%, transparent 40%); box-shadow: 0 -2px 12px -2px rgba(131,165,152,0.35); }
.card-accent-purple { border-top: 2px solid var(--gb-purple-b); background-image: linear-gradient(180deg, rgba(166,121,212,0.10)0%, transparent 40%); box-shadow: 0 -2px 12px -2px rgba(166,121,212,0.35); }
.card-accent-aqua   { border-top: 2px solid var(--gb-aqua-b);   background-image: linear-gradient(180deg, rgba(142,192,124,0.10)0%, transparent 40%); box-shadow: 0 -2px 12px -2px rgba(142,192,124,0.35); }
.card-accent-orange { border-top: 2px solid var(--gb-orange-b); background-image: linear-gradient(180deg, rgba(255,164,46,0.10) 0%, transparent 40%); box-shadow: 0 -2px 12px -2px rgba(255,164,46,0.35); }

/* ══════════════════════════════════════════════════════════════════════════════
   STAT CARDS — the hero elements, full-color gradient top band
   ══════════════════════════════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px; margin-bottom: 22px;
}

.stat-card {
  background: var(--s2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 0;
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease);
  display: flex; flex-direction: column;
  position: relative;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 -2px 14px -2px currentColor;
}

/* Colored top band — uses currentColor from inline style on parent */
.stat-card-band {
  height: 4px;
  background: currentColor;
  opacity: 0.9;
}

.stat-card-bg-icon {
  position: absolute;
  right: -8px; bottom: -8px;
  opacity: 0.07;
  color: currentColor;
  pointer-events: none;
  line-height: 0;
}
.stat-card-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 4px; }

.stat-card-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.9px; color: var(--gb-fg4);
}
.stat-card-value {
  font-size: 2rem; font-weight: 800; line-height: 1;
  color: inherit; letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}
.stat-card-trend { display: flex; align-items: center; gap: 4px; font-size: 0.73rem; margin-top: 2px; }
.stat-card-trend.up   { color: var(--gb-green-b); }
.stat-card-trend.down { color: var(--gb-red-b); }
.stat-card-trend.flat { color: var(--gb-fg4); }
.stat-card-sub  { font-size: 0.7rem; color: var(--gb-fg4); }

/* Generic inline stat-value / stat-label */
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.9px; color: var(--gb-fg4); }

/* ══════════════════════════════════════════════════════════════════════════════
   CHART CARD
   ══════════════════════════════════════════════════════════════════════════════ */
.chart-card {
  background: var(--s2); border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg); padding: 20px; position: relative;
}
.chart-container { position: relative; }

/* ══════════════════════════════════════════════════════════════════════════════
   GRID
   ══════════════════════════════════════════════════════════════════════════════ */
.grid   { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 1280px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width:  960px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width:  720px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ── Dashboard 12-col grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
  align-items: stretch;
  min-width: 0;
}
.col-3  { grid-column: span 3;  display: flex; flex-direction: column; min-width: 0; }
.col-4  { grid-column: span 4;  display: flex; flex-direction: column; min-width: 0; }
.col-5  { grid-column: span 5;  display: flex; flex-direction: column; min-width: 0; }
.col-6  { grid-column: span 6;  display: flex; flex-direction: column; min-width: 0; }
.col-7  { grid-column: span 7;  display: flex; flex-direction: column; min-width: 0; }
.col-8  { grid-column: span 8;  display: flex; flex-direction: column; min-width: 0; }
.col-9  { grid-column: span 9;  display: flex; flex-direction: column; min-width: 0; }
.col-12 { grid-column: span 12; display: flex; flex-direction: column; min-width: 0; }
.col-3 > *, .col-4 > *, .col-5 > *, .col-6 > *, .col-7 > *, .col-8 > *, .col-9 > *, .col-12 > * { flex: 1; min-width: 0; }
@media (max-width: 1200px) {
  .col-3 { grid-column: span 4; }
  .col-4 { grid-column: span 6; }
  .col-5 { grid-column: span 6; }
  .col-7 { grid-column: span 6; }
  .col-8 { grid-column: span 12; }
  .col-9 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { grid-column: span 12; }
}

/* ── Table Container ── */
.table-container {
  background: var(--s2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.table-container table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.table-container table th {
  padding: 10px 14px; text-align: left;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--gb-fg3); background: rgba(0,0,0,0.18);
  border-bottom: 1px solid var(--border-subtle); white-space: nowrap;
}
.table-container table td {
  padding: 10px 14px; color: var(--gb-fg2);
  border-bottom: 1px solid rgba(235,219,178,0.07); vertical-align: middle;
}
.table-container table tbody tr { transition: background var(--ease); }
.table-container table tbody tr:hover { background: rgba(0,0,0,0.12); }
.table-container table tbody tr:last-child td { border-bottom: none; }

/* ── Horizontal Stacked Bar Chart (soc dashboard) ── */
@keyframes soc-hbar-expand {
  from { width: 0%; }
  to   { width: 100%; }
}
@keyframes heatCellIn {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}
.soc-hbar-wrap { padding: 4px 0 8px; display: flex; flex-direction: column; gap: 14px; }
.soc-hbar-row {}
.soc-hbar-label {
  font-size: 0.72rem; font-weight: 600; color: var(--gb-fg4);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px;
}
.soc-hbar-chart {
  display: flex; height: 40px; border-radius: var(--r-sm);
  overflow: hidden; width: 0%;
  animation: soc-hbar-expand 1.4s cubic-bezier(0.22,1,0.36,1) forwards;
}
.soc-hbar-block {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; color: rgba(255,255,255,0.9);
  transition: opacity var(--ease); cursor: default;
  white-space: nowrap; overflow: hidden;
}
.soc-hbar-block:hover { opacity: 0.75; }
.soc-hbar-legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 10px; font-size: 0.72rem; color: var(--gb-fg4);
}
.soc-hbar-legend span { display: flex; align-items: center; gap: 5px; }
.soc-hbar-legend i { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }

/* ── Live Indicator ── */
.live-indicator {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 2px; color: var(--gb-green-b); flex-shrink: 0;
  background: rgba(142,192,124,0.10);
  border: 1px solid rgba(142,192,124,0.30);
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #b8ff6a;
  animation: pulse-live 0.9s step-end infinite;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: var(--r-md);
  font-size: 0.83rem; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: all var(--ease); font-family: inherit;
  text-decoration: none; white-space: nowrap; letter-spacing: 0.1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--accent) 100%);
  color: #1a0800; font-weight: 700;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 2px 12px rgba(255,164,46,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent) 0%, #ffb84a 100%);
  box-shadow: 0 4px 22px rgba(255,164,46,0.45); transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--s3); color: var(--gb-fg2); border-color: var(--border);
}
.btn-secondary:hover { background: var(--s4); border-color: rgba(235,219,178,0.18); color: var(--gb-fg1); }

.btn-danger { background: rgba(251,73,52,0.14); color: var(--gb-red-b); border-color: rgba(251,73,52,0.3); }
.btn-danger:hover { background: rgba(251,73,52,0.22); border-color: rgba(251,73,52,0.5); }

.btn-ghost { background: transparent; color: var(--gb-fg3); border-color: transparent; }
.btn-ghost:hover { background: rgba(235,219,178,0.07); color: var(--gb-fg1); }

.btn-sm  { padding: 4px 10px;  font-size: 0.77rem; border-radius: var(--r-sm); }
.btn-xs  { padding: 2px 8px;   font-size: 0.72rem; border-radius: var(--r-sm); }
.btn-lg  { padding: 10px 24px; font-size: 0.9rem; }
.btn-icon { padding: 5px; width: 30px; height: 30px; justify-content: center; }

/* ══════════════════════════════════════════════════════════════════════════════
   BADGES  — vivid and colorful
   ══════════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: var(--r-full);
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; white-space: nowrap; border: 1px solid transparent;
}

/* severity */
.badge-critical { background: rgba(251,73,52,0.18);  color: #ff6b57; border-color: rgba(251,73,52,0.35); }
.badge-high     { background: rgba(254,128,25,0.18); color: var(--gb-orange-b); border-color: rgba(254,128,25,0.35); }
.badge-medium   { background: rgba(250,189,47,0.18); color: var(--gb-yellow-b); border-color: rgba(250,189,47,0.35); }
.badge-low      { background: rgba(131,165,152,0.18);color: var(--gb-blue-b);   border-color: rgba(131,165,152,0.35); }
.badge-info     { background: rgba(142,192,124,0.18);color: var(--gb-aqua-b);   border-color: rgba(142,192,124,0.35); }

/* status */
.badge-open, .badge-new   { background: rgba(251,73,52,0.15);  color: #ff6b57;           border-color: rgba(251,73,52,0.3); }
.badge-active             { background: rgba(184,187,38,0.18); color: var(--gb-green-b); border-color: rgba(184,187,38,0.35); }
.badge-closed, .badge-resolved { background: rgba(100,90,84,0.3); color: var(--gb-fg4); border-color: var(--border); }
.badge-pending            { background: rgba(250,189,47,0.15); color: var(--gb-yellow-b);border-color: rgba(250,189,47,0.3); }
.badge-investigating      { background: rgba(131,165,152,0.15);color: var(--gb-blue-b);  border-color: rgba(131,165,152,0.3); }
.badge-contained          { background: rgba(142,192,124,0.18);color: var(--gb-aqua-b);  border-color: rgba(142,192,124,0.35); }
.badge-acknowledged       { background: rgba(131,165,152,0.15);color: var(--gb-blue-b);  border-color: rgba(131,165,152,0.3); }
.badge-escalated          { background: rgba(254,128,25,0.18); color: var(--gb-orange-b);border-color: rgba(254,128,25,0.35); }
.badge-suppressed, .badge-gray { background: rgba(100,90,84,0.3); color: var(--gb-fg4); border-color: var(--border); }
.badge-success            { background: rgba(184,187,38,0.18); color: var(--gb-green-b); border-color: rgba(184,187,38,0.35); }
.badge-error              { background: rgba(251,73,52,0.18);  color: #ff6b57;           border-color: rgba(251,73,52,0.35); }
.badge-warning            { background: rgba(250,189,47,0.18); color: var(--gb-yellow-b);border-color: rgba(250,189,47,0.35); }
.badge-purple             { background: rgba(211,134,155,0.18);color: var(--gb-purple-b);border-color: rgba(211,134,155,0.35); }

/* ══════════════════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.table th {
  padding: 10px 14px; text-align: left;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--gb-fg3); background: rgba(0,0,0,0.18);
  border-bottom: 1px solid var(--border-subtle); white-space: nowrap;
}
.table td {
  padding: 10px 14px; color: var(--gb-fg2);
  border-bottom: 1px solid rgba(235,219,178,0.07); vertical-align: middle;
}
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover { background: rgba(0,0,0,0.12); }
.table tbody tr:last-child td { border-bottom: none; }
.table .text-muted { color: var(--gb-fg4); }

/* Table toolbar */
.table-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap;
}
.table-search { position: relative; flex: 1; min-width: 180px; max-width: 300px; }
.table-search input {
  width: 100%; background: rgba(235,219,178,0.05); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 6px 10px 6px 30px;
  color: var(--gb-fg2); font-size: 0.82rem; outline: none; transition: all var(--ease);
}
.table-search input:focus {
  border-color: var(--gb-yellow); background: rgba(235,219,178,0.08);
  box-shadow: 0 0 0 3px rgba(215,153,33,0.12);
}
.table-search-icon {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  color: var(--gb-fg4); pointer-events: none;
}
.table-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.table-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.filter-chip {
  padding: 3px 11px; border-radius: var(--r-full); font-size: 0.76rem; font-weight: 600;
  background: var(--s3); border: 1px solid var(--border); color: var(--gb-fg3);
  cursor: pointer; transition: all var(--ease);
}
.filter-chip:hover  { background: var(--s4); color: var(--gb-fg1); }
.filter-chip.active { background: rgba(255,164,46,0.2); border-color: rgba(255,164,46,0.4); color: var(--accent); }

.table-pagination {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-top: 1px solid var(--border-subtle);
  font-size: 0.79rem; color: var(--gb-fg4);
}

/* ══════════════════════════════════════════════════════════════════════════════
   FORM CONTROLS
   ══════════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 0.78rem; font-weight: 700; color: var(--gb-fg3);
  margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-control {
  width: 100%; background: var(--s0); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 9px 12px; color: var(--gb-fg1);
  font-size: 0.85rem; outline: none; transition: all var(--ease);
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--accent); background: rgba(0,0,0,0.3);
  box-shadow: 0 0 0 3px rgba(255,164,46,0.18);
}
.form-control::placeholder { color: var(--gb-fg4); }
.form-control:disabled { opacity: 0.4; cursor: not-allowed; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a89984'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; cursor: pointer;
}
.form-hint { margin-top: 5px; font-size: 0.75rem; color: var(--gb-fg4); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════════════════════
   PROGRESS BARS
   ══════════════════════════════════════════════════════════════════════════════ */
.progress { height: 6px; background: var(--s3); border-radius: 3px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gb-yellow), var(--gb-orange));
  transition: width 0.6s ease;
}

/* ══════════════════════════════════════════════════════════════════════════════
   NOTIFICATION PANEL
   ══════════════════════════════════════════════════════════════════════════════ */
.notif-panel {
  position: fixed; top: 0; right: -380px; width: 380px; height: 100vh;
  background: var(--s0); border-left: 1px solid var(--border-subtle);
  z-index: 200; transition: right var(--ease-slow);
  display: flex; flex-direction: column; box-shadow: var(--shadow-xl);
}
.notif-panel.open { right: 0; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
}
.notif-panel-title { font-size: 0.95rem; font-weight: 800; color: var(--gb-fg1); }
.notif-panel-body  { flex: 1; overflow-y: auto; padding: 6px 0; }

.notif-item {
  display: flex; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--ease); cursor: pointer;
}
.notif-item:hover { background: rgba(0,0,0,0.1); }
.notif-item.unread { background: rgba(215,153,33,0.12); border-left: 3px solid rgba(250,189,47,0.6); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-text    { flex: 1; min-width: 0; }
.notif-message { font-size: 0.82rem; color: var(--gb-fg2); line-height: 1.45; }
.notif-time    { font-size: 0.72rem; color: var(--gb-fg4); margin-top: 3px; }

.notif-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
  z-index: 199; display: none;
}
.notif-overlay.open { display: block; }

/* ══════════════════════════════════════════════════════════════════════════════
   DROPDOWN
   ══════════════════════════════════════════════════════════════════════════════ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px;
  background: var(--s0); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
  z-index: 300; overflow: hidden;
  opacity: 0; transform: translateY(-8px) scale(0.97);
  transition: opacity var(--ease), transform var(--ease); pointer-events: none;
}
.dropdown-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 0.83rem; color: var(--gb-fg3);
  cursor: pointer; transition: all var(--ease); text-decoration: none;
}
.dropdown-item:hover { background: rgba(235,219,178,0.07); color: var(--gb-fg1); }
.dropdown-separator { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.dropdown-header { padding: 10px 14px 5px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.9px; color: var(--gb-fg4); }

/* ══════════════════════════════════════════════════════════════════════════════
   FLASH ALERTS
   ══════════════════════════════════════════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-md); font-size: 0.83rem;
  margin-bottom: 16px; border: 1px solid transparent;
}
.alert-success { background: rgba(152,151,26,0.15); color: var(--gb-green-b); border-color: rgba(184,187,38,0.3); }
.alert-error   { background: rgba(204,36,29,0.15);  color: var(--gb-red-b);   border-color: rgba(251,73,52,0.3); }
.alert-warning { background: rgba(215,153,33,0.15); color: var(--gb-yellow-b);border-color: rgba(250,189,47,0.3); }
.alert-info    { background: rgba(69,133,136,0.15); color: var(--gb-blue-b);  border-color: rgba(131,165,152,0.3); }

/* ══════════════════════════════════════════════════════════════════════════════
   GLOBAL SEARCH MODAL (⌘K)
   ══════════════════════════════════════════════════════════════════════════════ */
.search-modal {
  position: fixed; inset: 0; z-index: 500;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
}
.search-modal.open { display: flex; }
.search-modal-inner {
  background: var(--s0); border: 1px solid var(--border);
  border-radius: var(--r-xl); width: 580px; max-width: 92vw;
  box-shadow: var(--shadow-xl); overflow: hidden;
}
.search-modal-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
}
.search-modal-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--gb-fg); font-size: 1rem; font-family: inherit;
  caret-color: var(--gb-yellow);
}
.search-modal-input::placeholder { color: var(--gb-fg4); }
.search-modal-results { max-height: 420px; overflow-y: auto; }
.search-result-group  { padding: 6px 0; }
.search-result-label  { padding: 4px 16px; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--gb-fg4); }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; cursor: pointer; transition: background var(--ease); text-decoration: none;
}
.search-result-item:hover,
.search-result-item.selected { background: rgba(215,153,33,0.08); }
.search-result-icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--s3); color: var(--gb-fg3);
}
.search-result-title { font-size: 0.85rem; color: var(--gb-fg1); font-weight: 500; }
.search-result-sub   { font-size: 0.74rem; color: var(--gb-fg4); margin-top: 1px; }
.search-modal-footer {
  padding: 10px 18px; border-top: 1px solid var(--border-subtle);
  display: flex; gap: 16px; font-size: 0.72rem; color: var(--gb-fg4);
}

/* ══════════════════════════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════════════════════════ */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; position: relative; z-index: 1; }
.timeline-item::before { content: ''; position: absolute; left: 4px; top: 14px; bottom: 0; width: 2px; background: var(--s3); }
.timeline-item:last-child::before { display: none; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-size: 0.83rem; color: var(--gb-fg2); font-weight: 500; }
.timeline-time  { font-size: 0.72rem; color: var(--gb-fg4); margin-top: 2px; }
.timeline-desc  { font-size: 0.78rem; color: var(--gb-fg3); margin-top: 4px; line-height: 1.45; }

/* ══════════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center;
}
.empty-state-icon {
  width: 56px; height: 56px; border-radius: var(--r-xl);
  background: var(--s3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--gb-fg4); margin-bottom: 16px;
}
.empty-state-title { font-size: 0.95rem; font-weight: 700; color: var(--gb-fg2); margin-bottom: 6px; }
.empty-state-desc  { font-size: 0.82rem; color: var(--gb-fg4); max-width: 320px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════════════════════
   HEALTH / STATUS DOTS
   ══════════════════════════════════════════════════════════════════════════════ */
.health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.health-dot.healthy  { background: var(--gb-green-b); }
.health-dot.warning  { background: var(--gb-yellow-b); }
.health-dot.critical { background: var(--gb-red-b); animation: pulse-critical 2s infinite; }
.health-dot.offline  { background: var(--gb-gray); }
@keyframes pulse-critical {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--s0);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); font-size: 0.83rem; color: var(--gb-fg2);
  min-width: 260px; max-width: 380px; animation: toastIn 0.25s ease;
}
.toast.success { border-left: 3px solid var(--gb-green-b); }
.toast.error   { border-left: 3px solid var(--gb-red-b); }
.toast.warning { border-left: 3px solid var(--gb-yellow-b); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ══════════════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--s1); padding: 20px;
  background-image:
    radial-gradient(ellipse 60% 45% at 20% 20%, rgba(255,164,46,0.1) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 80% 80%, rgba(210,24,0,0.2) 0%, transparent 55%);
}
.auth-card {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-xl);
}
.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-logo-mark {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.auth-logo-name { font-size: 2rem; font-weight: 800; color: var(--gb-fg1); letter-spacing: 2px; text-transform: uppercase; }
.auth-logo-sub  { font-size: 0.63rem; color: var(--gb-fg4); text-transform: uppercase; letter-spacing: 1.8px; margin-top: 3px; }
.auth-title    { font-size: 1.1rem; font-weight: 700; color: var(--gb-fg1); text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: 0.82rem; color: var(--gb-fg4); text-align: center; margin-bottom: 24px; }

/* ══════════════════════════════════════════════════════════════════════════════
   AINA CHAT
   ══════════════════════════════════════════════════════════════════════════════ */
.chat-container {
  display: flex; height: calc(100vh - var(--topnav-height) - 48px);
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border);
  background: var(--s2);
}
.chat-sidebar {
  width: 256px; flex-shrink: 0; border-right: 1px solid var(--border-subtle);
  background: var(--s0); display: flex; flex-direction: column;
}
.chat-sidebar-header { padding: 14px 14px 10px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.chat-list { flex: 1; overflow-y: auto; padding: 6px; }
.chat-list-item { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; transition: background var(--ease); margin-bottom: 2px; }
.chat-list-item:hover  { background: rgba(235,219,178,0.07); }
.chat-list-item.active { background: rgba(255,164,46,0.12); border-left: 3px solid var(--accent); }
.chat-list-title { font-size: 0.8rem; color: var(--gb-fg2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-time  { font-size: 0.7rem; color: var(--gb-fg4); margin-top: 2px; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-main-header { padding: 12px 18px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { display: flex; gap: 12px; align-items: flex-start; animation: msgIn 0.22s ease; }
.chat-msg.user { flex-direction: row-reverse; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.chat-bubble { padding: 10px 14px; border-radius: var(--r-lg); font-size: 0.84rem; line-height: 1.55; max-width: 80%; }
.chat-msg:not(.user) .chat-bubble { background: var(--s3); border: 1px solid var(--border); color: var(--gb-fg2); border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg); }
.chat-msg.user .chat-bubble { background: rgba(255,164,46,0.18); border: 1px solid rgba(255,164,46,0.28); color: var(--gb-fg1); border-radius: var(--r-lg) 4px var(--r-lg) var(--r-lg); }
.chat-input-area { padding: 14px 18px; border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.chat-input-wrap {
  display: flex; gap: 10px; align-items: flex-end;
  background: var(--s3); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 8px 12px; transition: border-color var(--ease);
}
.chat-input-wrap:focus-within { border-color: var(--gb-yellow); box-shadow: 0 0 0 3px rgba(215,153,33,0.12); }
.chat-input-wrap textarea { flex: 1; background: none; border: none; outline: none; color: var(--gb-fg1); font-size: 0.85rem; font-family: inherit; resize: none; max-height: 120px; caret-color: var(--gb-yellow); }
.chat-input-wrap textarea::placeholder { color: var(--gb-fg4); }

/* AI analysis card */
.ai-card { background: var(--s2); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.ai-card-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--border-subtle); }
.ai-card-icon { width: 22px; height: 22px; background: rgba(177,98,134,0.25); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gb-purple-b); }
.ai-card-title { font-size: 0.78rem; font-weight: 800; color: var(--gb-purple-b); text-transform: uppercase; letter-spacing: 0.9px; flex: 1; }
.ai-card-confidence { font-size: 0.7rem; background: rgba(184,187,38,0.15); color: var(--gb-green-b); border: 1px solid rgba(184,187,38,0.3); border-radius: var(--r-full); padding: 1px 8px; font-weight: 700; }
.ai-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-section { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
.ai-section:last-of-type { border-bottom: none; }
.ai-section-label { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.1px; color: var(--gb-purple-b); margin-bottom: 4px; opacity: 0.85; }
.ai-section-content { font-size: 0.82rem; color: var(--gb-fg2); line-height: 1.5; }
.ai-evidence-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.ai-evidence-list li { font-size: 0.8rem; color: var(--gb-fg3); padding-left: 14px; position: relative; }
.ai-evidence-list li::before { content: '▸'; position: absolute; left: 0; color: var(--gb-purple); }
.ai-actions-list { display: flex; flex-direction: column; gap: 4px; }
.ai-action-item { font-size: 0.8rem; color: var(--gb-fg2); padding: 5px 10px; background: rgba(235,219,178,0.04); border-radius: var(--r-sm); border-left: 2px solid var(--gb-aqua); }

/* ══════════════════════════════════════════════════════════════════════════════
   LIVE TICKER
   ══════════════════════════════════════════════════════════════════════════════ */
.live-ticker { display: flex; align-items: center; gap: 10px; overflow: hidden; font-size: 0.78rem; }
.live-ticker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gb-green-b); flex-shrink: 0; animation: pulse-live 2s infinite; }
@keyframes pulse-live {
  0%, 49% { opacity: 1; background: #b8ff6a; box-shadow: 0 0 8px #b8ff6a, 0 0 20px #b8ff6a; }
  50%, 100% { opacity: 0; box-shadow: none; }
}
.live-ticker-label { font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--gb-green-b); font-size: 0.63rem; }
.live-ticker-text  { color: var(--gb-fg3); }

/* ══════════════════════════════════════════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════════════════════════════════════════ */
.text-critical { color: var(--gb-red-b) !important; }
.text-high     { color: var(--gb-orange-b) !important; }
.text-medium   { color: var(--gb-yellow-b) !important; }
.text-low      { color: var(--gb-blue-b) !important; }
.text-success  { color: var(--gb-green-b) !important; }
.text-muted    { color: var(--gb-fg4) !important; }
.text-purple   { color: var(--gb-purple-b) !important; }
.text-aqua     { color: var(--gb-aqua-b) !important; }
.text-xs  { font-size: 0.73rem !important; }
.text-sm  { font-size: 0.82rem !important; }
.text-mono { font-family: 'Fira Code', monospace; }
.td-primary { font-weight: 500; color: var(--gb-fg1); }
.mt-4 { margin-top: 16px !important; }
.mb-4 { margin-bottom: 16px !important; }
.p-4  { padding: 16px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.py-4 { padding-top: 16px !important; padding-bottom: 16px !important; }
.divider { height: 1px; background: var(--border-subtle); margin: 16px 0; }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-container { margin-left: 0 !important; }
  .topnav { left: 0 !important; }
  .main-content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .topnav-search { display: none; }
  .profile-name { display: none; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}
