/* RegAlpha Design System - Bloomberg Terminal Aesthetic */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { height: 100%; }
body { min-height: 100%; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* === CSS CUSTOM PROPERTIES === */
:root {
  /* Base backgrounds */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2332;
  --bg-hover: #1e2a3a;

  /* Borders */
  --border-primary: #1e293b;
  --border-active: #334155;

  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Signal severity */
  --signal-critical: #ef4444;
  --signal-high: #f97316;
  --signal-medium: #eab308;
  --signal-low: #22c55e;

  /* Category colors */
  --cat-fda: #3b82f6;
  --cat-insurance: #8b5cf6;
  --cat-utility: #f59e0b;
  --cat-patent: #ec4899;
  --cat-legislation: #14b8a6;
  --cat-mortgage: #06b6d4;
  --cat-cms: #84cc16;

  /* Accent */
  --accent-primary: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);

  /* Status */
  --status-live: #22c55e;
  --status-stale: #f59e0b;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

/* === BASE === */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-primary);
}

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

/* === LAYOUTS === */

/* Marketing layout */
.layout-marketing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* App 3-column layout */
.layout-app {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "nav nav nav"
    "sidebar main rightpanel";
  min-height: 100vh;
}

.layout-app .nav-top { grid-area: nav; }
.layout-app .sidebar { grid-area: sidebar; }
.layout-app .main-content { grid-area: main; }
.layout-app .right-panel { grid-area: rightpanel; }

/* Admin 2-column layout */
.layout-admin {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "nav nav"
    "sidebar main";
  min-height: 100vh;
}

.layout-admin .nav-top { grid-area: nav; }
.layout-admin .admin-sidebar { grid-area: sidebar; }
.layout-admin .admin-main { grid-area: main; }

/* === NAV === */
.nav-top {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  height: 56px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--accent-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.tier-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge.free { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); border: 1px solid var(--border-primary); }
.tier-badge.scout { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.tier-badge.operator { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.tier-badge.syndicate { background: rgba(234, 179, 8, 0.15); color: #fbbf24; border: 1px solid rgba(234, 179, 8, 0.3); }

/* === SIDEBAR === */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  padding: var(--space-md);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: var(--space-lg);
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  font-size: var(--text-sm);
}

.sidebar-filter-item:hover { background: var(--bg-hover); }
.sidebar-filter-item.active { background: var(--bg-hover); color: var(--text-primary); }

.sidebar-filter-item .filter-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* === SIGNAL CARDS === */
.signal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-left: 3px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.signal-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-active);
}

.signal-card[data-category="fda"] { border-left-color: var(--cat-fda); }
.signal-card[data-category="insurance"] { border-left-color: var(--cat-insurance); }
.signal-card[data-category="utility"] { border-left-color: var(--cat-utility); }
.signal-card[data-category="patent"] { border-left-color: var(--cat-patent); }
.signal-card[data-category="legislation"] { border-left-color: var(--cat-legislation); }
.signal-card[data-category="mortgage"] { border-left-color: var(--cat-mortgage); }
.signal-card[data-category="cms"] { border-left-color: var(--cat-cms); }

.signal-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.signal-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
  flex-shrink: 0;
}

