/* ============================================
   AGENTENEWS — CSS PRINCIPAL
   Tema: Espacio oscuro (público) + Admin oscuro
   ============================================ */

:root {
  --space-black: #000511;
  --space-blue: #001122;
  --space-navy: #0a0f2e;
  --accent: #4a90e2;
  --accent-green: #00ff88;
  --accent-red: #ff0040;
  --accent-orange: #ff6600;
  --accent-yellow: #ffcc00;
  --text-primary: #e8eaf0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;
  --border: #1e2a3a;
  --card-bg: #0d1421;
  --card-hover: #111927;
  --admin-bg: #0a0e17;
  --admin-sidebar: #060a12;
  --admin-card: #0e1520;
  --admin-border: #1a2332;
  --admin-text: #c8d3e0;
  --priority-critical: #ff0040;
  --priority-high: #ff6600;
  --priority-medium: #ffcc00;
  --priority-low: #4a90e2;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(74,144,226,0.3);
}

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--space-black);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-green); }

/* ============================================
   PUBLIC LAYOUT
   ============================================ */
.public-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.site-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 56px;
  background: rgba(0,5,17,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 100;
  flex-wrap: wrap;
}

.header-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--accent); font-size: 18px; font-weight: 700;
  white-space: nowrap;
}
.header-brand i { font-size: 20px; }
.header-brand strong { color: var(--accent-green); }
.brand-beta {
  font-size: 9px; background: var(--accent); color: #000;
  padding: 1px 5px; border-radius: 3px; font-weight: 700;
}

/* ── Section strip ── */
.section-strip {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 8px;
  background: rgba(0,5,17,0.94);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 99;
  backdrop-filter: blur(8px);
}
.sec-strip-scroll {
  display: flex; gap: 3px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
  padding: 2px 0;
}
.sec-strip-scroll::-webkit-scrollbar { display: none; }

/* Icon chip — always shows icon + text with horizontal scroll */
.sec-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent; cursor: pointer;
  color: var(--text-muted); white-space: nowrap;
  font-size: 12px; transition: all 0.22s;
  flex-shrink: 0;
}
.sec-chip i { font-size: 13px; flex-shrink: 0; transition: color 0.2s; }
.sec-chip-name {
  font-weight: 500; font-size: 12px;
}
.sec-chip:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.15); background: var(--card-bg); }
.sec-chip.active {
  color: var(--sc, var(--accent));
  border-color: var(--sc, var(--accent));
  background: rgba(74,144,226,0.12);
}
.sec-chip.active i { color: var(--sc, var(--accent)); }

/* Scroll arrows */
.sec-scroll-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  transition: all 0.15s;
}
.sec-scroll-btn:hover { border-color: var(--accent); color: var(--accent); }
.sec-clear-btn {
  background: rgba(255,0,64,0.1); border: 1px solid rgba(255,0,64,0.3);
  color: var(--accent-red); width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 11px; transition: all 0.15s;
}
.sec-clear-btn:hover { background: rgba(255,0,64,0.2); }

/* Legacy nav-tab — kept for module tabs */
.nav-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius);
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary); cursor: pointer;
  white-space: nowrap; font-size: 12px;
  transition: all 0.2s;
}
.nav-tab:hover { color: var(--text-primary); background: var(--card-bg); }
.nav-tab.active {
  color: var(--section-color, var(--accent));
  border-color: var(--section-color, var(--accent));
  background: rgba(74,144,226,0.1);
}

/* Module nav bar */
.module-nav-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 16px;
  background: rgba(0,255,136,0.04);
  border-bottom: 1px solid rgba(0,255,136,0.12);
  overflow-x: auto; scrollbar-width: none;
}
.module-nav-row::-webkit-scrollbar { display: none; }
.module-nav-label {
  font-size: 11px; color: rgba(0,255,136,0.55); white-space: nowrap;
  font-weight: 600; letter-spacing: 0.03em; margin-right: 4px;
}
.module-tab.active {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.4);
  color: #00ff88;
}
/* Zoom controls (added by universe.js JS) */
#univ-zoom-ctrl button:hover {
  background: rgba(74,144,226,0.2) !important;
  border-color: rgba(74,144,226,0.6) !important;
}

.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.live-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 4px 8px;
  border-radius: 20px;
}
.live-status.live { color: var(--accent-green); background: rgba(0,255,136,0.1); }
.live-status.offline { color: var(--text-muted); background: rgba(255,255,255,0.05); }

.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.live .pulse-dot { animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.view-switcher { display: flex; gap: 2px; }
.view-btn {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.view-btn:hover, .view-btn.active {
  background: var(--accent); color: white; border-color: var(--accent);
}

.btn-login {
  padding: 6px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-secondary); font-size: 13px;
}
.btn-login:hover { border-color: var(--accent); color: var(--accent); }
.btn-register {
  padding: 6px 14px; background: var(--accent);
  border-radius: var(--radius); color: white; font-size: 13px;
}
.btn-register:hover { background: var(--accent-green); color: #000; }
.btn-user {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-secondary);
}

/* Critical banner */
.critical-banner {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,0,64,0.15); border-bottom: 1px solid rgba(255,0,64,0.3);
  padding: 8px 20px; color: #ff6680;
}
.alert-ticker { flex: 1; overflow: hidden; }
.alert-item { margin-right: 40px; }
.close-banner { background: transparent; border: none; color: inherit; cursor: pointer; }

/* Trending bar */
.trending-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 16px;
  background: rgba(255,107,0,0.06); border-bottom: 1px solid rgba(255,107,0,0.15);
  overflow-x: auto; scrollbar-width: thin;
}
.trending-label {
  font-size: 11px; font-weight: 700; color: #ff6b00; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.trending-items { display: flex; gap: 6px; overflow-x: auto; }
.trending-chip {
  display: flex; align-items: center; gap: 5px; padding: 3px 10px;
  background: rgba(255,107,0,0.08); border: 1px solid rgba(255,107,0,0.2);
  border-radius: 16px; cursor: pointer; white-space: nowrap; font-size: 12px;
  transition: all 0.2s; color: var(--text);
}
.trending-chip:hover { background: rgba(255,107,0,0.15); border-color: #ff6b00; }
.trending-count {
  font-weight: 700; color: #ff6b00; font-size: 11px;
  background: rgba(255,107,0,0.15); padding: 1px 5px; border-radius: 8px;
}
.trending-title { font-weight: 500; }
.trending-section { font-size: 10px; color: var(--text-muted); }

/* Stats bar */
.stats-bar {
  display: flex; gap: 0;
  background: var(--space-navy);
  border-bottom: 1px solid var(--border);
}
.stat-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 20px; border-right: 1px solid var(--border);
  flex: 1;
}
.stat-num { font-size: 20px; font-weight: 700; color: var(--accent); }
.stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

/* Search in stats bar */
.stat-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; flex: 2; min-width: 200px;
}
.stat-search .fa-search { color: var(--text-muted); font-size: 13px; }
.search-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); padding: 4px 10px; font-size: 13px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-clear {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px 4px; font-size: 11px;
}
.search-clear:hover { color: var(--text); }

.time-slider {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-left: 1px solid var(--border); white-space: nowrap;
}
.slider-range { height: 4px; cursor: pointer; }
.slider-label {
  font-size: 11px; color: var(--accent); font-weight: 600; min-width: 28px;
}
.time-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
  transition: all 0.15s; padding: 0;
}
.time-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.time-btn:disabled { opacity: 0.3; cursor: default; }

/* Content */
.content-area { flex: 1; overflow-y: auto; padding: 20px; }

/* Loading */
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 300px; gap: 16px; color: var(--text-secondary);
}
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-universe { text-align: center; padding: 60px; color: var(--text-secondary); }
.empty-universe i { font-size: 48px; display: block; margin-bottom: 16px; color: var(--accent); }

/* Events Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.event-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; cursor: pointer;
  transition: all 0.2s;
}
.event-card:hover { background: var(--card-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.event-card.priority-critical { border-left: 3px solid var(--priority-critical); }
.event-card.priority-high { border-left: 3px solid var(--priority-high); }
.event-card.priority-medium { border-left: 3px solid var(--priority-medium); }
.event-card.priority-low { border-left: 3px solid var(--priority-low); }

.event-card-header { display: flex; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.event-priority {
  padding: 2px 8px; border-radius: 20px; font-weight: 700;
  font-size: 11px; text-transform: uppercase;
}
.priority-critical .event-priority { background: rgba(255,0,64,0.2); color: var(--priority-critical); }
.priority-high .event-priority { background: rgba(255,102,0,0.2); color: var(--priority-high); }
.priority-medium .event-priority { background: rgba(255,204,0,0.2); color: var(--priority-medium); }
.priority-low .event-priority { background: rgba(74,144,226,0.2); color: var(--priority-low); }

.event-section { color: var(--text-secondary); }
.event-impact { margin-left: auto; font-weight: 700; color: var(--accent); }
.event-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.event-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; }
.event-footer { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.event-trend { color: var(--accent-green); }
.trend-surging { color: var(--accent-green); }
.trend-decreasing, .trend-declining { color: var(--text-muted); }

/* Events List */
.events-list { display: flex; flex-direction: column; gap: 8px; }
.event-list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; cursor: pointer;
  transition: all 0.2s;
}
.event-list-item:hover { background: var(--card-hover); }
.priority-border-critical { border-left: 3px solid var(--priority-critical); }
.priority-border-high { border-left: 3px solid var(--priority-high); }
.priority-border-medium { border-left: 3px solid var(--priority-medium); }
.priority-border-low { border-left: 3px solid var(--priority-low); }
.eli-content { flex: 1; }
.eli-content h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.eli-content p { font-size: 12px; color: var(--text-secondary); }
.eli-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.eli-impact { font-size: 24px; font-weight: 700; color: var(--accent); min-width: 48px; text-align: center; }

/* Universe Canvas */
.universe-container {
  width: 100%; height: calc(100vh - 160px);
  position: relative; overflow: hidden;
}
#universe-canvas { width: 100%; height: 100%; }
.universe-tooltip {
  position: absolute; background: rgba(0,5,17,0.95);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; pointer-events: none; z-index: 10;
  max-width: 250px; font-size: 12px;
}

