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

:root {
  --bg-page: #F4F1EA;
  --bg-card: #FFFDF8;
  --bg-card2: #FAF8F2;
  --border: #DEDCD4;
  --border2: #EDEDEA;
  --sidebar-bg: #26332F;
  --text-primary: #202827;
  --text-secondary: #66716C;
  --text-muted: #8A918D;
  --text-sidebar: #C8D8CC;
  --text-sidebar-muted: #4F7568;
  --accent: #35594E;
  --accent2: #4F7568;
  --accent3: #6F8F7A;
  --critical: #A9473F;
  --critical-bg: #f3e9e8;
  --high: #C36B4B;
  --high-bg: #f5ede7;
  --medium: #5C7880;
  --medium-bg: #eaeff0;
  --warn: #B8873B;
  --warn-bg: #f6f0e4;
  --success: #5E806B;
  --success-bg: #eaf1ec;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.15s ease;
}

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }

/* ── Auth Screen ─────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a2420 0%, #26332F 50%, #1e2e28 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(79,117,104,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(53,89,78,0.1) 0%, transparent 50%);
}

.auth-page {
  display: none;
  width: 100%;
  position: relative;
  z-index: 1;
}
.auth-page.active { display: block; }

.auth-container {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 52px;
  max-width: 1040px;
  margin: 0 auto;
  align-items: center;
}

.auth-card {
  background: rgba(255,253,248,0.97);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
}

.glass-card { border: 1px solid rgba(255,255,255,0.1); }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.logo-icon {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: var(--text-sidebar);
  font-family: var(--font-mono); letter-spacing: 0.05em;
  flex-shrink: 0;
}

.logo-name {
  font-weight: 800; font-size: 16px; color: var(--text-primary);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.logo-tagline { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

.auth-header { margin-bottom: 22px; }
.auth-title { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label { font-size: 12px; font-weight: 600; color: var(--text-primary); }

.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #FAFAF7;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-wrapper .form-input { padding-left: 36px; }

.form-input:focus {
  border-color: var(--accent2);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(79,117,104,0.12);
}

.login-hint-box {
  background: rgba(79,117,104,0.08);
  border: 1px solid rgba(79,117,104,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hint-row { display: flex; gap: 8px; align-items: center; }
.hint-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; min-width: 80px; }
.hint-val { font-size: 11px; font-family: var(--font-mono); color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: var(--text-sidebar);
}
.btn-primary:hover { background: #2e4e44; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(53,89,78,0.3); }
.btn-full { width: 100%; }

.link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--accent2); font-size: 13px; font-weight: 600;
  font-family: inherit; text-decoration: none;
  transition: color var(--transition);
}
.link-btn:hover { color: var(--accent); }

.auth-divider {
  text-align: center; margin: 16px 0 8px;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: var(--border2);
}
.auth-divider span {
  position: relative; background: var(--bg-card);
  padding: 0 12px; font-size: 12px; color: var(--text-muted);
}
.auth-switch { font-size: 13px; color: var(--text-secondary); text-align: center; }

/* Alerts */
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  margin-bottom: 4px;
}
.alert-error { background: var(--critical-bg); color: var(--critical); border: 1px solid rgba(169,71,63,0.2); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(94,128,107,0.2); }

/* Auth Visual */
.auth-visual { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }

/* ── Sign-in Hero Side (Matching Screenshot) ─────────── */
.signin-hero-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 0 12px 24px;
  position: relative;
  z-index: 1;
}

.signin-brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

.signin-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #344F46;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #DFECE4;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.signin-brand-text {
  display: flex;
  flex-direction: column;
}

.signin-brand-title {
  color: #F4F1EA;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
}

.signin-brand-subtitle {
  color: #6E887E;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 600;
}

.signin-hero-body {
  display: flex;
  flex-direction: column;
}

