/* =========================================================================
   NEXUS INTELLIGENCE — Enterprise Dark Design System
   Premium Enterprise Dashboard — Rp 10.000.000 Grade
   ========================================================================= */

:root {
  --bg-void: #05060f;
  --bg-surface: #0a0d1a;
  --bg-panel: rgba(13, 17, 36, 0.85);
  --bg-panel-hover: rgba(20, 26, 52, 0.9);
  --sidebar-w: 260px;
  --topbar-h: 60px;
  
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --purple-glow: rgba(124, 58, 237, 0.4);
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.3);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.3);
  --yellow: #f59e0b;
  --yellow-glow: rgba(245, 158, 11, 0.3);
  
  --grad-primary: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --grad-dark: linear-gradient(135deg, rgba(124,58,237,0.2) 0%, rgba(6,182,212,0.2) 100%);
  --grad-green: linear-gradient(135deg, #10b981, #059669);
  --grad-red: linear-gradient(135deg, #ef4444, #b91c1c);
  
  --border: rgba(124, 58, 237, 0.15);
  --border-bright: rgba(124, 58, 237, 0.4);
  --text-main: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #334155;
  
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.15), 0 8px 32px rgba(0,0,0,0.5);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  background: var(--bg-void);
  color: var(--text-main);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  height: 100%;
  overflow: hidden;
}

/* ============================================================
   BOOT SCREEN
   ============================================================ */
.boot-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(ellipse at center, #0d0520 0%, #05060f 70%);
  display: flex; align-items: center; justify-content: center;
}

.boot-content {
  text-align: center;
  animation: bootFadeIn 0.5s ease;
}

@keyframes bootFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.boot-logo { display: flex; justify-content: center; margin-bottom: 28px; }

.boot-hex {
  position: relative;
  animation: bootHexPulse 2s ease-in-out infinite;
}

@keyframes bootHexPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(124,58,237,0.5)); }
  50% { filter: drop-shadow(0 0 24px rgba(6,182,212,0.8)); }
}

.boot-icon-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.boot-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px; font-weight: 700; letter-spacing: 6px;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.boot-sub {
  font-size: 13px; color: var(--text-muted); letter-spacing: 2px;
  margin-bottom: 32px; text-transform: uppercase;
}

.boot-progress-wrap {
  width: 320px; height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px; margin: 0 auto 16px;
  overflow: hidden;
}

.boot-progress-bar {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 3px;
  width: 0;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(124,58,237,0.8);
}

.boot-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--cyan); letter-spacing: 1px;
  animation: blink 1.2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(8, 10, 22, 0.97);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  position: relative; z-index: 5;
}

.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at top, rgba(124,58,237,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-hex-wrap { position: relative; flex-shrink: 0; }

.logo-center-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px; color: var(--cyan);
}

.logo-text { display: flex; flex-direction: column; }
.logo-main {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px; font-weight: 700; letter-spacing: 3px;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-sub {
  font-size: 9px; color: var(--text-muted);
  letter-spacing: 2px; text-transform: uppercase;
}

.sidebar-divider { height: 1px; background: var(--border); margin: 0; }

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

.nav-section-label {
  font-size: 9px; font-weight: 700;
  color: var(--text-dim); letter-spacing: 2px;
  text-transform: uppercase; padding: 0 8px;
  margin-bottom: 6px;
}
.mt-20 { margin-top: 20px; }

.nav-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  background: transparent; border: none;
  color: var(--text-muted); font-family: inherit;
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius-md); cursor: pointer;
  transition: var(--transition);
  position: relative; text-align: left; margin-bottom: 2px;
}

.nav-btn i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.nav-btn:hover {
  background: rgba(124,58,237,0.1);
  color: var(--text-main);
}

.nav-btn.active {
  background: rgba(124,58,237,0.15);
  color: #c4b5fd;
  border: 1px solid rgba(124,58,237,0.3);
}

.nav-btn.active i { color: var(--cyan); }

.nav-active-bar {
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--grad-primary);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto; padding: 2px 7px;
  border-radius: 10px; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}

.nav-badge.live {
  background: rgba(239,68,68,0.2); color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.4);
  animation: livePulse 1.5s ease infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.nav-badge.green {
  background: rgba(16,185,129,0.2); color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.4);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}

.sys-status-block {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.sys-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.sys-dot.online { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); animation: dotPulse 2s ease infinite; }
.sys-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); animation: dotPulse 2s ease infinite; }

@keyframes dotPulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.5; }
}

