/* ═══════════════════════════════════════════════════════════════════════════
   GlobalBreach — Cyber Threat Map Styles
   Dark-mode, cinematic SOC aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* Core palette */
  --bg:            #030812;
  --bg-deep:       #020609;
  --bg-panel:      rgba(4, 12, 28, 0.88);
  --bg-panel-alt:  rgba(6, 16, 36, 0.92);
  --bg-hover:      rgba(0, 212, 255, 0.06);

  /* Borders */
  --border:        rgba(0, 212, 255, 0.14);
  --border-strong: rgba(0, 212, 255, 0.28);
  --border-subtle: rgba(0, 212, 255, 0.07);

  /* Text */
  --text-primary:  #e2e8f0;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --text-dim:      #1e3a5f;

  /* Accent */
  --accent:        #00d4ff;
  --accent-glow:   rgba(0, 212, 255, 0.35);
  --accent-dim:    rgba(0, 212, 255, 0.12);
  --green:         #0affb0;
  --green-glow:    rgba(10, 255, 176, 0.35);

  /* Map colours */
  --map-ocean:     #030e1e;
  --map-land:      #0a1e3a;
  --map-land-2:    #0c2347;
  --map-border:    rgba(30, 100, 180, 0.18);
  --map-graticule: rgba(20, 60, 140, 0.18);

  /* Feed colours (also defined in JS feeds.js — keep in sync) */
  --c-malware:    #ff3366;
  --c-phishing:   #ff8c00;
  --c-botnet:     #a855f7;
  --c-ransomware: #ff0055;
  --c-exploit:    #00d4ff;
  --c-cred:       #fbbf24;
  --c-ddos:       #10b981;

  /* Layout */
  --header-h:     56px;
  --panel-w:      320px;
  --bottom-h:     52px;
  --radius:       8px;
  --radius-sm:    5px;

  /* Typography */
  --font-ui:   'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

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

/* ══════════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════════ */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  background: rgba(2, 6, 14, 0.80);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  /* Subtle top glow line */
  box-shadow: 0 1px 0 rgba(0,212,255,0.08), 0 2px 20px rgba(0,0,0,0.5);
}

.header-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left  { flex: 0 0 auto; }
.header-center { flex: 1; justify-content: center; }
.header-right { flex: 0 0 auto; }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
}

.logo-mark {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 6px rgba(0,212,255,0.5));
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.logo-name strong {
  font-weight: 700;
  color: var(--accent);
}

.logo-sub {
  font-size: 9px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* Connection status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.4s;
  flex-shrink: 0;
}

.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.error { background: var(--c-malware); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.status-text {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* Stat pills */
.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(0,212,255,0.05);
  border: 1px solid var(--border);
}

.pill-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.pill-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  min-width: 32px;
  text-align: right;
}

.header-time {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════════════════════
   MAP CONTAINER
   ══════════════════════════════════════════════════════════════════════════ */
#map-container {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: var(--panel-w);
  bottom: var(--bottom-h);
  background: radial-gradient(ellipse at 50% 40%, #071525 0%, var(--bg-deep) 70%);
  overflow: hidden;
}

#map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Map element styles (applied via D3 .attr('class', ...)) */
.sphere {
  fill: var(--map-ocean);
}

.graticule {
  fill: none;
  stroke: var(--map-graticule);
  stroke-width: 0.35;
}

.country {
  fill: var(--map-land);
  stroke: var(--map-border);
  stroke-width: 0.4;
  transition: fill 0.2s;
}

.country:hover {
  fill: var(--map-land-2);
  cursor: default;
}

.borders {
  fill: none;
  stroke: rgba(40, 120, 200, 0.12);
  stroke-width: 0.3;
}

/* Threat arcs */
.threat-arc {
  pointer-events: none;
}

/* Markers */
.source-dot, .target-dot {
  pointer-events: none;
}

/* Vignette overlay */
#map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 50%,
    rgba(3,8,18,0.55) 100%);
  pointer-events: none;
}

/* ── Loading screen ─────────────────────────────────────────────────────── */
#loading-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  transition: opacity 0.6s ease, visibility 0.6s;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loader-hex {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 16px rgba(0,212,255,0.6));
}

.loader-brand {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--text-primary);
}
.loader-brand strong { font-weight: 700; color: var(--accent); }