.signin-hero-title {
  font-size: 44px;
  font-weight: 800;
  color: #FFFDF8;
  letter-spacing: -0.028em;
  line-height: 1.12;
  margin-bottom: 22px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.signin-hero-desc {
  font-size: 15px;
  color: #8CA498;
  line-height: 1.65;
  max-width: 460px;
  margin-bottom: 0;
  font-weight: 400;
}

.signin-hero-stats {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat-col {
  display: flex;
  flex-direction: column;
}

.hero-stat-val {
  font-size: 32px;
  font-weight: 800;
  color: #FFFDF8;
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.hero-stat-lbl {
  font-size: 12px;
  font-weight: 500;
  color: #6E887E;
  margin-top: 7px;
  line-height: 1.3;
}

.visual-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 16px 18px;
  backdrop-filter: blur(10px);
  animation: fadeSlideUp 0.6s ease both;
}

.visual-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
}
.visual-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.visual-dot.critical { background: var(--critical); box-shadow: 0 0 8px rgba(169,71,63,0.6); }
.visual-dot.high { background: var(--high); box-shadow: 0 0 8px rgba(195,107,75,0.6); }

.visual-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.vstat-val { font-size: 20px; font-weight: 800; font-family: var(--font-mono); line-height: 1; }
.vstat-label { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.08em; }

.visual-metrics {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 10px;
}
.vmetric {
  background: rgba(255,255,255,0.06); border-radius: 8px; padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.vmetric-val { font-size: 18px; font-weight: 800; font-family: var(--font-mono); color: #fff; }
.vmetric-label { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }

.badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.badge-critical { background: rgba(169,71,63,0.25); color: #F4A49F; }
.badge-high { background: rgba(195,107,75,0.25); color: #F4C4A9; }

.visual-info {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 24px; text-align: center;
}
.vinfo-icon { font-size: 36px; margin-bottom: 12px; }
.vinfo-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.vinfo-desc { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.6; }

.visual-steps {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}
.vstep { display: flex; align-items: flex-start; gap: 14px; }
.vstep-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--text-sidebar);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.vstep-title { font-size: 13px; font-weight: 600; color: #fff; }
.vstep-desc { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* ── App Layout ──────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-page);
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 228px;
  min-width: 228px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 56px; min-width: 56px; }
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-data-coverage,
.sidebar.collapsed .sidebar-status,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-user .user-info,
.sidebar.collapsed .sidebar-user .logout-btn {
  display: none !important;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 9px;
}
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 18px 0;
}
.sidebar.collapsed .sidebar-footer {
  padding: 12px 0;
  display: flex;
  justify-content: center;
}

.sidebar-logo {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}
.logo-icon-sm {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px; color: var(--text-sidebar);
  font-family: var(--font-mono); letter-spacing: 0.05em; flex-shrink: 0;
}
.sidebar-brand {
  color: var(--text-sidebar); font-weight: 700; font-size: 11px;
  letter-spacing: 0.16em; line-height: 1.2; text-transform: uppercase;
}
.sidebar-role { color: var(--text-sidebar-muted); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  padding: 10px 10px 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  gap: 0;
}

.nav-group { margin-bottom: 6px; }

.nav-group-label {
  padding: 12px 8px 4px;
  font-size: 9px; font-weight: 600; color: var(--text-sidebar-muted);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.nav-group:first-child .nav-group-label { padding-top: 8px; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  background: transparent;
  color: var(--text-sidebar-muted);
  font-size: 13px; font-weight: 400;
  font-family: inherit;
  text-align: left;
  transition: all 0.12s;
  margin-bottom: 1px;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text-sidebar); }
.nav-item.active {
  background: rgba(111,143,122,0.18);
  color: var(--text-sidebar); font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 18%; bottom: 18%;
  width: 2px; border-radius: 0 2px 2px 0;
  background: var(--accent3);
}
.nav-item.active svg { color: var(--accent3); }

.nav-badge {
  background: var(--critical); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  font-family: var(--font-mono); margin-left: auto;
}

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

.sidebar-status {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  display: inline-block; flex-shrink: 0;
  animation: statusPulse 2.5s ease-in-out infinite;
}
.status-text { font-size: 10px; color: var(--success); font-weight: 500; }

.sidebar-data-coverage { margin-bottom: 12px; }
.data-label { font-size: 9px; font-weight: 600; color: var(--text-sidebar-muted); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.data-val { font-size: 12px; font-weight: 600; color: var(--text-sidebar); font-family: var(--font-mono); line-height: 1.2; }
.data-sub { font-size: 9px; color: var(--text-sidebar-muted); margin-top: 1px; }

.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06);
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  color: var(--accent3); font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { color: var(--text-sidebar); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--text-sidebar-muted); font-size: 10px; }

.logout-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-sidebar-muted); padding: 4px; border-radius: 4px;
  display: flex; align-items: center;
  transition: color var(--transition);
}
.logout-btn:hover { color: var(--text-sidebar); }