.sys-info { display: flex; flex-direction: column; }
.sys-label { font-size: 10px; color: var(--text-dim); }
.sys-val { font-size: 11px; color: var(--cyan); font-weight: 600; }

.sidebar-version {
  font-size: 10px; color: var(--text-dim);
  text-align: center; letter-spacing: 1px;
}

/* ============================================================
   MAIN
   ============================================================ */
.main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 0%, rgba(124,58,237,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(6,182,212,0.04) 0%, transparent 50%),
              var(--bg-surface);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,10,22,0.8);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

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

.topbar-toggle {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 8px;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.topbar-toggle:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }

.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; }
.breadcrumb-root { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.bc-sep { font-size: 10px; color: var(--text-dim); }
.breadcrumb-current { font-size: 13px; font-weight: 600; color: var(--text-main); }

.topbar-center { flex: 1; overflow: hidden; }

.live-ticker {
  display: flex; align-items: center; gap: 10px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 20px; padding: 4px 12px;
  overflow: hidden;
}

.ticker-label {
  font-size: 10px; font-weight: 700;
  color: var(--red); letter-spacing: 1px;
  flex-shrink: 0; display: flex; align-items: center; gap: 4px;
}

.ticker-track {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track span {
  display: inline-block;
  font-size: 11px; color: var(--text-muted);
  animation: tickerScroll 40s linear infinite;
}

@keyframes tickerScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

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

.topbar-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--cyan);
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.2);
  padding: 4px 10px; border-radius: var(--radius-sm);
}

.notif-btn {
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 16px; position: relative;
  padding: 6px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.notif-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.06); }
.notif-dot {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg-surface);
}

.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--purple); }
.user-meta { display: flex; flex-direction: column; }
.u-name { font-size: 13px; font-weight: 600; }
.u-role { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrapper {
  flex: 1; overflow-y: auto; padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,58,237,0.3) transparent;
}

.page { display: none; }
.page.active { display: block; animation: pageIn 0.3s ease; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title-bar { margin-bottom: 24px; }
.page-title-bar h2 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-title-bar h2 i { color: var(--purple-light); }
.page-title-bar p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px; display: flex; align-items: flex-start; gap: 14px;
  position: relative; overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-dark);
  opacity: 0;
  transition: var(--transition);
}

.kpi-card:hover { border-color: var(--border-bright); box-shadow: var(--shadow-glow); }
.kpi-card:hover::before { opacity: 1; }

.kpi-card[data-color="purple"] { border-top: 2px solid var(--purple); }
.kpi-card[data-color="cyan"] { border-top: 2px solid var(--cyan); }
.kpi-card[data-color="green"] { border-top: 2px solid var(--green); }
.kpi-card[data-color="red"] { border-top: 2px solid var(--red); }

.kpi-icon {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.kpi-card[data-color="purple"] .kpi-icon { background: rgba(124,58,237,0.2); color: var(--purple-light); border: 1px solid rgba(124,58,237,0.3); }
.kpi-card[data-color="cyan"] .kpi-icon { background: rgba(6,182,212,0.15); color: var(--cyan); border: 1px solid rgba(6,182,212,0.3); }
.kpi-card[data-color="green"] .kpi-icon { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.kpi-card[data-color="red"] .kpi-icon { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

.kpi-body { flex: 1; display: flex; flex-direction: column; gap: 2px; position: relative; }
.kpi-val { font-size: 28px; font-weight: 800; font-family: 'JetBrains Mono', monospace; line-height: 1; }

.kpi-card[data-color="purple"] .kpi-val { color: var(--purple-light); }
.kpi-card[data-color="cyan"] .kpi-val { color: var(--cyan); }
.kpi-card[data-color="green"] .kpi-val { color: var(--green); }
.kpi-card[data-color="red"] .kpi-val { color: var(--red); }

.kpi-label { font-size: 11px; color: var(--text-muted); }

.kpi-delta {
  font-size: 11px; display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
}
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }

.kpi-sparkline { width: 60px; height: 40px; position: absolute; right: 16px; bottom: 16px; }

/* ============================================================
   GLASS PANELS
   ============================================================ */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,0.4), rgba(6,182,212,0.4), transparent);
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; color: var(--text-main);
}

.panel-title i { color: var(--purple-light); }

.panel-actions { display: flex; gap: 6px; }

.pill-btn {
  padding: 4px 10px; border-radius: 20px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 11px; cursor: pointer;
  transition: var(--transition);
}