.loader-track {
  width: 180px;
  height: 2px;
  background: rgba(0,212,255,0.12);
  border-radius: 2px;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}

.loader-msg {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════════════════════
   RIGHT SIDEBAR — EVENT TICKER
   ══════════════════════════════════════════════════════════════════════════ */
#event-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: var(--panel-w);
  bottom: var(--bottom-h);
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Subtle inner glow on left edge */
  box-shadow: -1px 0 30px rgba(0,0,0,0.4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.event-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 10px;
  padding: 1px 8px;
  min-width: 28px;
  text-align: center;
}

#event-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0;
}

/* Individual event cards */
.event-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: default;
  transition: background 0.15s;
  animation: slideIn 0.25s ease-out;
}

.event-card:hover {
  background: var(--bg-hover);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.event-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.event-feed-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.event-feed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.event-severity {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 1px 6px;
  border-radius: 3px;
}

.sev-low      { color: #64748b; background: rgba(100,116,139,0.12); }
.sev-medium   { color: #f59e0b; background: rgba(245,158,11,0.12); }
.sev-high     { color: #f97316; background: rgba(249,115,22,0.14); }
.sev-critical { color: #ef4444; background: rgba(239,68,68,0.16);
                animation: pulse-sev 1.5s ease infinite; }

@keyframes pulse-sev {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

.event-route {
  font-size: 11.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-route .arrow {
  color: var(--text-muted);
  margin: 0 4px;
}

.event-label {
  font-size: 10.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   BOTTOM BAR — FEED CONTROLS + STATS
   ══════════════════════════════════════════════════════════════════════════ */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: var(--panel-w);
  height: var(--bottom-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: rgba(2,6,14,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  z-index: 50;
}

.controls-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#feed-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#feed-toggles {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Feed toggle pill */
.feed-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.feed-toggle.active {
  opacity: 1;
}

.feed-toggle.inactive {
  opacity: 0.35;
  filter: grayscale(1);
}

.feed-toggle:hover {
  opacity: 0.85;
}

.feed-toggle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Stats panel */
#stats-panel {
  flex: 1;
  overflow: hidden;
}

#feed-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.feed-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.feed-stat-item:hover { opacity: 1; }

.feed-stat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.feed-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.feed-stat-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOOLTIP
   ══════════════════════════════════════════════════════════════════════════ */
#tooltip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  background: rgba(3, 14, 32, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,255,0.08);
  max-width: 260px;
  backdrop-filter: blur(12px);
  transition: opacity 0.15s;
}

#tooltip.hidden { opacity: 0; pointer-events: none; }

.tooltip-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}

.tooltip-key   { color: var(--text-muted); }
.tooltip-value { font-family: var(--font-mono); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════════════
   COUNTRY HOVER LABELS (SVG elements rendered by map.js)
   ══════════════════════════════════════════════════════════════════════════ */

/* The label group is absolutely positioned within the SVG via transform */
.country-label-group { pointer-events: none; }

.country-label-name {
  dominant-baseline: middle;
  letter-spacing: 0.2px;
}

.country-label-sub {
  dominant-baseline: middle;
  letter-spacing: 0.5px;
}

/* Country fill transition for hover / hot states */
.country {
  transition: fill 0.3s ease, stroke 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   SCANLINE OVERLAY (subtle CRT texture on map)
   ══════════════════════════════════════════════════════════════════════════ */
#map-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — compact on smaller viewports
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --panel-w:  0px;
    --bottom-h: 44px;
  }

  #event-panel {
    display: none; /* hide ticker, map takes full width */
  }

  #map-container {
    right: 0;
  }

  #bottom-bar {
    right: 0;
    overflow-x: auto;
  }

  .logo-sub { display: none; }

  .stat-pill { padding: 4px 8px; }
  .pill-value { font-size: 12px; }
}

@media (max-width: 600px) {
  .header-right  { display: none; }
  .header-center { gap: 6px; }
  .stat-pill { display: none; }
  #feed-toggles { gap: 4px; }
  .feed-toggle { padding: 3px 7px; font-size: 10px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   EVENT DETAIL DRAWER
   ══════════════════════════════════════════════════════════════════════════ */

/* Backdrop dims the map when drawer is open */
#drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#drawer-backdrop.drawer-open {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer panel — slides in from the right, overlays the ticker */
#event-drawer {
  position: fixed;
  top: var(--header-h);
  right: -400px;   /* start fully off-screen */
  width: 360px;
  bottom: var(--bottom-h);
  z-index: 150;
  background: var(--bg-panel-alt);
  border-left: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.8);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#event-drawer.drawer-open { right: 0; }

#drawer-header {
  position: relative;   /* for the accent bar pseudo-element */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  gap: 10px;
}

/* Left-edge colour accent bar driven by --drawer-accent-color */
#drawer-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--drawer-accent-color, var(--accent));
  box-shadow: 0 0 8px var(--drawer-accent-color, var(--accent));
}

#drawer-feed-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.drawer-feed-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }

.drawer-feed-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#drawer-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
#drawer-close:hover { color: var(--accent); border-color: var(--accent); }

#drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px 24px;
}