/* ── App Main ────────────────────────────────────────── */
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── TopNav ──────────────────────────────────────────── */
.topnav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 20;
}

.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  padding: 5px; color: var(--accent2); border-radius: 5px;
  display: flex; align-items: center; flex-shrink: 0;
  transition: color var(--transition);
}
.sidebar-toggle:hover { color: var(--text-primary); }

.topnav-title { flex: 1; min-width: 0; }
.page-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1.2; }
.page-subtitle { font-size: 11px; color: var(--text-secondary); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topnav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.search-box { position: relative; width: 220px; }
.search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-input {
  width: 100%; padding: 6px 10px 6px 30px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-primary);
  font-family: inherit; outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.search-input:focus { background: var(--bg-card); border-color: var(--accent2); }

.date-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; background: var(--bg-card2);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  cursor: pointer;
}
.date-pill span { font-size: 11px; font-weight: 500; color: var(--text-primary); }

.icon-btn {
  background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--accent2); border-radius: 5px;
  display: flex; align-items: center; position: relative;
  transition: color var(--transition);
}
.icon-btn:hover { color: var(--text-primary); }

.notif-btn { position: relative; }
.notif-dot {
  position: absolute; top: 3px; right: 3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--critical); border: 1.5px solid var(--bg-card);
}

.notif-dropdown {
  position: absolute; right: 0; top: 40px; width: 290px;
  background: var(--bg-card); border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 50;
}
.notif-header { padding: 11px 15px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 12px; color: var(--text-primary); }
.notif-item {
  padding: 9px 15px; border-bottom: 1px solid var(--bg-card2);
  display: flex; gap: 9px; align-items: flex-start; cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-card2); }