.pill-btn.active,
.pill-btn:hover {
  background: rgba(124,58,237,0.2);
  border-color: var(--purple); color: var(--purple-light);
}

/* ============================================================
   CHART ROW LAYOUTS
   ============================================================ */
.chart-row {
  display: flex; gap: 16px;
}

.mt-16 { margin-top: 16px; }

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

/* ============================================================
   ISSUE LIST
   ============================================================ */
.issue-list { display: flex; flex-direction: column; gap: 8px; }

.issue-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid transparent; transition: var(--transition);
}

.issue-item.critical { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); }
.issue-item.warning { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }
.issue-item.info { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.2); }
.issue-item.ok { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.2); }

.issue-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.issue-item.critical .issue-icon { color: var(--red); }
.issue-item.warning .issue-icon { color: var(--yellow); }
.issue-item.info .issue-icon { color: #818cf8; }
.issue-item.ok .issue-icon { color: var(--green); }

.issue-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.issue-title { font-size: 12px; font-weight: 600; }
.issue-meta { font-size: 10px; color: var(--text-muted); }

.issue-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.issue-score.pos { color: var(--green); }
.issue-score.neg { color: var(--red); }
.issue-score.warn { color: var(--yellow); }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.activity-feed::-webkit-scrollbar { width: 4px; }
.activity-feed::-webkit-scrollbar-track { background: transparent; }
.activity-feed::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 2px; }

.af-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
}

.af-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.af-dot.reply { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-glow); }
.af-dot.counter { background: var(--purple-light); box-shadow: 0 0 6px var(--purple-glow); }
.af-dot.hide { background: var(--yellow); }
.af-dot.detect { background: var(--red); }

.af-body { flex: 1; }
.af-action { font-size: 11px; font-weight: 600; }
.af-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.af-time { font-size: 10px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }

/* ============================================================
   DONUT LEGEND
   ============================================================ */
.donut-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.dl-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.dl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   LIVE / BADGES
   ============================================================ */
.live-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px; font-size: 9px;
  font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  background: rgba(239,68,68,0.15); color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  animation: livePulse 1.5s ease infinite;
}

.badge-pro {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px; font-size: 9px;
  font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  background: rgba(124,58,237,0.2); color: var(--purple-light);
  border: 1px solid rgba(124,58,237,0.4);
}

/* ============================================================
   TWO COLUMN / LAYOUTS
   ============================================================ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-grp { margin-bottom: 14px; }
.form-grp label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}

.hint { font-weight: 400; font-style: italic; text-transform: none; }

.nx-input {
  width: 100%; padding: 10px 14px;
  background: rgba(5,6,15,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main); font-family: inherit; font-size: 13px;
  transition: var(--transition); resize: vertical;
}

.nx-input:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

.nx-input::placeholder { color: var(--text-dim); }

.input-eye { position: relative; }
.input-eye button {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
}

.form-row { display: flex; gap: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); border: none;
  text-decoration: none;
}

.nx-btn-primary {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,0.4);
}
.nx-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,58,237,0.5); }

.nx-btn-secondary {
  background: rgba(255,255,255,0.06); color: var(--text-main);
  border: 1px solid var(--border);
}
.nx-btn-secondary:hover { background: rgba(255,255,255,0.1); }

.nx-btn-outline {
  background: transparent; color: var(--purple-light);
  border: 1px solid rgba(124,58,237,0.4);
}
.nx-btn-outline:hover { background: rgba(124,58,237,0.1); }

.nx-btn-success { background: var(--grad-green); color: #fff; }
.nx-btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.nx-btn-danger { background: var(--grad-red); color: #fff; }
.nx-btn-icon { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 10px; }
.nx-btn-icon:hover { color: var(--text-main); border-color: var(--purple); }
.nx-btn-sm { padding: 7px 12px; font-size: 12px; }

.full-w { width: 100%; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.mt-12 { margin-top: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ============================================================
   SENTIMENT ANALYZER OUTPUT
   ============================================================ */