/* Event Modal */
.event-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(4px);
}
.event-modal {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 700px;
  max-height: 85vh; overflow-y: auto; margin: 20px;
}
.em-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px;
}
.priority-bg-critical { background: rgba(255,0,64,0.15); }
.priority-bg-high { background: rgba(255,102,0,0.15); }
.priority-bg-medium { background: rgba(255,204,0,0.1); }
.priority-bg-low { background: rgba(74,144,226,0.1); }
.em-badges { display: flex; gap: 8px; }
.em-priority, .em-section {
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,0.1);
}
.em-close { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; font-size: 18px; }
.em-body { padding: 20px; }
.em-body h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.em-desc { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }
.em-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.em-tag { background: rgba(74,144,226,0.15); color: var(--accent); padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.em-body h4 { font-size: 14px; color: var(--text-secondary); margin-bottom: 10px; text-transform: uppercase; }
.em-articles { display: flex; flex-direction: column; gap: 4px; }
.em-article {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.em-article:hover { background: rgba(74,144,226,0.07); border-color: rgba(74,144,226,0.25); }
.em-article-expanded { background: rgba(74,144,226,0.06) !important; border-color: rgba(74,144,226,0.35) !important; }
.em-art-row { display: flex; align-items: center; gap: 8px; }
.em-art-type { font-size: 10px; padding: 2px 6px; background: var(--border); border-radius: 3px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.em-art-title { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.em-art-chevron { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.em-art-detail { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.07); }
.em-art-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.em-art-summary { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 10px; }
.em-art-no-summary { font-size: 12px; color: var(--text-muted); font-style: italic; margin: 0 0 10px; }
.em-art-source-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent); text-decoration: none; }
.em-art-source-link:hover { text-decoration: underline; }

/* ============================================
   EVENT MODAL — UNIFIED CHRONOLOGY
   ============================================ */
.event-modal-full { max-width: 920px; width: 96vw; max-height: 88vh; display: flex; flex-direction: column; }
.em-body-grid { display: grid; grid-template-columns: 1fr 240px; flex: 1; min-height: 0; overflow: hidden; }
.em-main { overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 0; }
.em-sidebar { overflow-y: auto; padding: 14px; background: rgba(0,0,0,0.18); border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.em-title { font-size: 20px; font-weight: 700; margin: 0 0 8px; line-height: 1.3; color: var(--text); }
.em-meta-bar { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.em-meta-bar i { margin-right: 3px; color: var(--accent); }
.em-badge-archived { background: rgba(255,255,255,0.1); color: var(--text-muted); font-size: 10px; padding: 2px 6px; border-radius: 3px; }
.em-trend-badge { font-size: 11px; color: var(--text-secondary); opacity: .8; }
.em-timeline-header { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: .1em; margin: 14px 0 8px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; justify-content: space-between; }
.em-gen-btn { background: rgba(74,144,226,0.12); border: 1px solid rgba(74,144,226,0.3); color: var(--accent); border-radius: 4px; padding: 3px 8px; font-size: 11px; cursor: pointer; transition: background 0.15s; }
.em-gen-btn:hover { background: rgba(74,144,226,0.25); }
.em-ai-label { font-size: 10px; color: var(--accent); display: flex; align-items: center; gap: 4px; margin: 6px 0 3px; font-weight: 600; letter-spacing: 0.03em; }
.em-timeline { display: flex; flex-direction: column; }
.em-tl-day { margin-bottom: 14px; }
.em-tl-day-label { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(74,144,226,0.2); }
.em-tl-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 5px; cursor: pointer; transition: background 0.12s; margin-bottom: 2px; }
.em-tl-item:hover { background: rgba(74,144,226,0.07); }
.em-tl-expanded { background: rgba(74,144,226,0.06) !important; }
.em-tl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.priority-dot-critical { background: #ff0040; }
.priority-dot-high { background: #ff6600; }
.priority-dot-medium { background: #e6b800; }
.priority-dot-low { background: #4a90e2; }
.em-tl-content { flex: 1; min-width: 0; }
.em-tl-time { font-size: 10px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; margin-right: 2px; }
/* Sidebar cards */
.em-side-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.em-side-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.em-impact-display { display: flex; align-items: baseline; gap: 3px; margin-bottom: 6px; }
.em-impact-num { font-size: 30px; font-weight: 700; color: var(--text); line-height: 1; }
.em-impact-max { font-size: 13px; color: var(--text-muted); }
.em-impact-bar-wrap { height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; margin-bottom: 2px; }
.em-impact-bar { height: 100%; background: var(--accent); border-radius: 3px; }
.priority-bar-critical { background: #ff0040; }
.priority-bar-high { background: #ff6600; }
.priority-bar-medium { background: #e6b800; }
.priority-bar-low { background: #4a90e2; }
.em-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 12px; color: var(--text-secondary); }
.em-stat-row:last-child { border-bottom: none; }
.em-stat-row strong { color: var(--text); font-weight: 600; }
.em-day-bar-row { display: flex; align-items: center; margin-bottom: 5px; font-size: 11px; gap: 4px; }
.em-day-label-sm { color: var(--text-muted); min-width: 34px; }
.em-day-count { color: var(--text-muted); min-width: 18px; text-align: right; }
.em-related-item { display: flex; align-items: flex-start; gap: 6px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; font-size: 12px; color: var(--text-secondary); transition: color 0.12s; }
.em-related-item:hover { color: var(--text); }
.em-related-item:last-child { border-bottom: none; }
.em-related-title { flex: 1; line-height: 1.3; }
.em-priority-sm { font-size: 9px; padding: 1px 4px; border-radius: 3px; color: #fff; flex-shrink: 0; margin-top: 1px; font-weight: 700; }
@media (max-width: 680px) {
  .em-body-grid { grid-template-columns: 1fr; }
  .em-sidebar { border-left: none; border-top: 1px solid var(--border); }
}

/* ============================================
   MAP VIEW
   ============================================ */
.map-container { width: 100%; height: calc(100vh - 160px); position: relative; }
#map-view { width: 100%; height: 100%; }
.map-layer-controls { position: absolute; top: 12px; right: 12px; z-index: 1000; background: rgba(0,5,17,0.9); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.map-layer-controls label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.map-layer-controls input[type=checkbox] { accent-color: var(--accent); }

/* ── Language toggle (EN/ES) ── */
.lang-toggle { display: flex; background: rgba(255,255,255,0.06); border-radius: 20px; padding: 2px; gap: 2px; }
.lang-btn {
  padding: 2px 9px; border-radius: 18px; border: none; background: none;
  color: var(--text-muted); font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-btn.lang-active { background: var(--accent); color: #fff; }
.lang-btn:hover:not(.lang-active) { color: var(--text-primary); }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #001133 0%, #000511 60%);
}
.auth-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px;
  margin: 20px;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; margin-bottom: 24px;
  color: var(--accent); font-size: 22px; font-weight: 700;
}
.auth-logo i { font-size: 28px; }
.auth-logo strong { color: var(--accent-green); }
.auth-card h2 { text-align: center; margin-bottom: 8px; }
.auth-subtitle { color: var(--text-secondary); font-size: 13px; text-align: center; margin-bottom: 24px; }
.auth-error {
  background: rgba(255,0,64,0.1); border: 1px solid rgba(255,0,64,0.3);
  border-radius: var(--radius); padding: 12px; color: #ff6680;
  margin-bottom: 16px; font-size: 13px;
}
.auth-success {
  background: rgba(0,255,136,0.08); border: 1px solid rgba(0,255,136,0.3);
  border-radius: var(--radius); padding: 16px; color: var(--accent-green);
  margin-bottom: 16px; font-size: 13px; text-align: center;
}
.auth-success i { font-size: 28px; margin-bottom: 8px; display: block; }
.auth-success p { color: var(--text-secondary); margin: 8px 0 0; }
.btn-auth {
  width: 100%; padding: 12px; background: var(--accent);
  border: none; border-radius: var(--radius); color: white;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
  transition: all 0.2s;
}
.btn-auth:hover:not(:disabled) { background: var(--accent-green); color: #000; }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-links { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-secondary); }

/* ============================================
   FORM COMPONENTS
   ============================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }
.form-input {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px; color: var(--text-primary);
  font-size: 14px; transition: border-color 0.2s; width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input option { background: var(--card-bg); }
textarea.form-input { resize: vertical; font-family: inherit; }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-error {
  background: rgba(255,0,64,0.1); border: 1px solid rgba(255,0,64,0.3);
  border-radius: var(--radius); padding: 10px; color: #ff6680; font-size: 13px;
}
.form-success {
  background: rgba(0,255,136,0.1); border: 1px solid rgba(0,255,136,0.3);
  border-radius: var(--radius); padding: 10px; color: var(--accent-green); font-size: 13px;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.color-input-group { display: flex; gap: 8px; align-items: center; }
.color-picker { width: 40px; height: 36px; border: none; background: none; cursor: pointer; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px; margin: 20px;
  max-height: 90vh; overflow-y: auto;
}
.modal-large { max-width: 760px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--admin-border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-header button { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--admin-border);
}

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--accent); border: none;
  border-radius: var(--radius); color: white; font-size: 14px;
  cursor: pointer; font-weight: 500; transition: all 0.2s;
}
.btn-primary:hover:not(:disabled) { background: #5aa0f0; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  padding: 8px 16px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-secondary); font-size: 14px; cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-sm {
  padding: 4px 10px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-secondary); font-size: 12px; cursor: pointer;
}
.btn-sm:hover, .btn-sm.active { background: var(--accent); color: white; border-color: var(--accent); }
.btn-icon {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-icon.btn-danger:hover { background: rgba(255,0,64,0.2); border-color: rgba(255,0,64,0.5); color: #ff6680; }
.btn-action {
  padding: 6px 10px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-secondary); cursor: pointer;
}
.btn-action:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* Status */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-active { background: var(--accent-green); }
.dot-inactive { background: var(--text-muted); }
.status-badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-running { background: rgba(255,204,0,0.2); color: var(--accent-yellow); }
.status-completed { background: rgba(0,255,136,0.2); color: var(--accent-green); }
.status-failed { background: rgba(255,0,64,0.2); color: var(--accent-red); }
.status-idle { background: rgba(255,255,255,0.1); color: var(--text-muted); }

/* Priority badges */
.priority-badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.priority-critical { background: rgba(255,0,64,0.2); color: #ff4060; }
.priority-high { background: rgba(255,102,0,0.2); color: #ff8040; }
.priority-medium { background: rgba(255,204,0,0.2); color: #ffcc00; }
.priority-low { background: rgba(74,144,226,0.2); color: var(--accent); }

/* ============================================
   DATA TABLE
   ============================================ */
.data-table-container { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--admin-border); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: rgba(255,255,255,0.03); padding: 10px 12px;
  text-align: left; font-size: 12px; color: var(--text-secondary);
  text-transform: uppercase; font-weight: 600;
  border-bottom: 1px solid var(--admin-border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tr:last-child td { border-bottom: none; }
.td-id { color: var(--text-muted); font-size: 12px; }
.td-title { max-width: 300px; }
.td-actions { display: flex; gap: 4px; }
.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sortable:hover { color: var(--accent); }
.th-sortable .fa { font-size: 10px; margin-left: 4px; opacity: 0.6; }
.th-sortable:hover .fa { opacity: 1; }
.clickable-row { cursor: pointer; }

.mini-bar { width: 60px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* Section badge */
.section-badge {
  padding: 2px 8px; background: rgba(74,144,226,0.15);
  color: var(--accent); border-radius: 20px; font-size: 11px;
}
.type-badge {
  padding: 2px 6px; background: rgba(255,255,255,0.1);
  color: var(--text-muted); border-radius: 3px; font-size: 11px;
}

/* Pagination */
.pagination {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  padding: 16px; color: var(--text-secondary);
}
.pagination button {
  width: 32px; height: 32px; background: var(--admin-card);
  border: 1px solid var(--admin-border); border-radius: var(--radius);
  color: var(--text-secondary); cursor: pointer;
}
.pagination button:hover:not(:disabled) { background: var(--accent); color: white; }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* Filter bar */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 0; flex-wrap: wrap; margin-bottom: 16px;
}
.search-input {
  flex: 1; min-width: 200px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--admin-border);
  border-radius: var(--radius); padding: 8px 12px; color: var(--text-primary);
  font-size: 14px;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.filter-select {
  background: rgba(255,255,255,0.05); border: 1px solid var(--admin-border);
  border-radius: var(--radius); padding: 8px 12px; color: var(--text-primary);
  font-size: 14px; cursor: pointer;
}
.filter-count { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* ============================================
   ADMIN SHELL
   ============================================ */
.admin-shell { display: flex; min-height: 100vh; background: var(--admin-bg); }

.admin-sidebar {
  width: 220px; min-height: 100vh;
  background: var(--admin-sidebar); border-right: 1px solid var(--admin-border);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: width 0.3s;
}
.admin-sidebar.collapsed { width: 56px; }
.admin-sidebar.collapsed .nav-item span,
.admin-sidebar.collapsed .sidebar-logo span,
.admin-sidebar.collapsed .nav-section-label { display: none; }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px; color: var(--accent); font-size: 14px; font-weight: 700;
  border-bottom: 1px solid var(--admin-border);
  text-decoration: none; cursor: pointer;
}
.sidebar-logo:hover { color: #fff; }
.sidebar-logo i { font-size: 20px; flex-shrink: 0; }
.sidebar-logo strong { color: var(--accent-green); }

.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; padding: 10px 8px 4px; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--text-secondary); font-size: 13px; transition: all 0.2s;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.nav-item.active { background: rgba(74,144,226,0.15); color: var(--accent); }
.nav-item i { width: 16px; flex-shrink: 0; }
.nav-logout:hover { color: var(--accent-red); }

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

.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.admin-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 48px; background: var(--admin-sidebar);
  border-bottom: 1px solid var(--admin-border);
}
.sidebar-toggle {
  background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 16px;
}
.topbar-breadcrumb { flex: 1; color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.bc-link { color: var(--text-secondary); text-decoration: none; display: flex; align-items: center; gap: 5px; }
.bc-link:hover { color: var(--accent); }
.bc-sep { color: var(--border); font-size: 10px; }
.bc-current { color: var(--text-primary); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; gap: 6px; }

.admin-content { flex: 1; overflow-y: auto; padding: 20px; }

/* ============================================
   ADMIN PAGE
   ============================================ */
.admin-page { max-width: 1400px; margin: 0 auto; }
.page-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex: 1; }
.page-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.header-tabs { display: flex; gap: 4px; }
.tab-btn { padding: 6px 14px; background: transparent; border: 1px solid var(--admin-border); border-radius: var(--radius); color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ============================================
   GOD MODE
   ============================================ */
.god-mode { max-width: 1400px; margin: 0 auto; padding: 20px; }

.gm-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--admin-border);
}
.gm-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; font-weight: 700; color: var(--accent);
}
.gm-title i { font-size: 24px; }
.gm-live {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
}
.gm-live.live { background: rgba(0,255,136,0.1); color: var(--accent-green); }
.gm-live.offline { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.gm-time { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gm-header-actions { display: flex; align-items: center; gap: 10px; }

/* KPI Cards */
.gm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi-card {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 16px; position: relative;
  transition: all 0.3s;
}
.kpi-card.kpi-active { border-color: var(--accent-green); box-shadow: 0 0 15px rgba(0,255,136,0.1); }
.kpi-card.kpi-warn { border-color: var(--accent-orange); }
.kpi-card.kpi-alert { border-color: var(--accent-red); box-shadow: 0 0 15px rgba(255,0,64,0.1); }
.kpi-icon { font-size: 20px; color: var(--accent); margin-bottom: 8px; display: block; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.kpi-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* God Mode Grid */
.gm-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto;
  gap: 16px;
}
.gm-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gm-panel {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.gm-panel-wide { grid-column: 1 / -1; }
.panel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--admin-border);
  font-size: 13px; font-weight: 600;
}
.panel-header i { color: var(--accent); }
.panel-header span { flex: 1; }
.panel-link { font-size: 12px; color: var(--accent); }
.panel-actions { display: flex; gap: 6px; margin-left: auto; }

/* Agent Log Feed */
.agent-log-feed {
  height: 300px; overflow-y: auto; padding: 8px;
  font-family: 'Consolas', monospace; font-size: 12px;
  background: rgba(0,0,0,0.3);
}
.log-entry {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 3px 6px; border-radius: 3px; margin-bottom: 2px;
}
.log-entry:hover { background: rgba(255,255,255,0.03); }
.log-time { color: var(--text-muted); flex-shrink: 0; }
.log-badge {
  padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700;
  flex-shrink: 0; text-transform: uppercase;
}
.badge-info { background: rgba(74,144,226,0.2); color: var(--accent); }
.badge-warning { background: rgba(255,204,0,0.2); color: var(--accent-yellow); }
.badge-error { background: rgba(255,0,64,0.2); color: var(--accent-red); }
.badge-debug { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.log-agent { color: var(--accent-green); flex-shrink: 0; }
.log-msg { color: var(--text-secondary); word-break: break-word; }
.log-empty { text-align: center; padding: 40px; color: var(--text-muted); }
.log-empty i { display: block; font-size: 24px; margin-bottom: 8px; }

.agent-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--admin-border);
}
.btn-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: rgba(74,144,226,0.1);
  border: 1px solid rgba(74,144,226,0.3); border-radius: var(--radius);
  color: var(--accent); font-size: 12px; cursor: pointer;
  transition: all 0.2s;
}
.btn-trigger:hover:not(:disabled) { background: rgba(74,144,226,0.2); }
.btn-trigger.running { background: rgba(0,255,136,0.1); border-color: rgba(0,255,136,0.3); color: var(--accent-green); }
.btn-trigger:disabled { opacity: 0.6; cursor: not-allowed; }

/* Costs panel */
.cost-total { padding: 12px 16px; }
.cost-amount { font-size: 28px; font-weight: 700; color: var(--accent); }
.cost-period { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.provider-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.provider-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.provider-name { width: 80px; color: var(--text-secondary); flex-shrink: 0; }
.provider-bar { flex: 1; height: 6px; background: var(--admin-border); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.provider-cost { width: 70px; text-align: right; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.over-budget { color: var(--accent-red) !important; }
.select-sm {
  background: transparent; border: 1px solid var(--admin-border);
  border-radius: var(--radius); padding: 4px 8px; color: var(--text-secondary); font-size: 12px;
}

/* Health */
.health-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.health-row { display: flex; align-items: center; gap: 10px; padding: 8px; background: rgba(255,255,255,0.02); border-radius: var(--radius); }
.health-indicator { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ok { background: var(--accent-green); box-shadow: 0 0 8px rgba(0,255,136,0.4); }
.fail { background: var(--accent-red); box-shadow: 0 0 8px rgba(255,0,64,0.4); }
.health-name { flex: 1; font-size: 13px; }
.health-value { font-size: 12px; color: var(--text-muted); }

/* Alerts panel */
.alert-list { padding: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.alert-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  background: rgba(255,255,255,0.02); border: 1px solid transparent;
}
.alert-row.severity-critical { border-color: rgba(255,0,64,0.3); background: rgba(255,0,64,0.05); }
.alert-row.severity-high { border-color: rgba(255,102,0,0.3); background: rgba(255,102,0,0.05); }
.alert-info { flex: 1; }
.alert-title { display: block; font-size: 12px; font-weight: 500; }
.alert-time { font-size: 11px; color: var(--text-muted); }
.btn-ack {
  width: 28px; height: 28px; background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.3); border-radius: var(--radius);
  color: var(--accent-green); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.no-alerts { text-align: center; padding: 20px; color: var(--text-muted); }
.no-alerts i { display: block; margin-bottom: 8px; }

/* GodMode table */
.gm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gm-table th { padding: 10px 12px; text-align: left; color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; border-bottom: 1px solid var(--admin-border); }
.gm-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.gm-table tr:hover td { background: rgba(255,255,255,0.02); }
.clickable-row { cursor: pointer; }

/* Log modal */
.log-modal-body { max-height: 400px; overflow-y: auto; font-family: 'Consolas', monospace; font-size: 12px; background: rgba(0,0,0,0.3); padding: 8px; border-radius: var(--radius); }

/* ── GodMode sidebar navigation ─────────────── */
.gm-body { display: flex; gap: 0; min-height: calc(100vh - 200px); }
.gm-sidebar {
  width: 60px; flex-shrink: 0;
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 8px 6px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 20px; height: fit-content;
}
.gm-nav-btn {
  width: 48px; height: 48px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--text-muted); transition: all 0.15s; padding: 0;
}
.gm-nav-btn i { font-size: 16px; }
.gm-nav-btn span { font-size: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.gm-nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
.gm-nav-btn.active {
  background: rgba(74,144,226,0.12); border-color: rgba(74,144,226,0.3);
  color: var(--accent);
}
.gm-nav-sep { height: 1px; background: var(--admin-border); margin: 4px 4px; }
.gm-content { flex: 1; min-width: 0; padding-left: 16px; }

/* ── Agent config grid ───────────────────── */
.agent-config-grid { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.agent-cfg-row {
  display: grid; grid-template-columns: 44px 1fr 130px 120px;
  align-items: center; gap: 10px; padding: 8px 16px;
  border-radius: 6px; border: 1px solid transparent; transition: background 0.12s;
}
.agent-cfg-row:hover { background: rgba(255,255,255,0.03); border-color: var(--admin-border); }
.agent-cfg-row.disabled-agent { opacity: 0.5; }
.agent-cfg-name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.agent-cfg-interval, .agent-cfg-maxtokens { display: flex; align-items: center; gap: 6px; }
.agent-cfg-interval input, .agent-cfg-maxtokens input {
  width: 72px; background: rgba(0,0,0,0.3); border: 1px solid var(--admin-border);
  border-radius: 5px; padding: 4px 8px; color: var(--text-primary); font-size: 12px;
}
.cfg-unit { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.next-run-badge {
  font-size: 10px; color: var(--text-muted); background: rgba(255,255,255,0.04);
  border-radius: 4px; padding: 2px 6px; white-space: nowrap;
}
.next-run-running { color: var(--accent-green); }

/* toggle switch */
.toggle-sw { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  width: 32px; height: 17px; background: rgba(255,255,255,0.1); border-radius: 9px;
  border: 1px solid var(--admin-border); transition: background 0.2s;
  display: flex; align-items: center;
}
.toggle-sw input:checked + .toggle-track { background: rgba(0,255,136,0.3); border-color: rgba(0,255,136,0.4); }
.toggle-thumb {
  width: 11px; height: 11px; background: var(--text-muted); border-radius: 50%;
  margin-left: 2px; transition: all 0.2s; flex-shrink: 0;
}
.toggle-sw input:checked + .toggle-track .toggle-thumb {
  background: var(--accent-green); margin-left: 17px;
}

/* ── Source health panel ─────────────────── */
.source-health-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.source-health-table th { padding: 8px 10px; text-align: left; color: var(--text-muted); font-size: 10px; text-transform: uppercase; border-bottom: 1px solid var(--admin-border); }
.source-health-table td { padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.source-health-table tr:hover td { background: rgba(255,255,255,0.02); }
.health-bar { width: 60px; height: 5px; background: var(--admin-border); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.health-bar-fill { height: 100%; border-radius: 3px; }
.src-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.src-ok { background: var(--accent-green); box-shadow: 0 0 6px rgba(0,255,136,0.5); }
.src-warn { background: var(--accent-yellow); }
.src-fail { background: var(--accent-red); box-shadow: 0 0 6px rgba(255,0,64,0.4); }

/* ── Kpi flash animation on refresh ─────── */
@keyframes kpi-flash {
  0%   { opacity: 1; }
  30%  { opacity: 0.4; }
  100% { opacity: 1; }
}
.kpi-refreshing .kpi-value { animation: kpi-flash 0.4s ease; }

/* ── Audit log ───────────────────────────── */
.audit-list { max-height: 300px; overflow-y: auto; font-size: 12px; }
.audit-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.1s;
}
.audit-row:hover { background: rgba(255,255,255,0.02); }
.audit-time { color: var(--text-muted); flex-shrink: 0; font-size: 11px; width: 70px; }
.audit-user { color: var(--accent); flex-shrink: 0; width: 90px; overflow: hidden; text-overflow: ellipsis; }
.audit-action { color: var(--text-secondary); flex: 1; }
.audit-entity { color: var(--text-muted); font-size: 11px; }

/* ── Metrics row ─────────────────────────── */
.metrics-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; padding: 12px 16px;
}
.metric-box {
  background: rgba(0,0,0,0.2); border: 1px solid var(--admin-border);
  border-radius: 8px; padding: 10px 12px; text-align: center;
}
.metric-val { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.metric-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

/* ── Log search bar ──────────────────────── */
.log-search { display: flex; align-items: center; gap: 6px; }
.log-search input {
  width: 160px; background: rgba(0,0,0,0.3); border: 1px solid var(--admin-border);
  border-radius: 5px; padding: 4px 8px; color: var(--text-primary); font-size: 12px;
}
.btn-pause { padding: 4px 8px; font-size: 11px; background: rgba(255,204,0,0.1); border: 1px solid rgba(255,204,0,0.3); border-radius: 5px; color: var(--accent-yellow); cursor: pointer; }
.btn-pause.paused { background: rgba(0,255,136,0.1); border-color: rgba(0,255,136,0.3); color: var(--accent-green); }
.btn-export { padding: 4px 8px; font-size: 11px; background: transparent; border: 1px solid var(--admin-border); border-radius: 5px; color: var(--text-muted); cursor: pointer; }
.btn-export:hover { border-color: var(--text-secondary); color: var(--text-secondary); }

/* ============================================
   AI CONFIGS
   ============================================ */
.ai-providers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ai-card {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); overflow: hidden; transition: all 0.2s;
}
.ai-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ai-card-default { border-color: var(--accent); box-shadow: 0 0 15px rgba(74,144,226,0.15); }
.ai-card-inactive { opacity: 0.6; }
.ai-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--admin-border);
}
.ai-provider-badge {
  padding: 4px 10px; border-radius: var(--radius);
  font-size: 12px; font-weight: 700;
}
.provider-claude { background: rgba(255,102,0,0.2); color: #ff8844; }
.provider-openai { background: rgba(0,167,120,0.2); color: #00a778; }
.provider-kimi { background: rgba(99,102,241,0.2); color: #8b8ff0; }
.provider-gemini { background: rgba(66,133,244,0.2); color: #4285f4; }
.provider-groq { background: rgba(240,68,56,0.2); color: #f04438; }
.provider-custom { background: rgba(255,255,255,0.1); color: var(--text-secondary); }
.badge-default { font-size: 11px; padding: 2px 8px; background: rgba(74,144,226,0.2); color: var(--accent); border-radius: 20px; }
.badge-sys { background: rgba(255,255,255,0.1); color: var(--text-muted); }
.ai-card-body { padding: 16px; }
.ai-name { font-size: 16px; font-weight: 600; }
.ai-model { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; font-family: monospace; }
.ai-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ai-stat { background: rgba(255,255,255,0.03); border-radius: var(--radius); padding: 8px; }
.stat-label { display: block; font-size: 11px; color: var(--text-muted); }
.stat-val { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ai-card-footer { display: flex; align-items: center; justify-content: space-between; }
.ai-status { font-size: 12px; font-weight: 600; }
.status-active { color: var(--accent-green); }
.status-inactive { color: var(--text-muted); }
.btn-test {
  padding: 6px 12px; background: rgba(74,144,226,0.1);
  border: 1px solid rgba(74,144,226,0.3); border-radius: var(--radius);
  color: var(--accent); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.btn-test:hover:not(:disabled) { background: rgba(74,144,226,0.2); }
.btn-test.testing { border-color: var(--accent-yellow); color: var(--accent-yellow); }
.test-result {
  margin-top: 10px; padding: 8px; border-radius: var(--radius);
  font-size: 12px; display: flex; align-items: center; gap: 6px;
}
.test-ok { background: rgba(0,255,136,0.1); color: var(--accent-green); }
.test-fail { background: rgba(255,0,64,0.1); color: var(--accent-red); }

/* ============================================
   SECTIONS
   ============================================ */
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.section-card { background: var(--admin-card); border: 1px solid; border-radius: var(--radius-lg); overflow: hidden; }
.section-card-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.section-icon { font-size: 20px; }
.section-info { flex: 1; }
.section-name { display: block; font-weight: 600; }
.section-slug { display: block; font-size: 11px; color: var(--text-muted); }
.section-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 700; background: rgba(74,144,226,0.2); color: var(--accent); }
.badge-priv { background: rgba(255,0,64,0.2); color: #ff6680; }
.section-card-body { padding: 14px 16px; }
.section-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.section-keywords { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.kw-chip { background: rgba(255,255,255,0.08); padding: 2px 8px; border-radius: 20px; font-size: 11px; color: var(--text-secondary); }
.kw-more { font-size: 11px; color: var(--text-muted); padding: 2px 4px; }
.kw-weight { color: var(--text-muted); font-size: 10px; }
.section-stats { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; }
.section-card-footer { padding: 10px 16px; border-top: 1px solid var(--admin-border); display: flex; gap: 8px; }

/* ============================================
   USER PAGES
   ============================================ */
.user-page { max-width: 1200px; }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.module-card { background: var(--admin-card); border: 1px solid; border-radius: var(--radius-lg); overflow: hidden; }
.module-inactive { opacity: 0.6; }
.module-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.module-name { flex: 1; font-weight: 600; }
.btn-toggle-active {
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; cursor: pointer; border: none;
}
.btn-toggle-active.on { background: rgba(0,255,136,0.2); color: var(--accent-green); }
.btn-toggle-active.off { background: rgba(255,255,255,0.1); color: var(--text-muted); }
.module-body { padding: 14px 16px; }
.module-stats { display: flex; gap: 16px; margin: 12px 0; }
.mstat { text-align: center; }
.mstat-val { display: block; font-size: 18px; font-weight: 700; }
.mstat-lbl { display: block; font-size: 11px; color: var(--text-muted); }
.module-rss { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 6px; background: rgba(74,144,226,0.1); padding: 6px 8px; border-radius: var(--radius); }
.module-rss code { font-size: 11px; }
.module-footer { padding: 10px 16px; border-top: 1px solid var(--admin-border); display: flex; gap: 8px; }
.empty-modules { grid-column: 1/-1; text-align: center; padding: 60px; color: var(--text-secondary); }
.empty-modules i { font-size: 40px; color: var(--accent); display: block; margin-bottom: 16px; }

/* Module prompt & status */
.module-prompt { margin-bottom: 10px; }
.module-prompt-label { font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; margin-bottom: 4px; }
.module-prompt-text {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
  background: rgba(255,255,255,0.03); padding: 8px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05); max-height: 80px; overflow-y: auto;
}
.module-rejection {
  font-size: 12px; color: #ff6b6b; background: rgba(255,107,107,0.1);
  padding: 6px 10px; border-radius: 6px; margin-bottom: 8px;
}
.prompt-status-badge {
  padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.prompt-status-badge.approved { background: rgba(0,255,136,0.15); color: var(--accent-green); }
.prompt-status-badge.pending { background: rgba(255,159,67,0.15); color: var(--accent-orange, #ff9f43); }
.prompt-status-badge.rejected { background: rgba(255,107,107,0.15); color: #ff6b6b; }

/* Report list in modal */
.report-list-item {
  padding: 12px 14px; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: background 0.15s;
}
.report-list-item:hover { background: rgba(255,255,255,0.04); }
.report-list-item.expanded { background: rgba(255,255,255,0.03); border-color: var(--accent); }
.report-list-header { display: flex; align-items: center; gap: 10px; }
.report-list-title { font-weight: 600; font-size: 14px; flex: 1; }
.report-list-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.report-list-summary { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.report-list-content {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 13px; line-height: 1.7; color: var(--text);
}
.form-success {
  background: rgba(0,255,136,0.1); color: var(--accent-green);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-top: 12px;
}

/* Notification channels */
.channels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 12px; margin-bottom: 32px; }
.channel-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 14px 16px;
}
.channel-inactive { opacity: 0.6; }
.channel-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.channel-telegram { background: rgba(0,136,204,0.2); color: #0088cc; }
.channel-whatsapp { background: rgba(37,211,102,0.2); color: #25d366; }
.channel-email { background: rgba(234,67,53,0.2); color: #ea4335; }
.channel-discord { background: rgba(88,101,242,0.2); color: #5865f2; }
.channel-webhook { background: rgba(255,204,0,0.2); color: var(--accent-yellow); }
.channel-info { flex: 1; }
.channel-name { font-weight: 600; }
.channel-type { font-size: 12px; color: var(--text-muted); }
.channel-stats { font-size: 11px; color: var(--text-muted); }
.verified-badge { font-size: 12px; color: var(--accent-green); display: flex; align-items: center; gap: 4px; }
.btn-verify { padding: 4px 10px; background: rgba(255,204,0,0.1); border: 1px solid rgba(255,204,0,0.3); border-radius: var(--radius); color: var(--accent-yellow); font-size: 12px; cursor: pointer; }
.channel-type-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.channel-type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 14px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--admin-border); border-radius: var(--radius);
  color: var(--text-secondary); cursor: pointer; font-size: 12px; transition: all 0.2s;
  min-width: 80px;
}
.channel-type-btn:hover { border-color: var(--accent); color: var(--accent); }
.channel-type-btn.selected { background: rgba(74,144,226,0.1); border-color: var(--accent); color: var(--accent); }
.channel-type-btn i { font-size: 20px; }
.notif-history { margin-top: 20px; }
.notif-history h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.empty-channels { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--text-secondary); }
.empty-channels i { font-size: 32px; color: var(--text-muted); display: block; margin-bottom: 12px; }

/* User cell */
.user-cell { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.role-badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.role-superadmin { background: rgba(255,0,64,0.2); color: #ff4060; }
.role-admin { background: rgba(255,102,0,0.2); color: var(--accent-orange); }
.role-analyst { background: rgba(74,144,226,0.2); color: var(--accent); }
.role-user { background: rgba(0,255,136,0.2); color: var(--accent-green); }
.row-inactive td { opacity: 0.5; }
.header-stats { display: flex; gap: 16px; color: var(--text-secondary); font-size: 13px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .gm-grid { grid-template-columns: 1fr; }
  .gm-dash-grid { grid-template-columns: 1fr; }
  .gm-kpis { grid-template-columns: repeat(2, 1fr); }
  .gm-panel-wide { grid-column: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: 1; }
  .admin-sidebar { position: fixed; z-index: 200; height: 100vh; transform: translateX(-100%); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .events-grid { grid-template-columns: 1fr; }
  .ai-providers-grid { grid-template-columns: 1fr; }
  .stats-bar { overflow-x: auto; }
  .site-header { height: auto; padding: 8px 12px; }
  .section-strip { top: 0; position: relative; }
  .sec-scroll-btn { display: none; }
}

/* ============================================
   SCROLLBARS
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state { text-align: center; padding: 60px; color: var(--text-secondary); }
.empty-state i { font-size: 48px; color: var(--accent); display: block; margin-bottom: 16px; opacity: 0.5; }
.not-found { text-align: center; padding: 80px; }
.not-found h1 { font-size: 80px; color: var(--accent); }

/* ============================================
   USER DASHBOARD
   ============================================ */
.user-dashboard { max-width: 1200px; }
.dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.user-greeting { display: flex; align-items: center; gap: 16px; }
.user-greeting .user-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-green));
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.user-greeting h1 { font-size: 22px; font-weight: 700; margin: 0 0 2px; }
.user-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px;
}
.user-stat-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 16px;
}
.user-stat-card .stat-icon { font-size: 22px; color: var(--accent); opacity: 0.7; }
.user-stat-card .stat-value { font-size: 24px; font-weight: 700; line-height: 1; }
.user-stat-card .stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dashboard-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.dashboard-panel {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.panel-wide { grid-column: span 2; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--admin-border);
}
.panel-header h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.panel-link { font-size: 12px; color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 4px; }
.panel-body { padding: 16px; }
.empty-panel { text-align: center; padding: 24px; color: var(--text-muted); }
.empty-panel i { display: block; margin-bottom: 8px; }
.empty-panel p { font-size: 13px; margin-bottom: 12px; }

.module-list { display: flex; flex-direction: column; gap: 8px; }
.module-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: rgba(255,255,255,0.02);
  border-radius: var(--radius); border: 1px solid var(--admin-border);
}
.module-item.inactive { opacity: 0.5; }
.module-item-info strong { display: block; font-size: 13px; }
.module-item-info small { color: var(--text-muted); }
.module-item-badges { display: flex; gap: 4px; align-items: center; }

.channel-list { display: flex; flex-direction: column; gap: 8px; }
.channel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: rgba(255,255,255,0.02);
  border-radius: var(--radius); border: 1px solid var(--admin-border);
}
.channel-item .channel-icon { width: 32px; height: 32px; font-size: 14px; }
.channel-item .channel-info strong { display: block; font-size: 13px; }
.channel-item .channel-info small { color: var(--text-muted); font-size: 11px; }
.channel-status { margin-left: auto; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.active { background: var(--accent-green); box-shadow: 0 0 6px rgba(0,255,136,0.4); }
.status-dot.warning { background: var(--accent-yellow); }

.event-list { display: flex; flex-direction: column; gap: 6px; }
.event-item {
  display: flex; align-items: stretch;
  background: rgba(255,255,255,0.02); border-radius: var(--radius);
  border: 1px solid var(--admin-border); overflow: hidden;
}
.event-priority-bar { width: 3px; flex-shrink: 0; }
.event-item.priority-critical .event-priority-bar { background: var(--accent-red); }
.event-item.priority-high .event-priority-bar { background: var(--accent-orange); }
.event-item.priority-medium .event-priority-bar { background: var(--accent-yellow); }
.event-item.priority-low .event-priority-bar { background: var(--accent); }
.event-content { padding: 8px 12px; flex: 1; }
.event-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.event-meta { display: flex; gap: 8px; font-size: 11px; align-items: center; }

.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-link {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--admin-border); border-radius: var(--radius);
  color: var(--text-secondary); text-decoration: none; font-size: 13px; transition: all 0.2s;
}
.quick-link:hover { border-color: var(--accent); color: var(--accent); background: rgba(74,144,226,0.05); }
.quick-link i { font-size: 16px; color: var(--accent); opacity: 0.7; }

/* ============================================
   SOURCES MANAGEMENT
   ============================================ */
.source-stats {
  display: flex; gap: 20px; padding: 14px 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
}
.source-stat { text-align: center; }
.source-stat .stat-number { display: block; font-size: 22px; font-weight: 700; }
.source-stat .stat-label { display: block; font-size: 11px; color: var(--text-muted); }
.url-cell { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.credibility-bar { display: flex; align-items: center; gap: 6px; }
.credibility-bar .credibility-fill { height: 4px; background: var(--accent); border-radius: 2px; }
.credibility-bar span { font-size: 12px; color: var(--text-muted); }
.badge-type-rss { background: rgba(255,102,0,0.2); color: var(--accent-orange); }
.badge-type-api { background: rgba(74,144,226,0.2); color: var(--accent); }
.badge-type-scraper { background: rgba(0,255,136,0.2); color: var(--accent-green); }
.row-warning td { border-left: 2px solid var(--accent-yellow); }
.error-detail {
  font-family: monospace; font-size: 12px; color: var(--accent-red);
  background: rgba(255,0,64,0.05); padding: 12px; border-radius: var(--radius);
  white-space: pre-wrap; word-break: break-all;
}

/* ============================================
   BOOKMARKS
   ============================================ */
.bookmark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.bookmark-card {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.bookmark-header { display: flex; align-items: center; justify-content: space-between; }
.bookmark-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0; }
.bookmark-summary { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.bookmark-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.bookmark-note {
  font-size: 12px; color: var(--accent-yellow); background: rgba(255,204,0,0.08);
  padding: 6px 10px; border-radius: var(--radius); border-left: 2px solid var(--accent-yellow);
}
.bookmark-actions { display: flex; gap: 8px; margin-top: auto; }

@media (max-width: 768px) {
  .user-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: 1; }
  .quick-links { grid-template-columns: 1fr; }
}

/* ============================================
   USER LAYOUT (shell)
   ============================================ */
.user-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-primary); }
.user-header {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 56px;
  background: var(--admin-bg); border-bottom: 1px solid var(--admin-border);
  position: sticky; top: 0; z-index: 100;
}
.user-logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary); text-decoration: none; font-size: 15px; font-weight: 700;
  flex-shrink: 0;
}
.user-logo i { color: var(--accent); font-size: 18px; }
.user-nav { display: flex; gap: 4px; flex: 1; }
.user-nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  color: var(--text-secondary); text-decoration: none; font-size: 13px;
  transition: all 0.15s;
}
.user-nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.user-nav-link.active { color: var(--accent); background: rgba(74,144,226,0.1); }
.user-header-right { display: flex; gap: 4px; margin-left: auto; }
.user-main { flex: 1; padding: 24px; }
.user-content { max-width: 1200px; margin: 0 auto; }
.user-section .section-header { margin-bottom: 20px; }
.user-section .section-header h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; }

/* Profile */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.profile-card { background: var(--admin-card); border: 1px solid var(--admin-border); border-radius: var(--radius); padding: 24px; }
.profile-card h3 { margin: 0 0 20px; font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }

.plan-tier-badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.plan-tier-badge.plan-tier-free { background: rgba(128,128,128,0.15); color: #aaa; }
.plan-tier-badge.plan-tier-basic { background: rgba(74,144,226,0.15); color: var(--accent); }
.plan-tier-badge.plan-tier-pro { background: rgba(168,85,247,0.15); color: #a855f7; }
.plan-tier-badge.plan-tier-unlimited { background: rgba(245,158,11,0.15); color: #f59e0b; }

/* ============================================
   AGENTS MONITOR
   ============================================ */
.agent-summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.agent-sum-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 14px 16px;
}
.sum-icon { font-size: 22px; flex-shrink: 0; }
.sum-val { font-size: 22px; font-weight: 700; line-height: 1; }
.sum-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.agent-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius); font-size: 11px; font-weight: 600;
}
.agent-newsscanneragent { background: rgba(74,144,226,0.15); color: var(--accent); }
.agent-eventdetectoragent { background: rgba(0,255,136,0.1); color: var(--accent-green); }
.agent-alertgeneratoragent { background: rgba(255,0,64,0.1); color: var(--accent-red); }
.agent-notificationdispatcheragent { background: rgba(255,102,0,0.1); color: var(--accent-orange); }
.status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.status-completed { color: var(--accent-green); }
.status-failed { color: var(--accent-red); }
.status-running { color: var(--accent-yellow); }
.status-pending { color: var(--text-muted); }
.pagination-bar {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  padding: 16px; color: var(--text-muted); font-size: 13px;
}

/* ============================================
   COSTS PANEL
   ============================================ */
.cost-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.cost-kpi {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 14px 16px;
}
.cost-kpi .kpi-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.cost-kpi .kpi-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.costs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cost-panel {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.cost-provider-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.cost-prov-name { width: 100px; color: var(--text-secondary); flex-shrink: 0; }
.cost-prov-bar { flex: 1; height: 6px; background: var(--admin-border); border-radius: 3px; overflow: hidden; }
.cost-prov-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s; }
.cost-prov-amount { width: 80px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.cost-prov-ops { font-size: 11px; width: 60px; text-align: right; }
.mt-4 { margin-top: 16px; }
.font-mono { font-family: monospace; }

/* ============================================
   AUDIT LOG
   ============================================ */
.action-badge { padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.action-create { background: rgba(0,255,136,0.15); color: var(--accent-green); }
.action-update { background: rgba(74,144,226,0.15); color: var(--accent); }
.action-delete { background: rgba(255,0,64,0.15); color: var(--accent-red); }
.action-login { background: rgba(255,204,0,0.15); color: var(--accent-yellow); }
.action-logout { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.audit-json {
  font-family: monospace; font-size: 11px; background: rgba(0,0,0,0.3);
  padding: 10px; border-radius: var(--radius); white-space: pre-wrap;
  word-break: break-all; max-height: 200px; overflow-y: auto;
}

/* ============================================
   API TOKENS
   ============================================ */
.scopes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.scope-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--admin-border); border-radius: var(--radius);
  cursor: pointer; font-size: 13px; transition: border-color 0.15s;
}
.scope-option:hover { border-color: var(--accent); }
.scope-option input { accent-color: var(--accent); }
.token-prefix { font-family: monospace; color: var(--accent); font-size: 13px; }
.token-display {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.4); padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--accent); font-family: monospace; font-size: 12px;
  word-break: break-all;
}
.token-display code { flex: 1; color: var(--accent-green); }

@media (max-width: 768px) {
  .agent-summary-row { grid-template-columns: repeat(2, 1fr); }
  .cost-kpis { grid-template-columns: repeat(2, 1fr); }
  .costs-grid { grid-template-columns: 1fr; }
  .user-nav { display: none; }
}

/* ===== Article Page ===== */
.article-layout { min-height: 100vh; }
.article-main { padding: 20px; max-width: 900px; margin: 0 auto; }
.article-container { background: var(--surface); border-radius: 12px; overflow: hidden; }
.article-breadcrumb { padding: 14px 24px; font-size: 0.8rem; color: var(--muted); background: rgba(255,255,255,0.03); }
.article-breadcrumb a { color: var(--accent); text-decoration: none; }
.article-breadcrumb span { margin: 0 6px; }
.article-header { padding: 24px; border-bottom: 1px solid var(--border); }
.article-meta-top { display: flex; gap: 12px; font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.article-source { color: var(--accent); font-weight: 600; }
.article-lang { background: var(--border); padding: 2px 6px; border-radius: 4px; }
.article-title { font-size: 1.6rem; font-weight: 700; line-height: 1.3; margin: 0 0 14px 0; color: var(--text); }
.article-keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.article-kw { background: rgba(74,144,226,0.15); color: var(--accent); padding: 3px 8px; border-radius: 12px; font-size: 0.75rem; }
.ai-summary-box { margin: 20px 24px; background: rgba(74,144,226,0.08); border: 1px solid rgba(74,144,226,0.25); border-radius: 10px; overflow: hidden; }
.ai-summary-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(74,144,226,0.12); font-weight: 600; color: var(--accent); font-size: 0.9rem; }
.btn-regenerate { margin-left: auto; background: none; border: none; color: var(--accent); cursor: pointer; font-size: 0.9rem; padding: 4px 8px; border-radius: 4px; }
.btn-regenerate:hover { background: rgba(74,144,226,0.2); }
.ai-summary-text { padding: 16px; margin: 0; color: var(--text); line-height: 1.6; font-size: 0.95rem; }
.ai-summary-loading { padding: 20px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; }
.ai-summary-empty { padding: 20px; text-align: center; color: var(--muted); }
.ai-summary-error { padding: 12px 16px; color: var(--accent-red); font-size: 0.85rem; margin: 0; }
.loading-spinner-sm { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.article-content { padding: 24px; color: var(--text); line-height: 1.8; font-size: 0.95rem; }
.article-content p { margin-bottom: 16px; }
.article-content a { color: var(--accent); }
.article-no-content { padding: 24px; color: var(--muted); text-align: center; font-style: italic; }
.article-source-link { padding: 20px 24px; border-top: 1px solid var(--border); }
.btn-source { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: white; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-size: 0.9rem; transition: opacity 0.2s; }
.btn-source:hover { opacity: 0.85; }
.related-articles { padding: 24px; border-top: 1px solid var(--border); }
.related-articles h3 { font-size: 1rem; color: var(--muted); margin: 0 0 14px 0; }
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-item { display: grid; grid-template-columns: 100px 1fr 80px; gap: 12px; align-items: center; padding: 10px 14px; background: rgba(255,255,255,0.03); border-radius: 8px; text-decoration: none; transition: background 0.2s; }
.related-item:hover { background: rgba(255,255,255,0.07); }
.related-source { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.related-title { font-size: 0.9rem; color: var(--text); }

/* ===== Explore Page ===== */
/* Section nav in explore — horizontal scroll like other bars */
.section-nav {
  display: flex; gap: 4px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
  padding: 2px 0;
}
.section-nav::-webkit-scrollbar { display: none; }

.explore-layout { min-height: 100vh; }

/* Toolbar */
.explore-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 14px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.explore-toolbar-left {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
}
.explore-toolbar-icon { font-size: 1.3rem; color: var(--accent); }
.explore-title { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text); }
.explore-subtitle { font-size: 0.78rem; color: var(--muted); }
.explore-filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-left: auto;
}

/* Date pickers */
.date-range-group { display: flex; flex-direction: column; gap: 2px; }
.date-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.date-input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 6px 10px; font-size: 0.85rem;
  cursor: pointer; transition: border-color 0.2s;
}
.date-input:focus { outline: none; border-color: var(--accent); }
.date-input::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }
.date-sep { color: var(--muted); font-size: 1.1rem; align-self: flex-end; padding-bottom: 6px; }

/* Preset buttons */
.preset-buttons { display: flex; gap: 4px; align-self: flex-end; padding-bottom: 0; }
.preset-btn {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 5px;
  color: var(--muted); padding: 5px 10px; font-size: 0.78rem; cursor: pointer;
  transition: all 0.15s;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { background: rgba(74,144,226,0.2); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* Archived toggle */
.toggle-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 0.82rem; color: var(--muted); user-select: none;
}
.toggle-label input { display: none; }
.toggle-track {
  width: 36px; height: 20px; background: var(--border); border-radius: 10px;
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.toggle-label input:checked + .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  background: white; border-radius: 50%; transition: left 0.2s;
}
.toggle-label input:checked + .toggle-track .toggle-thumb { left: 19px; }
.toggle-text { white-space: nowrap; }

/* Compare button */
.btn-compare {
  display: flex; align-items: center; gap: 7px;
  background: rgba(74,144,226,0.1); border: 1px solid rgba(74,144,226,0.3);
  color: var(--accent); padding: 7px 14px; border-radius: 7px;
  font-size: 0.83rem; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-compare:hover { background: rgba(74,144,226,0.2); border-color: var(--accent); }
.btn-compare.active {
  background: rgba(0,255,136,0.15); border-color: var(--accent-green);
  color: var(--accent-green);
}

/* Stats bar */
.explore-stats-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
  background: rgba(0,0,0,0.25); border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.explore-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 20px; border-right: 1px solid var(--border);
}
.explore-stat-range {
  margin-left: auto; padding: 10px 0;
  font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.range-days { color: var(--accent); font-size: 0.78rem; }

/* Content area */
.explore-content {
  padding: 20px; min-height: 400px;
}

/* Explore card grid */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.explore-card {
  background: var(--surface); border-radius: 10px;
  border: 1px solid var(--border); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s, transform 0.15s;
}
.explore-card:hover { transform: translateY(-2px); border-color: rgba(74,144,226,0.4); }
.explore-card.priority-critical { border-left: 3px solid var(--accent-red); }
.explore-card.priority-high     { border-left: 3px solid #ff8c00; }
.explore-card.priority-medium   { border-left: 3px solid var(--accent); }
.explore-card.priority-low      { border-left: 3px solid var(--muted); }

/* Card header */
.ec-header {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.ec-priority {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 4px; background: rgba(255,255,255,0.08); color: var(--text);
}
.priority-critical .ec-priority { background: rgba(255,0,64,0.2); color: var(--accent-red); }
.priority-high .ec-priority     { background: rgba(255,140,0,0.2); color: #ff8c00; }
.priority-medium .ec-priority   { background: rgba(74,144,226,0.2); color: var(--accent); }
.ec-section { font-size: 0.72rem; color: var(--muted); }
.ec-impact { margin-left: auto; font-size: 1rem; font-weight: 700; color: var(--accent); }
.ec-archived { font-size: 0.72rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ec-live { font-size: 0.72rem; color: var(--accent-green); display: flex; align-items: center; gap: 4px; }
.ec-live .fa-circle { font-size: 0.5rem; animation: pulse-live 1.5s infinite; }

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Card body */
.ec-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
  margin: 0; line-height: 1.4;
}
.ec-desc { font-size: 0.82rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* Evolution info */
.ec-evolution {
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(0,0,0,0.2); border-radius: 6px; padding: 8px 10px;
}
.evo-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.78rem; color: var(--muted);
}
.evo-item.accent { color: var(--accent); }
.evo-item.muted  { color: var(--muted); opacity: 0.7; }
.evo-item .fa { width: 12px; text-align: center; }

/* Tags */
.ec-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.ec-tag {
  font-size: 0.72rem; padding: 2px 7px; border-radius: 10px;
  background: rgba(74,144,226,0.12); color: var(--accent);
}

/* Compare mode */
.compare-header {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 10px;
}
.compare-col-label {
  padding: 8px 12px; border-radius: 7px; font-size: 0.82rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.compare-col-label.historical { background: rgba(74,144,226,0.1); color: var(--accent); border: 1px solid rgba(74,144,226,0.25); }
.compare-col-label.current { background: rgba(0,255,136,0.08); color: var(--accent-green); border: 1px solid rgba(0,255,136,0.2); }
.pulse-live { animation: pulse-live 1.5s infinite; font-size: 0.6rem; }

.compare-grid { display: flex; flex-direction: column; gap: 12px; }
.compare-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.historical-card { border-top: 2px solid rgba(74,144,226,0.3); }
.current-card    { border-top: 2px solid rgba(0,255,136,0.3); }

.not-found-card {
  display: flex; align-items: center; justify-content: center;
  opacity: 0.5; min-height: 100px;
}
.ec-not-found { text-align: center; color: var(--muted); font-size: 0.85rem; }
.ec-not-found .fa { font-size: 1.8rem; display: block; margin-bottom: 8px; }

/* Compare stat block inside current card */
.ec-compare-stat { display: flex; flex-direction: column; gap: 8px; }
.compare-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: rgba(0,0,0,0.2); border-radius: 6px;
}
.csr-label { font-size: 0.78rem; color: var(--muted); }
.csr-val { font-size: 0.88rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.csr-val.up   { color: var(--accent-green); }
.csr-val.down { color: var(--accent-red); }
.csr-val.same { color: var(--text); }

/* Explore link in header (for Index.razor) */
.explore-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 0.85rem;
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  transition: all 0.2s; white-space: nowrap;
}
.explore-link:hover { color: var(--accent); border-color: var(--accent); background: rgba(74,144,226,0.08); }

/* Notification bell */
.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 16px;
  padding: 6px; border-radius: 50%; transition: all 0.2s; width: 34px; height: 34px;
}
.notif-bell:hover { color: var(--accent); background: rgba(74,144,226,0.08); }
.notif-badge {
  position: absolute; top: 0; right: -2px; min-width: 16px; height: 16px;
  background: var(--accent-red, #ff0040); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1; animation: notif-pop 0.3s ease;
}
@keyframes notif-pop { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Responsive */
@media (max-width: 900px) {
  .compare-header, .compare-row { grid-template-columns: 1fr; }
  .compare-col-label.current { display: none; }
  .current-card { border-top: 2px solid rgba(0,255,136,0.3); }
  .explore-filters { gap: 8px; }
}
@media (max-width: 600px) {
  .explore-toolbar { flex-direction: column; align-items: flex-start; }
  .explore-filters { margin-left: 0; }
  .explore-grid { grid-template-columns: 1fr; }
  .explore-stats-bar { gap: 0; }
  .explore-stat { padding: 8px 12px; }
  .explore-stat-range { margin-left: 0; padding: 8px 0; width: 100%; }
}
.related-date { font-size: 0.75rem; color: var(--muted); text-align: right; }

/* ============================================
   TOASTS (U-04)
   ============================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 6px; min-width: 260px; max-width: 380px;
  background: var(--space-navy); border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  pointer-events: all;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error   { border-left: 3px solid var(--accent-red); }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-info    { border-left: 3px solid var(--accent); }
.toast-icon    { font-size: 14px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--accent-green); }
.toast-error   .toast-icon { color: var(--accent-red); }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info    .toast-icon { color: var(--accent); }
.toast-message { flex: 1; font-size: 13px; color: var(--text); }
.toast-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 2px 4px; font-size: 11px; flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }

/* ============================================
   MOBILE SIDEBAR BACKDROP (U-05)
   ============================================ */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 199;
}
@media (max-width: 768px) {
  .sidebar-backdrop { display: block; }
  .sidebar-toggle { display: flex !important; }
}

/* ============================================
   SKELETON UI (U-01)
   ============================================ */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; padding: 20px;
}
.skeleton-card {
  background: var(--space-navy); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.skeleton-bar {
  height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.04) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-bar.title  { height: 18px; width: 75%; }
.skeleton-bar.short  { width: 45%; }
.skeleton-bar.medium { width: 60%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton loaders */
.skeleton { background: linear-gradient(90deg, var(--admin-card) 25%, rgba(255,255,255,0.06) 50%, var(--admin-card) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0 } to { background-position: -200% 0 } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-100 { width: 100%; }
.skeleton-kpi { height: 80px; }
.skeleton-row { height: 40px; margin-bottom: 4px; }

/* ============================================
   EMPTY STATES (U-09)
   ============================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; gap: 12px;
}
.empty-state-icon { font-size: 48px; color: var(--text-muted); opacity: 0.4; }
.empty-state h3 { font-size: 18px; color: var(--text); margin: 0; }
.empty-state p { color: var(--text-muted); font-size: 14px; margin: 0; max-width: 340px; }
.empty-state .btn { margin-top: 8px; }

/* ============================================
   CONFIRM DIALOG (U-07)
   ============================================ */
.confirm-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.confirm-modal {
  background: var(--space-navy); border: 1px solid var(--border);
  border-radius: 10px; padding: 28px; max-width: 420px; width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.confirm-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.confirm-modal-msg   { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
.confirm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================
   SITUATION PAGE (H-C)
   ============================================ */
.situation-layout { max-width: 960px; margin: 0 auto; padding: 24px; }
.situation-back { color: var(--text-muted); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; }
.situation-back:hover { color: var(--text); }
.situation-header { margin-bottom: 28px; }
.situation-badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.situation-title { font-size: 28px; font-weight: 700; margin: 0 0 10px; line-height: 1.3; }
.situation-desc  { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.situation-meta  { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.sit-meta-item   { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.situation-body  { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.sit-timeline    { display: flex; flex-direction: column; gap: 0; }
.sit-timeline-day { margin-bottom: 20px; }
.sit-day-label   { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; font-weight: 600; }
.sit-article     { background: var(--space-navy); border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-bottom: 8px; display: flex; gap: 12px; align-items: flex-start; }
.sit-art-rel     { font-size: 12px; color: var(--text-muted); flex-shrink: 0; min-width: 28px; text-align: right; }
.sit-art-body a  { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.sit-art-body a:hover { color: var(--accent); }
.sit-art-source  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.sit-sidebar     { display: flex; flex-direction: column; gap: 16px; }
.sit-card        { background: var(--space-navy); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.sit-card h4     { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 12px; }
.sit-stat        { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sit-stat:last-child { border-bottom: none; }
.sit-stat-val    { font-weight: 600; color: var(--accent); }
.sit-tag         { display: inline-block; background: rgba(74,144,226,0.15); color: var(--accent); border-radius: 4px; padding: 3px 8px; font-size: 12px; margin: 2px; }
.sit-related-link { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); text-decoration: none; }
.sit-related-link:hover { color: var(--accent); }
.sit-related-link:last-child { border-bottom: none; }
.sit-impact-bar  { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.sit-impact-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s; }
@media (max-width: 768px) {
  .situation-body { grid-template-columns: 1fr; }
  .sit-sidebar { order: -1; }
}

/* Purge section */
.purge-section {
  margin-top: 32px; padding: 20px;
  background: rgba(255,0,64,0.05); border: 1px solid rgba(255,0,64,0.2);
  border-radius: 8px;
}
.purge-section h4 { margin: 0 0 8px; color: var(--accent-red); font-size: 14px; }
.btn-warning { background: #92400e; border-color: #b45309; color: #fef3c7; }
.btn-warning:hover { background: #b45309; }
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.alert-success { background: rgba(0,255,136,0.1); border: 1px solid rgba(0,255,136,0.3); color: var(--accent-green); }
.alert-danger  { background: rgba(255,0,64,0.1);  border: 1px solid rgba(255,0,64,0.3);  color: var(--accent-red); }

/* ============================================
   THEMES
   ============================================ */
[data-theme="light"] {
  --space-black: #f0f4f8;
  --space-blue: #e2e8f0;
  --space-navy: #d6dfe9;
  --accent: #1a6fd4;
  --accent-green: #0a9e5f;
  --accent-red: #d00030;
  --accent-orange: #c05000;
  --accent-yellow: #9a6500;
  --text-primary: #1a1f2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border: #c4cfdc;
  --card-bg: #ffffff;
  --card-hover: #f7fafc;
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
}
[data-theme="light"] .site-header,
[data-theme="light"] .admin-sidebar,
[data-theme="light"] .admin-topbar { background: rgba(240,244,248,0.97); }
[data-theme="light"] .public-layout { background: var(--space-black); }
[data-theme="light"] a { color: var(--accent); }
[data-theme="light"] a:hover { color: var(--accent-green); }

[data-theme="blue"] {
  --space-black: #020c1b;
  --space-blue: #031524;
  --space-navy: #041e30;
  --accent: #00b4ff;
  --accent-green: #00e5a0;
  --accent-red: #ff2060;
  --text-primary: #a8d4f0;
  --text-secondary: #5888aa;
  --text-muted: #2c5577;
  --border: #0a3050;
  --card-bg: #051828;
  --card-hover: #071e33;
}

[data-theme="matrix"] {
  --space-black: #000800;
  --space-blue: #001000;
  --space-navy: #001800;
  --accent: #00cc44;
  --accent-green: #00ff44;
  --accent-red: #ff3300;
  --accent-yellow: #88ff00;
  --text-primary: #00cc44;
  --text-secondary: #008833;
  --text-muted: #005522;
  --border: #003311;
  --card-bg: #000a00;
  --card-hover: #001200;
}
[data-theme="matrix"] body,
[data-theme="matrix"] .site-header,
[data-theme="matrix"] .admin-sidebar { font-family: 'Courier New', monospace; }

[data-theme="amber"] {
  --space-black: #0a0400;
  --space-blue: #140800;
  --space-navy: #1c0e00;
  --accent: #ff9900;
  --accent-green: #ffcc00;
  --accent-red: #ff3300;
  --accent-yellow: #ffee00;
  --text-primary: #ffcc88;
  --text-secondary: #aa7733;
  --text-muted: #663300;
  --border: #3d1a00;
  --card-bg: #0f0500;
  --card-hover: #180c00;
}

[data-theme="neon"] {
  --space-black: #05000f;
  --space-blue: #080015;
  --space-navy: #0c001e;
  --accent: #ff00cc;
  --accent-green: #00ffcc;
  --accent-red: #ff0050;
  --accent-yellow: #ffee00;
  --text-primary: #e0ccff;
  --text-secondary: #8855cc;
  --text-muted: #4422aa;
  --border: #2a0050;
  --card-bg: #0a0018;
  --card-hover: #100025;
}

[data-theme="cosmos"] {
  --space-black: #0a0515;
  --space-blue: #100828;
  --space-navy: #180c38;
  --accent: #a855f7;
  --accent-green: #d946ef;
  --accent-red: #f43f5e;
  --accent-yellow: #fbbf24;
  --text-primary: #e9d5ff;
  --text-secondary: #a78bfa;
  --text-muted: #6d44c2;
  --border: #2d1954;
  --card-bg: #130820;
  --card-hover: #1a0d2e;
}

[data-theme="red"] {
  --space-black: #0f0000;
  --space-blue: #190000;
  --space-navy: #230000;
  --accent: #ff2020;
  --accent-green: #ff6600;
  --accent-red: #ff0000;
  --accent-yellow: #ff9900;
  --text-primary: #ffbbbb;
  --text-secondary: #aa5555;
  --text-muted: #663333;
  --border: #400000;
  --card-bg: #130000;
  --card-hover: #1a0000;
}

/* ============================================
   THEME SELECTOR — Galaxy Planet Picker
   ============================================ */
.theme-selector { position: relative; display: flex; align-items: center; }

/* Trigger: small planet orb with dashed orbit ring */
.theme-planet-trigger {
  width: 30px; height: 30px; background: transparent; border: none;
  cursor: pointer; position: relative; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.theme-trigger-orb {
  width: 14px; height: 14px; border-radius: 50%; display: block;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--trigger-color,#4a90e2) 80%, white 40%), var(--trigger-color,#4a90e2) 55%, color-mix(in srgb, var(--trigger-color,#4a90e2) 25%, black));
  box-shadow: 0 0 6px var(--trigger-color,#4a90e2), 0 0 14px color-mix(in srgb, var(--trigger-color,#4a90e2) 35%, transparent);
  transition: box-shadow 0.3s; position: relative; z-index: 1;
}
.theme-planet-trigger:hover .theme-trigger-orb {
  box-shadow: 0 0 10px var(--trigger-color,#4a90e2), 0 0 24px color-mix(in srgb, var(--trigger-color,#4a90e2) 55%, transparent);
}
.theme-trigger-ring {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--trigger-color,#4a90e2) 55%, transparent);
  animation: planet-orbit-spin 7s linear infinite; pointer-events: none;
}

/* Dropdown panel */
.theme-planet-dropdown {
  position: absolute; top: 38px; right: -8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 12px;
  width: 196px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 300;
  animation: planet-dropdown-in 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes planet-dropdown-in {
  from { opacity:0; transform:translateY(-8px) scale(0.95); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.theme-planet-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.theme-planet-cell {
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 7px 2px 5px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: background 0.15s, border-color 0.15s; position: relative;
}
.theme-planet-cell:hover { background: rgba(255,255,255,0.05); }
.theme-planet-cell.theme-active {
  background: rgba(255,255,255,0.04);
  border-color: color-mix(in srgb, var(--planet-color) 50%, transparent);
}
.planet-orb {
  width: 28px; height: 28px; border-radius: 50%; display: block; flex-shrink: 0;
  background: radial-gradient(circle at 35% 35%,
    color-mix(in srgb, var(--planet-color) 80%, white 40%),
    var(--planet-color) 55%,
    color-mix(in srgb, var(--planet-color) 25%, black));
  box-shadow: 0 0 5px color-mix(in srgb, var(--planet-color) 45%, transparent);
  transition: box-shadow 0.2s;
}
.theme-planet-cell:hover .planet-orb,
.theme-planet-cell.theme-active .planet-orb {
  box-shadow: 0 0 10px var(--planet-color), 0 0 20px color-mix(in srgb, var(--planet-color) 40%, transparent);
}
/* Dashed orbit ring — only on active */
.planet-orbit-ring {
  position: absolute; top: 3px; width: 36px; height: 36px;
  border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--planet-color) 65%, transparent);
  animation: planet-orbit-spin 4s linear infinite; pointer-events: none;
}
.planet-name {
  font-size: 8.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); line-height: 1; white-space: nowrap;
}
.theme-planet-cell.theme-active .planet-name { color: var(--text-secondary); }

@keyframes planet-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Workspace Indicator ─────────────────────────────── */
.ws-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px;
  background: rgba(74,144,226,0.1); border: 1px solid rgba(74,144,226,0.25);
  color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.ws-indicator:hover { background: rgba(74,144,226,0.2); border-color: rgba(74,144,226,0.5); }
.ws-indicator i { font-size: 11px; }

/* ── Workspace Overlay ───────────────────────────────── */
.ws-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,2,10,0.95);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  animation: ws-fade-in 0.3s ease;
}
@keyframes ws-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ws-panel {
  width: min(860px, 95vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(145deg, #000d24 0%, #000510 100%);
  border: 1px solid rgba(74,144,226,0.2); border-radius: 20px;
  padding: 40px 40px 32px; text-align: center;
  box-shadow: 0 0 80px rgba(74,144,226,0.1), 0 30px 60px rgba(0,0,0,0.8);
  animation: ws-slide-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ws-slide-up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.ws-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 20px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--text-dim); margin-bottom: 24px;
}
.ws-logo i { color: var(--accent); font-size: 22px; }
.ws-logo strong { color: var(--accent); }

.ws-headline {
  font-size: 28px; font-weight: 700; color: var(--text);
  margin: 0 0 10px; letter-spacing: -0.02em;
}
.ws-sub { font-size: 14px; color: var(--text-muted); margin: 0 0 32px; }

.ws-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.ws-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 20px 14px; cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.ws-card:hover {
  background: rgba(74,144,226,0.1); border-color: rgba(74,144,226,0.4);
  transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,144,226,0.15);
}
.ws-card-active {
  background: rgba(74,144,226,0.15) !important; border-color: rgba(74,144,226,0.6) !important;
  box-shadow: 0 0 20px rgba(74,144,226,0.2) !important;
}
.ws-card-global:hover, .ws-card-global.ws-card-active { border-color: rgba(0,255,136,0.5) !important; background: rgba(0,255,136,0.08) !important; }
.ws-card-icon { font-size: 28px; margin-bottom: 8px; }
.ws-card-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.ws-card-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-bottom: 8px; }
.ws-card-count { font-size: 11px; color: var(--accent); font-weight: 600; }

.ws-custom {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 20px;
}
.ws-custom span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ws-custom-input {
  flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 13px;
  outline: none;
}
.ws-custom-input:focus { border-color: rgba(74,144,226,0.5); }
.ws-custom-btn {
  background: var(--accent); border: none; border-radius: 8px;
  width: 36px; height: 36px; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s; flex-shrink: 0;
}
.ws-custom-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ws-close-btn {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 10px 20px; color: var(--text-muted);
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.ws-close-btn:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

@media (max-width: 600px) {
  .ws-panel { padding: 28px 20px 24px; }
  .ws-headline { font-size: 22px; }
  .ws-cards { grid-template-columns: repeat(2, 1fr); }
  .ws-indicator span { display: none; }
}

/* ============================================
   MORNING BRIEF BANNER
   ============================================ */
.morning-brief-banner {
  background: linear-gradient(135deg, rgba(74,144,226,0.08), rgba(0,255,136,0.04));
  border: 1px solid rgba(74,144,226,0.2);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 8px 16px;
}
.mb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mb-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
}
.mb-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; }
.mb-headline { font-size: 1.2em; color: var(--text); margin: 0 0 16px; line-height: 1.4; }
.mb-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.mb-section {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
}
.mb-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.mb-section-title i { margin-right: 4px; }
.mb-section-text { font-size: 13px; color: var(--text-secondary, #9aaabb); line-height: 1.6; }

/* ============================================
   STORY THREADS BAR
   ============================================ */
.story-threads-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 16px;
  background: rgba(74,144,226,0.06); border-bottom: 1px solid rgba(74,144,226,0.15);
  overflow-x: auto; scrollbar-width: thin;
}
.st-label {
  font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.st-scroll { display: flex; gap: 6px; overflow-x: auto; }
.st-chip {
  display: flex; align-items: center; gap: 5px; padding: 3px 10px;
  background: rgba(74,144,226,0.08); border: 1px solid rgba(74,144,226,0.2);
  border-radius: 16px; white-space: nowrap; font-size: 12px;
  transition: all 0.2s; color: var(--text); text-decoration: none;
}
.st-chip:hover { background: rgba(74,144,226,0.15); border-color: var(--accent); }
.st-chip.status-developing { border-color: rgba(0,255,136,0.3); }
.st-events {
  font-weight: 700; color: var(--accent); font-size: 11px;
  background: rgba(74,144,226,0.15); padding: 1px 5px; border-radius: 8px;
}
.st-title { font-weight: 500; }
.st-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-green, #00ff88); animation: pulse-dot-anim 1.5s infinite;
}

/* Desktop/Mobile visibility helpers */
.desktop-only { display: none; }
.mobile-only { display: flex; }
@media (min-width: 769px) {
  .desktop-only { display: flex; }
  .mobile-only { display: none !important; }
}


/* Reports bar */
.reports-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px; overflow: hidden;
}
.reports-label {
  font-size: 10px; font-weight: 700; color: var(--accent-orange, #ff9f43);
  letter-spacing: 1px; white-space: nowrap;
}
.reports-scroll {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1;
}
.reports-scroll::-webkit-scrollbar { display: none; }
.report-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 4px 12px 4px 4px; font-size: 12px;
  color: var(--text); cursor: pointer; white-space: nowrap; transition: all 0.2s;
  border-left: 3px solid var(--rc, #4a90e2);
}
.report-chip:hover { background: rgba(255,159,67,0.12); border-color: var(--accent-orange, #ff9f43); }
.report-module {
  width: 22px; height: 22px; border-radius: 50%; color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.report-title { font-weight: 500; }
.report-meta { font-size: 10px; color: var(--text-muted); }
.reports-more {
  color: var(--accent-orange, #ff9f43); font-size: 14px; padding: 4px 8px;
  border-radius: 6px; transition: background 0.15s;
}
.reports-more:hover { background: rgba(255,159,67,0.12); }

/* Report modal extras */
.report-module-badge {
  width: 28px; height: 28px; border-radius: 50%; color: #fff;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.report-meta-bar {
  display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px;
  color: var(--text-muted); margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.report-meta-bar i { margin-right: 4px; }
.report-content {
  font-size: 14px; line-height: 1.7; color: var(--text);
  max-height: 60vh; overflow-y: auto;
}

/* Module view header (when module selected as filter) */
.module-view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin-bottom: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.module-view-info { display: flex; align-items: center; gap: 12px; }
.module-view-icon {
  width: 36px; height: 36px; border-radius: 50%; color: #fff;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.module-view-name { font-size: 16px; font-weight: 700; margin: 0; }
.module-view-meta { font-size: 12px; color: var(--text-muted); }
.module-view-reports {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.module-report-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: all 0.15s;
}
.module-report-card:hover { background: rgba(255,159,67,0.08); border-color: var(--accent-orange, #ff9f43); }
.module-report-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.module-report-summary { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 6px; }
.module-report-footer { font-size: 11px; color: var(--text-muted); }

/* ============================================
   EVENT CARD BADGES (cross-reference, thread)
   ============================================ */
.event-xref {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-green, #00ff88);
  font-size: 11px;
  font-weight: 600;
}
.event-thread-link {
  color: var(--accent);
  font-size: 12px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.event-thread-link:hover { opacity: 1; }

/* ============================================
   EVENT MODAL — BRIEFING
   ============================================ */
.em-briefing {
  background: rgba(74,144,226,0.06);
  border: 1px solid rgba(74,144,226,0.15);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}
.em-briefing-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.em-briefing-header i { margin-right: 4px; }
.em-briefing-item { margin-bottom: 10px; }
.em-briefing-item:last-child { margin-bottom: 0; }
.em-briefing-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #6b7a99);
  margin-bottom: 3px;
}
.em-briefing-label i { margin-right: 3px; font-size: 10px; }
.em-briefing-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #9aaabb);
  line-height: 1.5;
}

.em-thread-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
}
.em-thread-link:hover { background: rgba(74,144,226,0.1); border-color: var(--accent); }
.em-thread-link i:first-child { color: var(--accent); }
.em-thread-count { color: var(--text-muted, #6b7a99); font-size: 11px; margin-left: auto; }
.em-thread-link i:last-child { color: var(--text-muted); font-size: 10px; }

.em-xref-row strong { color: var(--accent-green, #00ff88) !important; }

/* Source comparison */
.em-source-compare { margin: 12px 0; }
.em-compare-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--accent); padding: 6px 14px; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; gap: 6px; transition: all 0.2s;
}
.em-compare-toggle:hover { background: rgba(74,144,226,0.08); border-color: var(--accent); }
.em-compare-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-top: 10px;
}
.em-compare-card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.em-compare-source { font-size: 13px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.em-compare-count { font-size: 11px; color: var(--text-muted); }
.em-compare-title { font-size: 12px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.em-compare-summary { font-size: 11px; color: var(--text-muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.em-compare-time { font-size: 10px; color: var(--text-muted); margin-top: auto; }

/* ============================================
   STORY THREAD PAGE
   ============================================ */
.story-page { max-width: 900px; margin: 20px auto; padding: 0 16px; }
.story-header {
  text-align: center;
  padding: 30px 0 20px;
}
.story-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.story-status.status-developing { background: rgba(0,255,136,0.15); color: var(--accent-green, #00ff88); }
.story-status.status-active { background: rgba(74,144,226,0.15); color: var(--accent); }
.story-status.status-stale { background: rgba(255,140,66,0.15); color: #ff8c42; }
.story-status.status-resolved { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.story-status.status-archived { background: rgba(255,255,255,0.04); color: var(--text-muted); }

.story-header h1 { font-size: 1.8em; margin: 0 0 10px; color: var(--text); }
.story-summary { font-size: 15px; color: var(--text-secondary, #9aaabb); line-height: 1.6; max-width: 700px; margin: 0 auto; }
.story-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted, #6b7a99);
}
.story-meta i { margin-right: 4px; }
.story-actors { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.story-actors-label { font-size: 12px; color: var(--text-muted); }
.story-actor-chip {
  background: rgba(74,144,226,0.1);
  border: 1px solid rgba(74,144,226,0.2);
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--accent);
}

.story-briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.story-brief-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px;
}
.sbc-icon { font-size: 18px; color: var(--accent); margin-bottom: 6px; }
.sbc-label { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.story-brief-card p { margin: 0; font-size: 13px; color: var(--text-secondary, #9aaabb); line-height: 1.5; }

/* Story Timeline */
.story-timeline { margin-top: 30px; }
.story-timeline h2 { font-size: 1em; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px; }
.story-timeline h2 i { margin-right: 6px; color: var(--accent); }

.story-tl-node {
  display: grid;
  grid-template-columns: 70px 20px 1fr;
  gap: 10px;
  margin-bottom: 0;
  position: relative;
}
.story-tl-node::before {
  content: '';
  position: absolute;
  left: 80px;
  top: 20px;
  bottom: -20px;
  width: 2px;
  background: rgba(255,255,255,0.06);
}
.story-tl-node:last-child::before { display: none; }

.story-tl-date {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 14px;
  font-weight: 600;
}
.story-tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.story-tl-dot.priority-dot-critical { background: var(--accent-red, #ff0040); }
.story-tl-dot.priority-dot-high { background: #ff8c42; }
.story-tl-dot.priority-dot-medium { background: var(--accent); }
.story-tl-dot.priority-dot-low { background: #34495e; }

.story-tl-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.story-tl-card:hover { background: rgba(74,144,226,0.08); border-color: rgba(74,144,226,0.2); }
.story-tl-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.story-tl-impact {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(74,144,226,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
.story-tl-card h3 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.story-tl-card p { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.story-tl-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); }
.story-tl-meta i { margin-right: 3px; }

/* ============================================
   SOURCE TRUST BADGES
   ============================================ */
.src-trust {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}
.src-trust-Alta { background: rgba(0,255,136,0.15); color: var(--accent-green, #00ff88); }
.src-trust-Media { background: rgba(74,144,226,0.15); color: var(--accent); }
.src-trust-Baja { background: rgba(255,140,66,0.15); color: #ff8c42; }
.src-trust-\? { background: rgba(255,255,255,0.05); color: var(--text-muted); }
/* Serendipity card */
.event-card-serendipity {
  border: 1px solid rgba(255,200,0,0.25) !important;
  background: linear-gradient(135deg, rgba(255,200,0,0.06), rgba(255,140,66,0.04)) !important;
}
.serendipity-badge {
  font-size: 10px;
  font-weight: 700;
  color: #ffcc00;
  letter-spacing: 0.5px;
}
.serendipity-badge i { margin-right: 3px; }

.src-bias {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ============================================
   FORM CONTROLS (global)
   ============================================ */
.form-control {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74,144,226,0.2);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; appearance: auto; }
textarea.form-control { resize: vertical; min-height: 60px; }
input[type="color"].form-control { padding: 2px; cursor: pointer; }
input[type="date"].form-control,
input[type="number"].form-control { font-variant-numeric: tabular-nums; }

.form-control:disabled, .form-control[readonly] {
  opacity: 0.6; cursor: not-allowed;
}

/* Button base */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.btn:hover { background: rgba(255,255,255,0.1); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Text danger */
.text-danger { color: var(--accent-red) !important; }
.text-danger:hover { color: #ff6680 !important; }

/* Badge default */
.badge-default {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(74,144,226,0.15);
  color: var(--accent);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================
   THREADS VIEW (Story threads as large cards)
   ============================================ */
.threads-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
  padding: 8px 0;
}
.threads-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.thread-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.thread-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.thread-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.thread-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.thread-status-developing { background: rgba(255,204,0,0.15); color: #ffcc00; }
.thread-status-active { background: rgba(0,255,136,0.15); color: var(--accent-green); }
.thread-status-escalating { background: rgba(255,0,64,0.15); color: var(--accent-red); }
.thread-status-resolved { background: rgba(74,144,226,0.1); color: var(--text-muted); }
.thread-section { font-size: 11px; font-weight: 600; }
.thread-events-count, .thread-articles-count {
  font-size: 11px; color: var(--text-muted);
}
.thread-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}
.thread-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}
.thread-whymatters {
  font-size: 12px;
  color: var(--accent-yellow);
  background: rgba(255,204,0,0.05);
  border-left: 3px solid var(--accent-yellow);
  padding: 8px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 10px;
}
.thread-whymatters i { margin-right: 4px; }
.thread-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.thread-actors {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.thread-actor {
  padding: 1px 6px;
  background: rgba(74,144,226,0.1);
  border: 1px solid rgba(74,144,226,0.2);
  border-radius: 4px;
  font-size: 10px;
  color: var(--accent);
}
.thread-dates {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.thread-impact {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
@media (max-width: 768px) {
  .threads-view { grid-template-columns: 1fr; }
}

/* Full-text search bar */
.search-bar-full {
  display: flex; align-items: center; gap: 8px;
  background: var(--admin-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 8px 16px;
  transition: border-color 0.2s;
}
.search-bar-full:focus-within { border-color: var(--accent); }
.search-bar-full input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 14px;
}
.search-bar-full input::placeholder { color: var(--text-muted); }
.search-bar-full i { color: var(--text-muted); font-size: 14px; }
.search-results {
  background: var(--admin-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-top: 8px; overflow: hidden;
}
.search-result-item {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.search-result-item:hover { background: rgba(74,144,226,0.08); }
.search-result-item:last-child { border-bottom: none; }

/* Pricing page */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 1100px; margin: 40px auto; padding: 0 20px; }
.pricing-card { background: var(--admin-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; text-align: center; transition: transform 0.2s, border-color 0.2s; position: relative; }
.pricing-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 20px rgba(74,144,226,0.15); }
.pricing-card .plan-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pricing-card .plan-price { font-size: 32px; font-weight: 800; color: var(--accent); margin: 12px 0; }
.pricing-card .plan-price small { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.pricing-card .plan-features { list-style: none; padding: 0; margin: 16px 0; text-align: left; }
.pricing-card .plan-features li { padding: 6px 0; font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.pricing-card .plan-features li i { color: var(--accent-green); font-size: 12px; }
.pricing-card .plan-cta { display: block; width: 100%; padding: 10px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.pricing-card .plan-cta:hover { opacity: 0.85; }
.pricing-badge { position: absolute; top: -10px; right: 16px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 10px; text-transform: uppercase; }

/* Story timeline */
.story-timeline { position: relative; padding-left: 30px; }
.story-timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-node { position: relative; margin-bottom: 20px; padding: 12px 16px; background: var(--admin-card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.2s; cursor: pointer; }
.timeline-node:hover { border-color: var(--accent); }
.timeline-node::before { content: ''; position: absolute; left: -24px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-primary); }
.timeline-node.critical::before { background: var(--accent-red); }
.timeline-node.high::before { background: #ff6600; }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-title { font-size: 14px; font-weight: 600; }
.timeline-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }

/* GodMode responsive */
@media (max-width: 900px) {
  .gm-body { flex-direction: column; }
  .gm-sidebar {
    width: 100%; flex-direction: row; overflow-x: auto;
    position: static; padding: 6px; gap: 2px;
  }
  .gm-nav-btn { width: 40px; height: 40px; flex-shrink: 0; }
  .gm-nav-btn span { display: none; }
  .gm-content { padding-left: 0; padding-top: 12px; }
  .gm-grid { grid-template-columns: 1fr; }
  .gm-dash-grid { grid-template-columns: 1fr; }
  .gm-table { font-size: 11px; }
  .gm-table th, .gm-table td { padding: 6px 8px; }
  .god-mode { padding: 10px; }
  .gm-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .gm-kpis { grid-template-columns: 1fr; }
  .gm-nav-btn { width: 36px; height: 36px; }
  .kpi-value { font-size: 22px; }
}

/* ============================================
   PRICING / PLANES PAGE
   ============================================ */
.planes-page { min-height: 100vh; background: var(--space-black); color: var(--text-primary); }
.planes-header { text-align: center; padding: 60px 20px 30px; }
.planes-header h1 { font-size: 28px; margin-bottom: 8px; }
.planes-header p { color: var(--text-secondary); font-size: 15px; }
.planes-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; max-width: 1100px; margin: 0 auto; padding: 0 20px 60px;
}
.plan-card {
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg); padding: 28px 24px; display: flex;
  flex-direction: column; transition: border-color 0.2s, box-shadow 0.2s;
}
.plan-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.plan-card.plan-featured { border-color: var(--accent); position: relative; }
.plan-card.plan-featured::before {
  content: 'Popular'; position: absolute; top: -10px; right: 16px;
  background: var(--accent); color: white; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em;
}
.plan-card-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.plan-card-price { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.plan-card-price span { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.plan-card-limit { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.plan-card-features { list-style: none; margin-bottom: 24px; flex: 1; }
.plan-card-features li {
  padding: 6px 0; font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.plan-card-features li i { color: var(--accent-green); font-size: 12px; }
.plan-card .btn-plan {
  display: block; text-align: center; padding: 10px 16px;
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all 0.2s; cursor: pointer; border: none;
}
.plan-card .btn-plan-primary { background: var(--accent); color: white; }
.plan-card .btn-plan-primary:hover { background: #5aa0f0; }
.plan-card .btn-plan-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.plan-card .btn-plan-outline:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 600px) {
  .planes-grid { grid-template-columns: 1fr; }
  .planes-header { padding: 40px 20px 20px; }
}