.drawer-section-title {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-top: 18px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-section-title:first-child { margin-top: 4px; }

.drawer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-row:last-of-type { border-bottom: none; }

.drawer-key {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.drawer-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

/* Severity colours in drawer */
.drawer-value.sev-low      { color: #64748b; }
.drawer-value.sev-medium   { color: #f59e0b; }
.drawer-value.sev-high     { color: #f97316; }
.drawer-value.sev-critical { color: #ef4444; }

.drawer-event-id {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  word-break: break-all;
  line-height: 1.6;
}

/* Cards are now clickable */
.event-card { cursor: pointer; }
.event-card:active { background: rgba(0, 212, 255, 0.04); }

@media (max-width: 900px) {
  #event-drawer { width: 100%; right: -100%; }
  #event-drawer.drawer-open { right: 0; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN CONSOLE PANEL
   ══════════════════════════════════════════════════════════════════════════ */

/* Gear button in header */
.admin-gear-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.admin-gear-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Panel — slides up from the bottom-right corner */
#admin-panel {
  position: fixed;
  bottom: var(--bottom-h);
  right: var(--panel-w);
  width: 370px;
  max-height: 0;
  overflow: hidden;
  z-index: 160;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: -2px -4px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0,212,255,0.06);
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#admin-panel.admin-open {
  max-height: 82vh;
  overflow-y: auto;
}

#admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1;
}
.admin-panel-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}
#admin-panel-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
}
#admin-panel-close:hover { color: var(--accent); }

/* Auth section */
#admin-auth-section { padding: 16px; }
.admin-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.admin-hint code {
  font-family: var(--font-mono);
  background: rgba(0,212,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}
#admin-auth-form {
  display: flex;
  gap: 8px;
}
#admin-auth-form input,
#admin-inject-form select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  transition: border-color 0.15s;
}
#admin-auth-form input { flex: 1; }
#admin-auth-form input:focus,
#admin-inject-form select:focus { outline: none; border-color: var(--accent); }

#admin-auth-form button,
#admin-inject-form button {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  white-space: nowrap;
  transition: background 0.15s;
}
#admin-auth-form button:hover,
#admin-inject-form button:hover { background: rgba(0, 212, 255, 0.18); }

.admin-error {
  color: var(--c-malware);
  font-size: 11px;
  margin-top: 6px;
  min-height: 16px;
}
.admin-status {
  font-family: var(--font-mono);
  font-size: 10px;
  margin-top: 6px;
  min-height: 14px;
}

/* Sections */
.admin-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-section:last-child { border-bottom: none; }
.admin-section-title {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Feed rows */
.admin-feed-row {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-feed-row:last-child { border-bottom: none; margin-bottom: 0; }

.admin-feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.admin-feed-icon { font-size: 13px; }
.admin-feed-label { font-size: 11px; font-weight: 600; flex: 1; }
.admin-feed-count { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); }

.admin-feed-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-secondary);
  flex-shrink: 0;
  user-select: none;
}
.admin-toggle-label input { accent-color: var(--accent); }

.admin-rate-control {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}
.admin-rate-label {
  font-size: 9px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.admin-rate-slider {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 3px;
}
.admin-rate-value {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

/* Inject form */
#admin-inject-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#admin-inject-form select { width: 100%; }

/* Stats */
.admin-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-stat-row:last-child { border-bottom: none; }
.admin-stat-row span:first-child { color: var(--text-muted); }
.admin-stat-row span:last-child {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
}