.sa-result-box { animation: pageIn 0.3s ease; }
.sa-gauge-row { display: flex; gap: 20px; align-items: center; }
.sa-gauge-wrap { position: relative; flex-shrink: 0; }
.gauge-label-center {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.gauge-label-center span:first-child { font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.gauge-label-center span:last-child { font-size: 11px; color: var(--text-muted); }

.sa-breakdown { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sb-item { display: flex; flex-direction: column; gap: 3px; }
.sb-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sb-val { font-size: 16px; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--cyan); }

.flag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.flag-tag {
  padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600;
}
.flag-tag.pos { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.flag-tag.neg { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.flag-tag.crit { background: rgba(245,158,11,0.15); color: #fde68a; border: 1px solid rgba(245,158,11,0.3); }

.nx-badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; background: rgba(100,116,139,0.2);
  color: #94a3b8; border: 1px solid rgba(100,116,139,0.3);
}
.nx-badge.pos { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.4); }
.nx-badge.neg { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.nx-badge.crit { background: rgba(245,158,11,0.15); color: #fde68a; border-color: rgba(245,158,11,0.4); }

.counter-block {
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-md); padding: 14px;
}

.cb-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--purple-light);
  margin-bottom: 10px;
}

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metric-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.metric-card {
  padding: 14px 10px; border-radius: var(--radius-md);
  text-align: center; border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(5,6,15,0.5);
}

.metric-card.green .mc-val { color: var(--green); }
.metric-card.red .mc-val { color: var(--red); }
.metric-card.yellow .mc-val { color: var(--yellow); }
.metric-card.blue .mc-val { color: var(--purple-light); }

.mc-val { font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.mc-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }

/* ============================================================
   KEYWORD CLOUD
   ============================================================ */
.keyword-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.kw {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: default;
  transition: var(--transition);
}
.kw:hover { transform: scale(1.05); }
.kw.pos { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.kw.neg { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.kw.crit { background: rgba(245,158,11,0.12); color: #fde68a; border: 1px solid rgba(245,158,11,0.25); }

/* ============================================================
   COUNTER NARRATIVE VARIANTS
   ============================================================ */
.counter-variant {
  background: rgba(124,58,237,0.05);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-md); padding: 14px;
}
.cv-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--purple-light);
  margin-bottom: 10px;
}
.cv-body {
  font-size: 13px; line-height: 1.6; color: var(--text-main);
  min-height: 40px;
}

/* ============================================================
   HISTORY LIST
   ============================================================ */
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 500px; overflow-y: auto; }
.history-item {
  padding: 12px; border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.history-item.neg { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.15); }
.history-item.pos { background: rgba(16,185,129,0.05); border-color: rgba(16,185,129,0.15); }
.history-item.crit { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.15); }

