/* ==========================================================================
   CammieDash Stylesheet - Cloud Observability & Fleet Telemetry
   ========================================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #18223a;
  --bg-card-inner: #0d1424;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(59, 130, 246, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --accent-blue: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-purple: #c084fc;
  --accent-green: #10b981;
  --accent-emerald: #34d399;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-pink: #fb7185;

  --glow-blue: 0 0 20px rgba(56, 189, 248, 0.25);
  --glow-green: 0 0 16px rgba(16, 185, 129, 0.3);
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-heading: 'Playfair Display', Georgia, serif;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.04) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(129, 140, 248, 0.04) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.6) 0px, transparent 100%);
  background-attachment: fixed;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-blue);
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.logo-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.4));
}

.live-pulse-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: var(--glow-green);
  animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0.9); opacity: 1; }
}

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

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-indigo);
}

.header-status-ticker {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ticker-label {
  color: var(--text-subtle);
  font-weight: 600;
  font-size: 0.7rem;
}

.ticker-val {
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.status-healthy {
  color: var(--accent-emerald) !important;
}

.pulse-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-emerald);
  border-radius: 50%;
  margin-right: 4px;
}

.ticker-divider {
  width: 1px;
  height: 14px;
  background: var(--border-color);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-accent:hover {
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.btn-xs {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-xs:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Hero section */
.hero-section {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.2) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
}

.hero-title {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 850px;
  line-height: 1.6;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
}

.stat-icon {
  font-size: 1.1rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-success {
  color: var(--accent-emerald);
  font-weight: 600;
}

.text-accent {
  color: var(--accent-blue) !important;
}

/* ==========================================================================
   Controls: Search & Filter Chips
   ========================================================================== */

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
}

.search-box input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.filter-chip.active {
  background: var(--accent-blue);
  color: #0b0f19;
  border-color: var(--accent-blue);
  font-weight: 700;
}

/* ==========================================================================
   Fleet List & Expandable Cards
   ========================================================================== */

.fleet-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.site-card.expanded {
  border-color: var(--border-active);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.site-card-header {
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 1.5rem;
  user-select: none;
  background: rgba(255, 255, 255, 0.01);
  transition: background 0.2s ease;
}

.site-card-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.site-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 280px;
}

.site-favicon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.site-favicon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.site-names {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-name-link {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.site-name-link:hover {
  color: var(--accent-blue);
  text-decoration: none;
}

.external-link-icon {
  opacity: 0.6;
}

.category-pill {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent-indigo);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.site-submeta {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* Quick Metrics Bar */
.site-quick-metrics {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.75rem;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-online {
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.dot-warn {
  background: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
}

.metric-label {
  color: var(--text-subtle);
  font-weight: 500;
}

.metric-value {
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.ai-health-pill .metric-value {
  color: var(--accent-blue);
}

.accordion-chevron {
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
  margin-left: 0.5rem;
}

.site-card.expanded .accordion-chevron {
  transform: rotate(180deg);
  color: var(--accent-blue);
}

/* ==========================================================================
   Expanded Card Body & Tabs
   ========================================================================== */

.site-card-body {
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-inner);
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

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

.tab-navigation {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.tab-btn.active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.pane-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.pane-subtitle {
  margin: 0.2rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mini stat cards inside pane */
.stats-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.mini-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mini-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.mini-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}

.text-success {
  color: var(--accent-emerald) !important;
}

/* Stats table */
.stats-table-wrapper {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.stats-table, .search-queries-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.stats-table th, .search-queries-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  color: var(--text-subtle);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.stats-table td, .search-queries-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.stats-table tr:last-child td, .search-queries-table tr:last-child td {
  border-bottom: none;
}

.metric-cell-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-blue);
}

.metric-cell-desc {
  color: var(--text-muted);
}

.empty-cell {
  text-align: center;
  color: var(--text-subtle);
  padding: 2rem !important;
}

/* ==========================================================================
   Logs Viewer & AI Scanner
   ========================================================================== */

.logs-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.select-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  outline: none;
}

.logs-viewer {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.log-entry {
  display: flex;
  gap: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.01);
  word-break: break-word;
}

.log-entry:hover {
  background: rgba(255, 255, 255, 0.04);
}

.log-time {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.log-severity {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sev-INFO { background: rgba(56, 189, 248, 0.15); color: var(--accent-blue); }
.sev-WARNING { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.sev-ERROR { background: rgba(244, 63, 94, 0.25); color: var(--accent-rose); }
.sev-CRITICAL { background: rgba(244, 63, 94, 0.4); color: #fff; font-weight: 800; }

.log-msg {
  color: #e2e8f0;
  flex: 1;
}

.logs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem;
  color: var(--text-muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* AI Diagnostics Box */
.ai-scan-result {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 12px;
  padding: 1.5rem;
}

.ai-scan-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-scan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.ai-scan-status-badge {
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ai-badge-healthy {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.ai-badge-critical {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.ai-scan-summary {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.ai-issues-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ai-issue-item {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--accent-blue);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
}

.ai-scan-placeholder {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.ai-brain-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Analytics Detail Box
   ========================================================================== */

.analytics-detail-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.analytics-detail-box h4 {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.traffic-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.traffic-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
}

.traffic-list .path {
  font-family: var(--font-mono);
  width: 140px;
  color: var(--text-main);
}

.traffic-list .pct {
  width: 40px;
  color: var(--text-subtle);
  text-align: right;
}

.traffic-list .bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
}

.traffic-list .bar span {
  display: block;
  height: 100%;
  background: var(--accent-blue);
  border-radius: 9999px;
}

/* ==========================================================================
   Footer & Legal Modals (Scores pattern)
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 3rem 1.5rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand {
  max-width: 450px;
}

.footer-logo {
  width: 32px;
  height: 32px;
  margin-bottom: 0.5rem;
}

.footer-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.footer-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.links-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.footer-links-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.legal-footer {
  text-align: center;
  padding: 1.25rem 0;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.legal-links {
  margin: 0;
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
}

.legal-links a {
  color: inherit;
  text-decoration: underline;
  opacity: 0.85;
}

.legal-dot {
  opacity: 0.4;
}

/* Modals */
.legal-custom-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.legal-custom-modal-content {
  background-color: var(--bg-card);
  color: var(--text-main);
  margin: 8% auto;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  width: 90%;
  max-width: 560px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.legal-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.legal-close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
}

.legal-close-btn:hover {
  opacity: 1;
}

.legal-modal-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.legal-modal-body p:first-child {
  margin-top: 0;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 900px) {
  .site-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .site-quick-metrics {
    width: 100%;
    justify-content: flex-start;
  }
  .header-status-ticker {
    display: none;
  }
}