.signal-card-meta .time-ago {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.signal-card-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.signal-card-summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.signal-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.vertical-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* === SEVERITY BADGE === */
.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.severity-badge.critical {
  background: rgba(239, 68, 68, 0.15);
  color: var(--signal-critical);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.severity-badge.high {
  background: rgba(249, 115, 22, 0.15);
  color: var(--signal-high);
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.severity-badge.medium {
  background: rgba(234, 179, 8, 0.15);
  color: var(--signal-medium);
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.severity-badge.low {
  background: rgba(34, 197, 94, 0.15);
  color: var(--signal-low);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* === CATEGORY PILL === */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  flex-shrink: 0;
}

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

.category-pill[data-category="fda"] { color: var(--cat-fda); }
.category-pill[data-category="fda"] .dot { background: var(--cat-fda); }
.category-pill[data-category="insurance"] { color: var(--cat-insurance); }
.category-pill[data-category="insurance"] .dot { background: var(--cat-insurance); }
.category-pill[data-category="utility"] { color: var(--cat-utility); }
.category-pill[data-category="utility"] .dot { background: var(--cat-utility); }
.category-pill[data-category="patent"] { color: var(--cat-patent); }
.category-pill[data-category="patent"] .dot { background: var(--cat-patent); }
.category-pill[data-category="legislation"] { color: var(--cat-legislation); }
.category-pill[data-category="legislation"] .dot { background: var(--cat-legislation); }
.category-pill[data-category="mortgage"] { color: var(--cat-mortgage); }
.category-pill[data-category="mortgage"] .dot { background: var(--cat-mortgage); }
.category-pill[data-category="cms"] { color: var(--cat-cms); }
.category-pill[data-category="cms"] .dot { background: var(--cat-cms); }

/* === WINDOW BAR === */
.window-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.window-bar-track {
  flex: 1;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.window-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.window-bar-fill.urgent { background: var(--signal-critical); }
.window-bar-fill.warning { background: var(--signal-medium); }
.window-bar-fill.good { background: var(--signal-low); }

.window-bar-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* === TIER GATE === */
.tier-gate {
  position: relative;
  overflow: hidden;
}

.tier-gate-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(4px);
  background: rgba(10, 14, 23, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  z-index: 10;
  border-radius: inherit;
}

.tier-gate-overlay .lock-icon {
  font-size: 20px;
  opacity: 0.5;
}

.tier-gate-overlay .gate-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.tier-gate-overlay .gate-cta {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--accent-glow);
  transition: background 0.15s;
}

.tier-gate-overlay .gate-cta:hover { background: rgba(59, 130, 246, 0.25); text-decoration: none; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}
.btn-primary:hover { background: #2563eb; border-color: #2563eb; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-active);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--signal-critical);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn-sm {
  font-size: var(--text-xs);
  padding: 5px 12px;
}

.btn-lg {
  font-size: var(--text-base);
  padding: 12px 28px;
}

/* === FORMS === */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  padding: 8px 12px;
  transition: border-color 0.15s;
  outline: none;
}

.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-sans);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.select option { background: var(--bg-secondary); }

.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* === CARD === */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
}

.card-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

/* === STAT BOX === */
.stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.stat-box-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.stat-box-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-box-trend {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-box-trend.up { color: var(--signal-low); }
.stat-box-trend.down { color: var(--signal-critical); }

/* === TABLE === */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

.table td {
  padding: 10px var(--space-md);
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  vertical-align: middle;
}

.table tr:hover td { background: var(--bg-hover); }
.table tr:last-child td { border-bottom: none; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-primary);
}

/* === TOAST === */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  min-width: 260px;
  animation: toastIn 0.25s ease;
  border: 1px solid transparent;
}

.toast.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.toast.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.toast.info {
  background: var(--bg-tertiary);
  border-color: var(--border-active);
  color: var(--text-secondary);
}

/* === BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge.published { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); color: #4ade80; }
.badge.draft { background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.3); color: #fbbf24; }
.badge.archived { background: rgba(100, 116, 139, 0.1); border-color: var(--border-primary); color: var(--text-muted); }

/* === RIGHT PANEL === */
.right-panel {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-primary);
  padding: var(--space-md);
  overflow-y: auto;
}

.right-panel-section {
  margin-bottom: var(--space-lg);
}

.right-panel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

/* === UTILITIES === */
.mono { font-family: var(--font-mono); }
.sans { font-family: var(--font-sans); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

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

/* === ANIMATIONS === */
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.pulse-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--status-live);
  border-radius: 50%;
  animation: pulse-live 2s ease-in-out infinite;
}

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

.fade-in { animation: fadeIn 0.2s ease forwards; }

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

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 40px;
}
::-webkit-scrollbar-thumb:hover { background: #475569; background-clip: padding-box; }

/* === PAGINATION === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
}

.pagination-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 5px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.pagination-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination-btn.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === UPGRADE BANNER === */
.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
}

.upgrade-banner .banner-text { color: var(--text-secondary); }
.upgrade-banner .banner-text strong { color: var(--text-primary); }

/* === SEARCH BAR === */
.search-bar {
  position: relative;
  flex: 1;
}

.search-bar .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

.search-bar .input {
  padding-left: 34px;
}

/* === RESPONSIVE === */
@media (max-width: 1280px) {
  .layout-app {
    grid-template-columns: 220px 1fr 260px;
  }
}

@media (max-width: 1024px) {
  .layout-app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto;
    grid-template-areas:
      "nav"
      "main";
  }

  .layout-app .sidebar { display: none; }
  .layout-app .right-panel { display: none; }

  .hamburger { display: flex !important; }
}