.notif-dot-item { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.critical-dot { background: var(--critical); }
.normal-dot { background: var(--accent2); }
.notif-content { flex: 1; }
.notif-title { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.notif-desc { font-size: 11px; color: var(--text-secondary); }
.notif-time { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

.user-avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  color: var(--accent3); font-size: 11px; font-weight: 700; cursor: pointer;
}

/* ── Page Main ───────────────────────────────────────── */
.page-main { flex: 1; overflow-y: auto; }

/* ── Cards & Panels ─────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}

/* ── Status Badges ───────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.status-badge .badge-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.badge-critical   { background: var(--critical-bg); color: var(--critical); }
.badge-high       { background: var(--high-bg); color: var(--high); }
.badge-medium     { background: var(--medium-bg); color: var(--medium); }
.badge-low        { background: #EDEDEA; color: #66716C; }
.badge-normal     { background: var(--success-bg); color: var(--success); }
.badge-open       { background: var(--medium-bg); color: var(--medium); }
.badge-inprogress { background: var(--warn-bg); color: var(--warn); }
.badge-resolved   { background: var(--success-bg); color: var(--success); }
.badge-escalated  { background: var(--critical-bg); color: var(--critical); }
.badge-emerging   { background: var(--critical-bg); color: var(--critical); }
.badge-active     { background: var(--high-bg); color: var(--high); }
.badge-monitoring { background: var(--medium-bg); color: var(--medium); }

/* ── KPI Cards ───────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.kpi-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 16px 18px; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.kpi-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.kpi-label { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-value { font-size: 26px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.1; letter-spacing: -0.02em; }
.kpi-delta { font-size: 11px; font-weight: 600; margin-top: 5px; }
.kpi-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Charts ──────────────────────────────────────────── */
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.chart-subtitle { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.time-range-btns { display: flex; gap: 3px; }
.time-btn {
  padding: 3px 9px; border-radius: 5px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-size: 11px; font-weight: 500; cursor: pointer;
  font-family: var(--font-mono); transition: all 0.12s;
}
.time-btn.active {
  border-color: var(--accent); background: var(--accent); color: var(--text-sidebar);
}

/* SVG Line Chart */
.chart-container { position: relative; }
.chart-svg { width: 100%; overflow: visible; }

/* Category bars */
.cat-bar-item { margin-bottom: 7px; }
.cat-bar-header { display: flex; justify-content: space-between; margin-bottom: 3px; }
.cat-bar-name { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.cat-bar-count { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.cat-bar-track { height: 4px; background: #EDEDEA; border-radius: 2px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }

/* ── Tables ──────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; padding: 7px 8px; color: var(--text-secondary);
  font-weight: 600; font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap;
  background: var(--bg-card2); border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.data-table td { padding: 8px 8px; border-bottom: 1px solid var(--bg-card2); }
.data-table tr { transition: background 0.1s; cursor: pointer; }
.data-table tr:hover td { background: var(--bg-card2); }
.data-table tr:hover .td-critical { background: #FFF1EF; }

/* ── Emerging Issues ─────────────────────────────────── */
.issue-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); border-left-width: 4px;
  box-shadow: var(--shadow-sm); padding: 14px 18px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 16px; align-items: start;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  cursor: default;
}
.issue-card:hover { transform: translateX(3px); }

.issue-card-stats { display: flex; gap: 20px; margin-bottom: 10px; flex-wrap: wrap; }
.issue-stat { }
.issue-stat-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 2px; }
.issue-stat-val { font-size: 20px; font-weight: 800; font-family: var(--font-mono); line-height: 1; }
.issue-stat-sep { border-left: 1px solid var(--border); padding-left: 20px; }

.why-flagged { padding: 8px 12px; border-radius: 5px; font-size: 12px; color: var(--text-primary); line-height: 1.5; }

/* ── Map ─────────────────────────────────────────────── */
.map-container {
  position: relative; background: var(--bg-page);
  border-radius: 8px; border: 1px solid var(--border);
  overflow: hidden; height: 240px;
}
.map-grid-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-pin {
  position: absolute; transform: translate(-50%,-50%);
  cursor: pointer; z-index: 5;
}
.map-pin.selected { z-index: 10; }
.map-pin-circle {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid; transition: all 0.15s;
}
.map-pin-inner { border-radius: 50%; }
.map-pin-label {
  position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; background: rgba(255,253,248,0.95);
  padding: 1px 4px; border-radius: 2px;
}
.map-legend {
  position: absolute; bottom: 8px; left: 10px;
  display: flex; gap: 10px;
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-text { font-size: 9px; color: var(--text-secondary); }

.map-info {
  margin-top: 10px; padding: 10px 13px;
  background: var(--bg-card2); border-radius: 7px; border: 1px solid var(--border);
}

/* ── Drawers ─────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(38,51,47,0.28); z-index: 40;
}
.detail-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 400px;
  background: var(--bg-card); box-shadow: -4px 0 24px rgba(0,0,0,0.10);
  z-index: 50; overflow-y: auto; display: flex; flex-direction: column;
}
.evidence-panel { width: 480px; }

.drawer-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.drawer-label { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 2px; letter-spacing: 0.04em; }
.drawer-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.drawer-body { padding: 18px 22px; flex: 1; }

/* ── Request Desk ────────────────────────────────────── */
.request-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 18px; align-items: start; }

.field-style {
  width: 100%; border: 1px solid var(--border);
  background: var(--bg-card); border-radius: 4px;
  padding: 10px 11px; font-size: 13px; color: var(--text-primary);
  font-family: inherit; outline: none;
  transition: border-color var(--transition);
}
.field-style:focus { border-color: var(--accent2); }

/* ── Filters ─────────────────────────────────────────── */
.filter-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.filter-group { flex: 1 1 140px; }
.filter-label { font-size: 11px; font-weight: 500; color: var(--text-secondary); display: block; margin-bottom: 4px; }
.filter-select {
  width: 100%; padding: 7px 10px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-primary);
  cursor: pointer; outline: none; font-family: inherit;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--accent2); }
.filter-search { flex: 1 1 220px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; background: rgba(79,117,104,0.1);
  color: var(--accent); border-radius: 4px; font-size: 12px; font-weight: 500;
}
.chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--accent2); font-size: 14px; line-height: 1; padding: 0;
}