.hi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.hi-sentiment { padding: 2px 8px; border-radius: 20px; font-size: 9px; font-weight: 700; }
.neg-badge { background: rgba(239,68,68,0.2); color: #fca5a5; }
.pos-badge { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.crit-badge { background: rgba(245,158,11,0.2); color: #fde68a; }
.hi-time { font-size: 10px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.hi-input { font-size: 12px; color: var(--text-muted); font-style: italic; margin-bottom: 4px; }
.hi-output { font-size: 11px; color: var(--cyan); }

/* ============================================================
   BUZZER ENGINE
   ============================================================ */
.rules-container { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }

.rule-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: var(--radius-md);
  background: rgba(5,6,15,0.5); border: 1px solid var(--border);
}
.rule-priority { padding: 2px 7px; border-radius: 20px; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.rule-priority.high { background: rgba(239,68,68,0.2); color: #fca5a5; }
.rule-priority.medium { background: rgba(245,158,11,0.2); color: #fde68a; }
.rule-priority.low { background: rgba(100,116,139,0.2); color: #94a3b8; }
.rule-keyword { font-weight: 700; color: var(--purple-light); font-size: 13px; }
.rule-template { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.rule-action-badge { padding: 2px 8px; border-radius: 20px; font-size: 9px; background: rgba(6,182,212,0.15); color: var(--cyan); border: 1px solid rgba(6,182,212,0.3); font-weight: 700; }
.rule-del-btn { background: transparent; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; border-radius: 4px; margin-left: auto; }
.rule-del-btn:hover { color: var(--red); }

.rule-count-badge { font-size: 11px; color: var(--cyan); background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.2); padding: 2px 8px; border-radius: 20px; }

.scanner-row { display: flex; gap: 12px; align-items: flex-start; }

.scan-out {
  background: #01030a; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--green); max-height: 200px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.6;
}

/* ============================================================
   SOCIAL FEED
   ============================================================ */
.social-feed { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.sf-item { padding: 12px; border-radius: var(--radius-md); border: 1px solid transparent; }
.sf-item.pos-sf { background: rgba(16,185,129,0.04); border-color: rgba(16,185,129,0.15); }
.sf-item.neg-sf { background: rgba(239,68,68,0.04); border-color: rgba(239,68,68,0.15); }
.sf-item.crit-sf { background: rgba(245,158,11,0.04); border-color: rgba(245,158,11,0.15); }
.sf-user { font-size: 12px; font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.sf-icon { font-size: 14px; }
.ig-c { color: #e1306c; }
.sf-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 6px; }
.sf-meta { display: flex; align-items: center; gap: 8px; }
.sf-time { font-size: 10px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.pos-badge-sm { font-size: 9px; padding: 1px 6px; border-radius: 10px; background: rgba(16,185,129,0.2); color: #6ee7b7; font-weight: 700; }
.neg-badge-sm { font-size: 9px; padding: 1px 6px; border-radius: 10px; background: rgba(239,68,68,0.2); color: #fca5a5; font-weight: 700; }
.crit-badge-sm { font-size: 9px; padding: 1px 6px; border-radius: 10px; background: rgba(245,158,11,0.2); color: #fde68a; font-weight: 700; }

.platform-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.ps-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.ps-item strong { color: var(--text-main); font-family: 'JetBrains Mono', monospace; }

/* ============================================================
   HASHTAG PAGE
   ============================================================ */
.hashtag-gen-row { display: flex; gap: 12px; align-items: flex-end; }
.w-120 { width: 120px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; min-height: 60px; }
.tag-pill-nx {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.tag-pill-nx:hover { transform: scale(1.06); }
.tag-pill-nx.topic { background: rgba(124,58,237,0.15); color: #c4b5fd; border: 1px solid rgba(124,58,237,0.3); }
.tag-pill-nx.viral { background: rgba(236,72,153,0.15); color: #f9a8d4; border: 1px solid rgba(236,72,153,0.3); }
.tag-pill-nx.regional { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.tag-pill-nx.niche { background: rgba(6,182,212,0.15); color: #67e8f9; border: 1px solid rgba(6,182,212,0.3); }

.breakdown-row { margin-bottom: 12px; }
.breakdown-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; letter-spacing: 1px; }
.breakdown-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ============================================================
   IG PREVIEW
   ============================================================ */
.ig-preview-card {
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; overflow: hidden; max-width: 360px; margin: 0 auto;
}
.igp-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.igp-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-primary); }
.igp-username { font-size: 13px; font-weight: 700; flex: 1; }
.igp-more { color: var(--text-muted); cursor: pointer; }
.igp-img { width: 100%; height: 280px; background: #111; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 36px; }
.igp-img img { width: 100%; height: 100%; object-fit: cover; }
.igp-actions { display: flex; gap: 14px; padding: 12px 14px 8px; font-size: 20px; color: var(--text-main); }
.igp-caption { font-size: 12px; padding: 0 14px 14px; color: var(--text-muted); line-height: 1.5; }

/* ============================================================
   AUDIT LOG TERMINAL
   ============================================================ */
.log-terminal {
  background: #01030a; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  max-height: 60vh; overflow-y: auto; line-height: 2;
  scrollbar-width: thin; scrollbar-color: rgba(124,58,237,0.3) transparent;
}
.log-line { display: block; }
.log-line.sys { color: var(--purple-light); }
.log-line.info { color: var(--cyan); }
.log-line.ok { color: var(--green); }
.log-line.warn { color: var(--yellow); }
.log-line.err { color: var(--red); }
.log-line.bot { color: #a78bfa; }

/* ============================================================
   MISC
   ============================================================ */
.empty-nx { text-align: center; padding: 24px; color: var(--text-dim); font-size: 12px; }

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex-1 { flex: 1; min-width: 0; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }
.w-120 { width: 120px; }
.full-w { width: 100%; }

/* ============================================================
   SCAN OUTPUT FORMATTING
   ============================================================ */
.scan-out {
  background: #01030a; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--green); max-height: 200px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.6;
}

/* ============================================================
   RULE COUNT BADGE
   ============================================================ */
.rule-count { font-size: 11px; color: var(--cyan);
  background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.2);
  padding: 2px 8px; border-radius: 20px; }

/* ============================================================
   GLOW EFFECTS ON HOVER
   ============================================================ */
.kpi-card:hover .kpi-icon {
  box-shadow: 0 0 20px currentColor;
}

/* ============================================================
   RESPONSIVE: Compact on smaller screens
   ============================================================ */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { flex-wrap: wrap; }
  .flex-3 { flex: 1 1 100%; }
}

@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
  .sidebar { width: 220px; }
  :root { --sidebar-w: 220px; }
}

@media (max-width: 800px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .topbar-center { display: none; }
}