@media (max-width: 768px) {
  .layout-marketing { padding: 0 var(--space-md); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* === HAMBURGER === */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: none;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all 0.2s;
}

/* === HERO === */
.hero {
  padding: var(--space-2xl) 0;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
  padding: 4px 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === SECTION === */
.section {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-primary);
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-base);
  max-width: 560px;
  line-height: 1.6;
}

/* === FOOTER === */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  padding: var(--space-xl) 0;
  margin-top: var(--space-2xl);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  font-size: var(--text-sm);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-secondary); text-decoration: none; }

.footer-copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* === PRICING CARDS === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  align-items: start;
}

.pricing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), 0 0 40px rgba(59, 130, 246, 0.1);
}

.pricing-card .popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.pricing-card-tier {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.pricing-card-price {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.pricing-card-price span {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: 5px 0;
  line-height: 1.5;
}

.pricing-features li .check { color: var(--signal-low); flex-shrink: 0; }
.pricing-features li .cross { color: var(--text-muted); flex-shrink: 0; }

/* === COMPARISON TABLE === */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-top: var(--space-xl);
}

.comparison-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  border-bottom: 2px solid var(--border-primary);
  color: var(--text-secondary);
}

.comparison-table th:first-child { text-align: left; }
.comparison-table th.highlight { color: var(--accent-primary); }

.comparison-table td {
  padding: 10px var(--space-md);
  text-align: center;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  color: var(--text-secondary);
}

.comparison-table td:first-child { text-align: left; color: var(--text-primary); }
.comparison-table tr:last-child td { border-bottom: none; }

.comparison-table .section-row td {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 6px var(--space-md);
  border-bottom: 1px solid var(--border-primary);
}

/* === LOGIN PAGE === */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--bg-primary);
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.login-logo span { color: var(--accent-primary); }

.login-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.alert {
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  text-align: left;
}

.alert.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; }
.alert.success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: #4ade80; }
.alert.info { background: var(--bg-tertiary); border: 1px solid var(--border-active); color: var(--text-secondary); }

/* === MAIN CONTENT AREA === */
.main-content {
  overflow-y: auto;
  padding: var(--space-md);
}

.feed-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.feed-count {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* === ADMIN SIDEBAR === */
.admin-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  padding: var(--space-md);
}

.admin-sidebar .sidebar-nav {
  list-style: none;
}

.admin-sidebar .sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all 0.15s;
  text-decoration: none;
}

.admin-sidebar .sidebar-nav li a:hover,
.admin-sidebar .sidebar-nav li a.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* === PATTERN CARD === */
.pattern-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: border-color 0.15s;
}

.pattern-card:hover { border-color: var(--border-active); }

.pattern-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.pattern-card-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.pattern-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.pattern-metric {
  text-align: center;
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.pattern-metric-value {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent-primary);
}

.pattern-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === TOGGLE === */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--border-primary);
  border-radius: 11px;
  transition: background 0.2s;
  border: 1px solid var(--border-active);
}

.toggle input:checked + .toggle-track { background: var(--accent-primary); }

.toggle-thumb {
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  pointer-events: none;
}

.toggle input:checked ~ .toggle-thumb { left: 21px; }

/* === WINDOW TIMELINE === */
.timeline-wrap {
  position: relative;
  padding: var(--space-md) 0;
}

.timeline-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: var(--space-sm) 0;
}

.timeline-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--signal-low));
  border-radius: 4px;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.days-remaining {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.days-remaining-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === SIGNAL DETAIL === */
.signal-detail-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-secondary); }
.breadcrumb .sep { color: var(--border-active); }

.signal-detail-title {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-top: var(--space-md);
}

.signal-detail-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.signal-detail-main {
  padding: var(--space-lg);
  overflow-y: auto;
}

.signal-detail-sidebar {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-primary);
  padding: var(--space-md);
  overflow-y: auto;
}

.content-section {
  margin-bottom: var(--space-xl);
}

.content-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-primary);
}

.offer-angle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.offer-angle strong {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* === ACCOUNT PAGE === */
.plan-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.plan-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.usage-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: var(--space-sm);
}

.usage-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.usage-bar-fill.warning { background: var(--signal-medium); }
.usage-bar-fill.danger { background: var(--signal-critical); }