/* ── Pagination ──────────────────────────────────────── */
.pagination { display: flex; gap: 4px; }
.page-btn {
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-primary); font-size: 12px; cursor: pointer;
  font-family: var(--font-mono); transition: all 0.12s;
}
.page-btn:hover { border-color: var(--accent2); }
.page-btn.active { border-color: var(--accent); background: var(--accent); color: var(--text-sidebar); }
.page-btn:disabled { background: var(--bg-card2); color: var(--text-muted); cursor: not-allowed; }

/* ── Briefing ────────────────────────────────────────── */
.briefing-header-card {
  background: #26332F; border-radius: var(--radius); padding: 20px 24px; color: #fff;
}

.evidence-pill {
  font-size: 11px; padding: 4px 10px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary);
  font-family: var(--font-mono); font-weight: 500;
}

/* ── Emerging Issue Cards Grid ───────────────────────── */
.issue-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px,1fr)); gap: 14px;
}
.ei-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); border-left-width: 4px;
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.ei-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── Activity Badge ──────────────────────────────────── */
.activity-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 3px;
}

/* ── Tabs ────────────────────────────────────────────── */
.tab-bar { display: flex; gap: 4px; }
.tab-btn {
  padding: 5px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all 0.12s;
}
.tab-btn.active {
  border-color: var(--accent); background: var(--accent); color: var(--text-sidebar);
}

/* ── Utility ─────────────────────────────────────────── */
.section-title { font-size: 20px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.section-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--accent2); color: var(--accent2); }

.btn-dark {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: #202827; border: none;
  color: var(--text-sidebar); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background var(--transition);
}
.btn-dark:hover { background: var(--accent); }

/* ── Animations ──────────────────────────────────────── */
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes progress {
  from { width: 0%; }
  to { width: 80%; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in { animation: fadeIn 0.25s ease; }
.spin { animation: spin 1s linear infinite; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C5C2B8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8A918D; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 880px) {
  .auth-container { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .request-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 56px; min-width: 56px; }
  .sidebar-logo-text, .sidebar-data-coverage, .sidebar-status, .nav-group-label, .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 9px; }
  .nav-item.active::before { display: none; }
  .sidebar-user .user-info, .sidebar-user .logout-btn { display: none; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .issue-cards-grid { grid-template-columns: 1fr; }
}

/* ── Interactive Chart Enhancements ──────────────────── */
.chart-tooltip-box {
  position: absolute;
  pointer-events: none;
  background: rgba(38, 51, 47, 0.96);
  color: #F4F1EA;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 11px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.14);
  z-index: 50;
  transition: opacity 0.1s ease;
  min-width: 170px;
}
.chart-tooltip-date {
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 6px;
  color: #C8D8CC;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 4px;
}
.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.chart-tooltip-badge {
  margin-top: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  font-family: var(--font-mono);
}

/* Radar Beacon Animation */
@keyframes radarPulse {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}
.radar-beacon {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: radarPulse 2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
  pointer-events: none;
}

/* Interactive Category Bars */
.cat-bar-interactive {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.cat-bar-interactive:hover {
  background: var(--bg-card2);
  border-color: var(--border);
  transform: translateX(4px);
}
.cat-bar-interactive.active {
  background: rgba(79,117,104,0.12);
  border-color: var(--accent2);
}

/* Interactive Map Pins */
.map-pin {
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.map-pin:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

/* Category Quick Pills */
.cat-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}
.cat-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79,117,104,0.08);
}
.cat-pill.active {
  background: var(--accent);
  color: #FFFDF8;
  border-color: var(--accent);
  font-weight: 600;
}

