/* ══════════════════════════════════════════════════════════════════
   CONSPIRACY TRACKER — Dashboard Theme v2
   Dark sci-fi with history/comparison/live views
   ══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #0f0f1a;
  --bg-card-hover: #141428;
  --border: #1a1a3a;
  --border-glow: #00ff8855;
  --text-primary: #e0e0f0;
  --text-secondary: #6a6a9a;
  --text-dim: #3a3a6a;
  --accent-green: #00ff88;
  --accent-cyan: #00d4ff;
  --accent-red: #ff3366;
  --accent-orange: #ff8800;
  --accent-purple: #aa44ff;
  --accent-gold: #ffd700;
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.3);
  --glow-red: 0 0 20px rgba(255, 51, 102, 0.3);
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Orbitron', sans-serif;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanner Line */
.scanner-line {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
  animation: scan 4s ease-in-out infinite;
  z-index: 1000; opacity: 0.6;
}
@keyframes scan {
  0% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(100vh); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 0.6; }
}

/* Header */
.header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0f0f1a 0%, var(--bg-dark) 100%);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
body.has-admin-bar .header { top: 56px; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 14px; }
.logo {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--accent-green); letter-spacing: 2px;
  display: flex; align-items: center; gap: 10px;
}
.logo-icon { font-size: 22px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.logo-sub {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-dim); font-weight: 400; letter-spacing: 1px;
}
.live-indicator {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--accent-green);
  text-transform: uppercase; letter-spacing: 1px;
}
.live-dot {
  width: 8px; height: 8px; background: var(--accent-green);
  border-radius: 50%; animation: blink 1.5s ease-in-out infinite;
  box-shadow: var(--glow-green);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.refresh-select select {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); padding: 3px 8px;
  font-family: var(--font-mono); font-size: 10px; cursor: pointer;
}
.btn-scan {
  background: transparent; border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan); padding: 5px 12px;
  font-family: var(--font-mono); font-size: 10px;
  cursor: pointer; letter-spacing: 1px; transition: all 0.2s;
}
.btn-scan:hover {
  background: var(--accent-cyan); color: var(--bg-dark);
  box-shadow: var(--glow-cyan);
}
.btn-scan:active { transform: scale(0.95); }
.timestamp { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; }

/* Tab Navigation */
.tab-nav {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0 24px;
}
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); padding: 12px 20px;
  font-family: var(--font-display); font-size: 11px;
  letter-spacing: 2px; cursor: pointer;
  transition: all 0.2s;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Overview Stats */
.overview {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 12px; padding: 20px 24px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 14px; text-align: center;
  position: relative; overflow: hidden; transition: all 0.3s;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--accent-cyan); opacity: 0.5;
}
.stat-card:hover { border-color: var(--accent-cyan); transform: translateY(-2px); }
.stat-card.up::before { background: var(--accent-green); }
.stat-card.down::before { background: var(--accent-red); }
.stat-card.ports::before { background: var(--accent-purple); }
.stat-label {
  font-size: 9px; color: var(--text-secondary);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  color: var(--text-primary); transition: all 0.3s;
}
.stat-card.up .stat-value { color: var(--accent-green); }
.stat-card.down .stat-value { color: var(--accent-red); }
.stat-card.ports .stat-value { color: var(--accent-purple); }
.stat-unit { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* Animated value change */
.stat-value.flash { animation: flashVal 0.6s; }
@keyframes flashVal {
  0% { color: var(--accent-gold); transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Sections */
.section { padding: 0 24px 24px; }
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.section-header h2 {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--accent-cyan); letter-spacing: 2px;
}
.section-header select {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); padding: 5px 10px;
  font-family: var(--font-mono); font-size: 10px; cursor: pointer;
}
.btn-add {
  background: transparent; border: 1px solid var(--accent-green);
  color: var(--accent-green); padding: 5px 12px;
  font-family: var(--font-mono); font-size: 10px;
  cursor: pointer; letter-spacing: 1px; transition: all 0.2s;
}
.btn-add:hover { background: var(--accent-green); color: var(--bg-dark); }

/* Sites Grid */
.sites-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
  gap: 14px;
}
.site-card {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 18px; position: relative; transition: all 0.3s;
}
.site-card:hover { border-color: var(--accent-cyan); background: var(--bg-card-hover); }
.site-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.site-name {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  color: var(--text-primary); letter-spacing: 1px;
}
.site-url { font-size: 10px; color: var(--text-dim); margin-top: 3px; word-break: break-all; }
.site-url a { color: var(--text-dim); text-decoration: none; }
.site-url a:hover { color: var(--accent-cyan); }
.status-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 8px; font-size: 9px; font-weight: 600;
  letter-spacing: 1px; border: 1px solid;
}
.status-badge.up { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0,255,136,0.05); }
.status-badge.down { color: var(--accent-red); border-color: var(--accent-red); background: rgba(255,51,102,0.05); }
.status-badge.unknown { color: var(--text-dim); border-color: var(--text-dim); }

.site-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; margin-top: 10px;
}
.metric {
  background: rgba(0,0,0,0.3); padding: 6px; text-align: center;
}
.metric-label {
  font-size: 7px; color: var(--text-dim);
  letter-spacing: 1px; text-transform: uppercase;
}
.metric-value {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--accent-cyan); margin-top: 3px;
}

/* Uptime bar inside site card */
.uptime-bar {
  display: flex; gap: 1px; margin-top: 10px; height: 20px; align-items: flex-end;
}
.uptime-bar-label {
  font-size: 8px; color: var(--text-dim); letter-spacing: 1px;
  margin-bottom: 3px; text-transform: uppercase;
}
.uptime-pip {
  flex: 1; min-width: 2px; border-radius: 1px;
  transition: all 0.3s; cursor: default;
  position: relative;
}
.uptime-pip.up { background: var(--accent-green); opacity: 0.7; }
.uptime-pip.up:hover { opacity: 1; }
.uptime-pip.down { background: var(--accent-red); opacity: 0.9; }
.uptime-pip.down:hover { opacity: 1; }
.uptime-pip.none { background: var(--border); opacity: 0.3; }

.site-category {
  display: inline-block; padding: 2px 6px; font-size: 8px;
  color: var(--accent-purple); border: 1px solid var(--accent-purple);
  letter-spacing: 1px; text-transform: uppercase; margin-top: 6px;
}
.site-delete {
  position: absolute; top: 6px; right: 6px;
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 13px; opacity: 0; transition: all 0.2s;
}
.site-card:hover .site-delete { opacity: 1; }
.site-delete:hover { color: var(--accent-red); }

/* Chart */
.chart-container {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 16px; height: 280px; position: relative;
}
.chart-container.tall { height: 360px; }

/* Community Hero Chart — BIG HERO SECTION */
.community-hero {
  padding: 20px 24px 32px;
  margin: 0 -24px;
  background: linear-gradient(180deg, #060a0d 0%, #0a0a0f 40%, #0f0f1a 100%);
  border-bottom: 1px solid rgba(0, 255, 136, 0.12);
  position: relative;
  overflow: hidden;
}
.community-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,136,0.5), transparent);
}
.community-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,255,136,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.community-hero .section-header {
  border-bottom: none;
  margin-bottom: 0;
  padding: 10px 0;
}
.community-hero .section-header h2 {
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--accent-green);
  text-shadow: 0 0 30px rgba(0,255,136,0.4), 0 0 60px rgba(0,255,136,0.15);
}

/* Hero Big Number */
.community-hero-number {
  text-align: center;
  padding: 24px 0 12px;
  position: relative;
}
.community-hero-number .hero-total-label {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.community-hero-number .hero-total-value {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 900;
  color: var(--accent-green);
  letter-spacing: 4px;
  line-height: 1;
  text-shadow: 0 0 40px rgba(0,255,136,0.35), 0 0 80px rgba(0,255,136,0.15);
  animation: heroGlow 3s ease-in-out infinite;
}
@keyframes heroGlow {
  0%, 100% { text-shadow: 0 0 40px rgba(0,255,136,0.35), 0 0 80px rgba(0,255,136,0.15); }
  50% { text-shadow: 0 0 60px rgba(0,255,136,0.5), 0 0 120px rgba(0,255,136,0.25); }
}
.community-hero-number .hero-total-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  letter-spacing: 1px;
}
.community-hero-number .hero-total-change {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 1px;
}
.community-hero-number .hero-total-change.positive { color: var(--accent-green); }
.community-hero-number .hero-total-change.negative { color: var(--accent-red); }
.community-hero-number .hero-total-change.neutral { color: var(--text-dim); }

/* Highlight stat row */
.community-hero-highlights {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 16px 0 20px;
  flex-wrap: wrap;
}
.community-highlight {
  text-align: center;
  min-width: 120px;
}
.community-highlight .highlight-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}
.community-highlight .highlight-label {
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}
.community-highlight .highlight-change {
  font-size: 10px;
  font-weight: 500;
  margin-top: 2px;
}

.chart-container.community-chart {
  height: 520px;
  border: 1px solid rgba(0, 255, 136, 0.12);
  background: linear-gradient(180deg, #080c0f 0%, #0d0d1a 100%);
  box-shadow: 0 0 60px rgba(0, 255, 136, 0.05), inset 0 1px 0 rgba(0,255,136,0.08);
  position: relative;
}
.chart-container.community-chart::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,136,0.3), transparent);
}
.community-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.community-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(15,15,26,0.9), rgba(10,15,18,0.9));
  border: 1px solid var(--border);
  padding: 12px 16px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.community-stat-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-green);
  opacity: 0;
  transition: opacity 0.3s;
}
.community-stat-card:hover {
  border-color: rgba(0, 255, 136, 0.3);
  background: rgba(0,255,136,0.03);
  transform: translateY(-1px);
}
.community-stat-card:hover::before {
  opacity: 1;
}
.community-stat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 12px currentColor;
}
.community-stat-info {
  flex: 1; min-width: 0;
}
.community-stat-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.community-stat-site {
  font-size: 8px;
  color: var(--text-dim);
  margin-top: 2px;
}
.community-stat-numbers {
  text-align: right;
  flex-shrink: 0;
}
.community-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.community-stat-change {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}

/* Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.stats-site-card {
  background: var(--bg-card); border: 1px solid var(--border); padding: 14px;
}
.stats-site-name {
  font-family: var(--font-display); font-size: 11px;
  color: var(--accent-gold); letter-spacing: 1px;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.stats-list { display: grid; gap: 4px; }
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 8px; background: rgba(0,0,0,0.2);
}
.stat-row-key {
  font-size: 9px; color: var(--text-secondary);
  letter-spacing: 1px; text-transform: uppercase;
}
.stat-row-value {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--accent-green);
}
.stat-row-change {
  font-size: 9px; margin-left: 6px; font-weight: 400;
}
.stat-row-change.up { color: var(--accent-green); }
.stat-row-change.down { color: var(--accent-red); }
.stat-row-change.same { color: var(--text-dim); }
.stat-mini-chart {
  width: 80px; height: 24px; display: inline-block; vertical-align: middle;
}

/* Ports Grid */
.ports-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.port-host-card {
  background: var(--bg-card); border: 1px solid var(--border); padding: 14px;
}
.port-host-name {
  font-family: var(--font-display); font-size: 11px;
  color: var(--accent-purple); letter-spacing: 1px;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.port-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
}
.port-item {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 7px; background: rgba(0,0,0,0.2); font-size: 10px;
}
.port-dot { width: 6px; height: 6px; border-radius: 50%; }
.port-dot.open { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.port-dot.closed { background: var(--accent-red); opacity: 0.4; }
.port-number { color: var(--text-primary); font-weight: 600; }
.port-service { color: var(--text-dim); font-size: 8px; }

/* Comparison Tab */
.compare-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.compare-card {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 16px; position: relative; overflow: hidden;
}
.compare-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; opacity: 0.7;
}
.compare-card:nth-child(1)::before { background: #00ff88; }
.compare-card:nth-child(2)::before { background: #00d4ff; }
.compare-card:nth-child(3)::before { background: #ff8800; }
.compare-card:nth-child(4)::before { background: #aa44ff; }
.compare-card:nth-child(5)::before { background: #ffd700; }
.compare-card-name {
  font-family: var(--font-display); font-size: 11px;
  color: var(--text-primary); letter-spacing: 1px; margin-bottom: 12px;
}
.compare-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.compare-stat-label { font-size: 9px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.compare-stat-value {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
}

/* Stats side-by-side table */
.side-by-side-table {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-collapse: collapse;
}
.side-by-side-table th, .side-by-side-table td {
  padding: 8px 12px; text-align: center;
  border: 1px solid var(--border); font-size: 11px;
}
.side-by-side-table th {
  font-family: var(--font-display); font-size: 10px;
  color: var(--accent-cyan); letter-spacing: 1px;
  background: rgba(0,0,0,0.3);
}
.side-by-side-table td { color: var(--text-primary); }
.side-by-side-table td:first-child {
  text-align: left; color: var(--text-secondary); font-size: 10px;
  letter-spacing: 1px; text-transform: uppercase;
}

/* Uptime Timeline */
.uptime-timeline-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.uptime-timeline-name {
  font-family: var(--font-display); font-size: 10px;
  color: var(--text-primary); width: 160px; flex-shrink: 0; letter-spacing: 1px;
}
.uptime-timeline-bar {
  flex: 1; display: flex; gap: 1px; height: 24px; align-items: center;
}
.uptime-timeline-pct {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  width: 60px; text-align: right; flex-shrink: 0;
}

/* Activity Feed */
.activity-feed {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 80vh; overflow-y: auto;
}
.activity-row {
  display: grid; grid-template-columns: 140px 160px 80px 80px auto;
  gap: 12px; padding: 8px 12px;
  background: var(--bg-card); border: 1px solid transparent;
  font-size: 11px; transition: all 0.3s; align-items: center;
}
.activity-row:hover { border-color: var(--border); }
.activity-row.new {
  animation: feedIn 0.5s ease-out;
  border-left: 2px solid var(--accent-cyan);
}
@keyframes feedIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.activity-time { color: var(--text-dim); font-size: 10px; letter-spacing: 0.5px; }
.activity-site { color: var(--text-primary); font-weight: 500; }
.activity-status { font-weight: 600; }
.activity-status.up { color: var(--accent-green); }
.activity-status.down { color: var(--accent-red); }
.activity-response { color: var(--accent-cyan); font-family: var(--font-display); font-size: 11px; }
.activity-error { color: var(--accent-red); font-size: 9px; opacity: 0.8; }

/* Data Table */
.data-table-wrap {
  max-height: 400px; overflow-y: auto;
  border: 1px solid var(--border);
}
.data-table {
  width: 100%; border-collapse: collapse; background: var(--bg-card);
}
.data-table th {
  position: sticky; top: 0; background: #0d0d18;
  font-family: var(--font-display); font-size: 9px;
  color: var(--accent-cyan); letter-spacing: 1px;
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 6px 10px; font-size: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  color: var(--text-secondary);
}
.data-table tr:hover td { background: rgba(0,212,255,0.02); }

/* Modal */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85); z-index: 200;
  justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--accent-cyan);
  padding: 24px; min-width: 400px;
  box-shadow: 0 0 40px rgba(0,212,255,0.15);
}
.modal h3 {
  font-family: var(--font-display); font-size: 13px;
  color: var(--accent-cyan); letter-spacing: 2px; margin-bottom: 18px;
}
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: 9px; color: var(--text-secondary);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px;
}
.form-group input {
  width: 100%; background: var(--bg-dark); border: 1px solid var(--border);
  color: var(--text-primary); padding: 7px 10px;
  font-family: var(--font-mono); font-size: 11px;
}
.form-group input:focus { outline: none; border-color: var(--accent-cyan); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.btn-cancel, .btn-confirm {
  padding: 7px 14px; font-family: var(--font-mono); font-size: 10px;
  cursor: pointer; letter-spacing: 1px; border: 1px solid; transition: all 0.2s;
}
.btn-cancel { background: transparent; color: var(--text-dim); border-color: var(--text-dim); }
.btn-confirm { background: transparent; color: var(--accent-green); border-color: var(--accent-green); }
.btn-confirm:hover { background: var(--accent-green); color: var(--bg-dark); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — Desktop / iPad / iPhone
   ══════════════════════════════════════════════════════════════════ */

/* ---------- Large desktop (>1200) — default, no changes ---------- */

/* ---------- iPad landscape / small desktop (≤1200px) ---------- */
@media (max-width: 1200px) {
  .overview { grid-template-columns: repeat(3, 1fr); }
  .visitor-hero-stats { grid-template-columns: repeat(3, 1fr); }
  .visitor-hero-stats.secondary-row { grid-template-columns: repeat(4, 1fr); }
  .community-hero-number .hero-total-value { font-size: 56px; }
  .chart-container.community-chart { height: 420px; }
}

/* ---------- iPad portrait / tablets (≤1024px) ---------- */
@media (max-width: 1024px) {
  .overview { grid-template-columns: repeat(3, 1fr); }
  .visitor-hero-stats { grid-template-columns: repeat(3, 1fr); }
  .visitor-hero-stats.secondary-row { grid-template-columns: repeat(2, 1fr); }
  .visitor-three-col { grid-template-columns: 1fr 1fr; }
  .community-hero-highlights { gap: 18px; }
  .community-highlight .highlight-value { font-size: 22px; }
  .community-summary-grid { grid-template-columns: 1fr 1fr; }
  .compare-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .visitor-hero-value { font-size: 28px; }
  .chart-container.community-chart { height: 360px; }
  .chart-container.visitor-chart { height: 320px; }
  .activity-row { grid-template-columns: 100px 140px 60px 60px auto; font-size: 10px; gap: 8px; }
  .side-by-side-table th, .side-by-side-table td { padding: 6px 8px; font-size: 10px; }
  .uptime-timeline-name { width: 120px; font-size: 9px; }
}

/* ---------- Phone landscape / small tablet (≤768px) ---------- */
@media (max-width: 768px) {
  /* Layout */
  .container { padding: 10px 8px; }
  .section { padding: 0 12px 16px; }
  .header { flex-direction: column; gap: 8px; padding: 10px 12px; }
  .header-left { flex-wrap: wrap; gap: 8px; }
  .header-right { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .logo { font-size: 13px; letter-spacing: 1px; }
  .logo-icon { font-size: 18px; }
  .logo-sub { font-size: 8px; }

  /* Tabs — horizontal scroll */
  .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 8px; scrollbar-width: none; }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 14px; font-size: 9px; letter-spacing: 1px; white-space: nowrap; min-width: max-content; }

  /* Overview cards */
  .overview { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 8px; letter-spacing: 1px; }
  .stat-card { padding: 10px; }

  /* Sites */
  .sites-grid { grid-template-columns: 1fr; gap: 10px; }
  .site-card { padding: 14px; }
  .site-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-value { font-size: 12px; }

  /* Community hero */
  .community-hero { padding: 14px 12px 20px; margin: 0 -12px; }
  .community-hero-number .hero-total-value { font-size: 44px; letter-spacing: 2px; }
  .community-hero-number .hero-total-label { font-size: 8px; letter-spacing: 2px; }
  .community-hero-highlights { gap: 12px; padding: 10px 0 14px; }
  .community-highlight { min-width: 90px; }
  .community-highlight .highlight-value { font-size: 20px; }
  .community-highlight .highlight-label { font-size: 7px; }
  .chart-container.community-chart { height: 280px; }
  .community-summary-grid { grid-template-columns: 1fr; }
  .community-stat-value { font-size: 18px; }

  /* Visitor hero */
  .visitor-hero { padding: 14px 12px 18px; margin: 0 -12px; }
  .visitor-hero .section-header h2 { font-size: 15px; letter-spacing: 2px; }
  .visitor-hero-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px 0 6px; }
  .visitor-hero-stats.secondary-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .visitor-hero-card { padding: 14px 10px; }
  .visitor-hero-value { font-size: 24px; }
  .visitor-hero-value.small { font-size: 18px; }
  .visitor-hero-label { font-size: 8px; letter-spacing: 1px; }
  .visitor-hero-sub { font-size: 8px; }
  .visitor-hero-card.mini { padding: 10px 8px; }

  /* Visitor charts */
  .chart-container.visitor-chart { height: 260px; }
  .chart-container { height: 220px; }
  .chart-container.tall { height: 280px; }

  /* Three-col → single col */
  .visitor-three-col { grid-template-columns: 1fr; gap: 14px; }

  /* Visitor feed — horizontal scroll */
  .visitor-feed { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .visitor-row {
    grid-template-columns: 90px 50px 30px 70px 50px 45px 45px 35px 55px auto;
    font-size: 9px; gap: 4px; padding: 6px 8px; min-width: 640px;
  }
  .visitor-time { font-size: 9px; }
  .visitor-fp { font-size: 8px; }
  .visitor-path { font-size: 9px; }
  .visitor-browser { font-size: 8px; }
  .visitor-views { font-size: 9px; }
  .visitor-ref { font-size: 8px; }

  /* Activity feed */
  .activity-feed { max-height: 60vh; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .activity-row { grid-template-columns: 80px 100px 50px 50px auto; font-size: 9px; gap: 6px; padding: 6px 8px; min-width: 440px; }
  .activity-time { font-size: 9px; }

  /* Heatmap */
  .heatmap-cell { height: 16px; }
  .heatmap-day-label { width: 28px; font-size: 7px; }
  .heatmap-hour-label { font-size: 6px; }

  /* Compare / History */
  .compare-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .ports-grid { grid-template-columns: 1fr; }

  /* Tables */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 500px; }
  .session-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .side-by-side-table { min-width: 400px; }
  .uptime-timeline-name { width: 80px; font-size: 8px; }
  .uptime-timeline-pct { width: 45px; font-size: 10px; }

  /* Browser / device cards */
  .visitor-browsers { grid-template-columns: 1fr 1fr; }
  .browser-name { font-size: 10px; }
  .browser-pct { font-size: 12px; }
  .device-icon { font-size: 20px; width: 32px; }
  .device-pct { font-size: 14px; }

  /* Modal */
  .modal { min-width: unset; width: 92vw; max-width: 400px; padding: 18px 14px; }
}

/* ---------- iPhone / small phone (≤480px) ---------- */
@media (max-width: 480px) {
  body { font-size: 12px; }
  .header { padding: 8px 10px; gap: 6px; }
  .logo { font-size: 11px; gap: 6px; }
  .logo-icon { font-size: 16px; }
  .btn-scan { padding: 6px 10px; font-size: 9px; }
  .timestamp { font-size: 9px; }

  /* Tabs — tighter */
  .tab-nav { padding: 0 4px; }
  .tab { padding: 8px 10px; font-size: 8px; letter-spacing: 1px; }

  /* Overview — 2 cols tighter */
  .overview { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px 8px; }
  .stat-card { padding: 8px 6px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 7px; }
  .stat-unit { font-size: 8px; }

  /* Community hero */
  .community-hero { padding: 10px 8px 16px; margin: 0 -8px; }
  .community-hero .section-header h2 { font-size: 13px; letter-spacing: 2px; }
  .community-hero-number .hero-total-value { font-size: 36px; letter-spacing: 1px; }
  .community-hero-number .hero-total-sub { font-size: 9px; }
  .community-hero-number .hero-total-change { font-size: 11px; }
  .community-hero-highlights { flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 12px; }
  .community-highlight { min-width: unset; width: 100%; display: flex; align-items: baseline; justify-content: space-between; padding: 4px 0; }
  .community-highlight .highlight-value { font-size: 22px; }
  .community-highlight .highlight-label { margin-top: 0; font-size: 8px; }
  .chart-container.community-chart { height: 220px; }
  .community-summary-grid { gap: 6px; }
  .community-stat-card { padding: 10px 12px; }
  .community-stat-value { font-size: 16px; }
  .community-stat-label { font-size: 8px; }

  /* Visitor hero */
  .visitor-hero { padding: 10px 8px 14px; margin: 0 -8px; }
  .visitor-hero .section-header h2 { font-size: 13px; letter-spacing: 1px; }
  .visitor-hero-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px 0 4px; }
  .visitor-hero-stats.secondary-row { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .visitor-hero-card { padding: 10px 8px; }
  .visitor-hero-value { font-size: 20px; letter-spacing: 1px; }
  .visitor-hero-value.small { font-size: 16px; }
  .visitor-hero-label { font-size: 7px; letter-spacing: 1px; margin-top: 4px; }
  .visitor-hero-sub { font-size: 7px; }
  .visitor-hero-icon { font-size: 10px; }

  /* Charts */
  .chart-container.visitor-chart { height: 200px; }
  .chart-container { height: 180px; padding: 10px; }
  .chart-container.tall { height: 240px; }

  /* Sections */
  .section { padding: 0 8px 12px; }
  .section-header { padding: 10px 0; margin-bottom: 10px; }
  .section-header h2 { font-size: 11px; letter-spacing: 1px; }

  /* Visitor layout */
  .visitor-three-col { grid-template-columns: 1fr; gap: 10px; }
  .visitor-bar-content { padding: 8px 10px; }
  .visitor-bar-label { font-size: 10px; }
  .visitor-bar-values { font-size: 9px; }

  /* Feed → card-style stacking on very small screens */
  .visitor-feed { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .visitor-row {
    min-width: 560px;
    grid-template-columns: 80px 45px 25px 65px 42px 40px 40px 30px 50px auto;
    font-size: 8px; gap: 3px; padding: 5px 6px;
  }

  /* Activity feed */
  .activity-row {
    min-width: 380px;
    grid-template-columns: 70px 90px 42px 42px auto;
    font-size: 8px; gap: 4px; padding: 5px 6px;
  }

  /* Heatmap */
  .heatmap-container { padding: 10px 6px; }
  .heatmap-cell { height: 14px; }
  .heatmap-day-label { width: 22px; font-size: 6px; padding-right: 3px; }
  .heatmap-hour-label { font-size: 5px; }
  .heatmap-legend { font-size: 8px; gap: 4px; }
  .heatmap-legend-bar { width: 80px; height: 6px; }

  /* Browser / device cards */
  .visitor-browsers { grid-template-columns: 1fr; }
  .browser-card { padding: 10px 12px; }
  .browser-name { font-size: 10px; }
  .browser-pct { font-size: 12px; }
  .device-card { padding: 10px 12px; gap: 8px; }
  .device-icon { font-size: 18px; width: 28px; }
  .device-name { font-size: 10px; }
  .device-pct { font-size: 14px; }
  .device-bar-wrap { width: 60px; }

  /* Site cards */
  .site-card { padding: 12px; }
  .site-name { font-size: 11px; }
  .site-metrics { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .metric-value { font-size: 11px; }
  .metric-label { font-size: 6px; }

  /* Compare */
  .compare-card { padding: 12px; }
  .compare-card-name { font-size: 10px; }
  .compare-stat-value { font-size: 12px; }

  /* Session table */
  .session-table-wrap { font-size: 9px; }

  /* Tables */
  .uptime-timeline-row { gap: 6px; padding: 6px 0; }
  .uptime-timeline-name { width: 60px; font-size: 7px; letter-spacing: 0.5px; }
  .uptime-timeline-pct { width: 38px; font-size: 10px; }

  /* Modal */
  .modal { width: 95vw; max-width: 360px; padding: 14px 10px; }
  .modal h3 { font-size: 11px; letter-spacing: 1px; }
  .form-group input { font-size: 12px; padding: 8px 10px; }

  /* Touch targets — minimum 44px tap area */
  .btn-scan, .btn-add, .btn-cancel, .btn-confirm {
    min-height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .tab { min-height: 40px; display: inline-flex; align-items: center; }
  .refresh-select select { min-height: 36px; font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════════════
   VISITOR ANALYTICS TAB
   ══════════════════════════════════════════════════════════════════ */

/* Visitor Hero Section */
.visitor-hero {
  padding: 20px 24px 24px;
  margin: 0 -24px;
  background: linear-gradient(180deg, #060810 0%, #0a0a0f 40%, #0f0f1a 100%);
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
  position: relative;
  overflow: hidden;
}
.visitor-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.5), transparent);
}
.visitor-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,212,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.visitor-hero .section-header {
  border-bottom: none;
  margin-bottom: 0;
  padding: 10px 0;
}
.visitor-hero .section-header h2 {
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--accent-cyan);
  text-shadow: 0 0 30px rgba(0,212,255,0.4), 0 0 60px rgba(0,212,255,0.15);
}

/* Visitor Stats Grid */
.visitor-hero-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  padding: 20px 0 10px;
}
.visitor-hero-card {
  background: linear-gradient(135deg, rgba(15,15,26,0.95), rgba(10,15,20,0.95));
  border: 1px solid var(--border);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.visitor-hero-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-cyan);
  opacity: 0.5;
}
.visitor-hero-card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,212,255,0.08);
}
.visitor-hero-card.hero-live {
  border-color: rgba(0, 255, 136, 0.25);
  background: linear-gradient(135deg, rgba(0,255,136,0.03), rgba(15,15,26,0.95));
}
.visitor-hero-card.hero-live::before {
  background: var(--accent-green);
  animation: pulseBar 2s ease-in-out infinite;
}
@keyframes pulseBar {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.visitor-hero-card.hero-live .visitor-hero-value {
  color: var(--accent-green);
  text-shadow: 0 0 20px rgba(0,255,136,0.4);
}
.visitor-hero-icon {
  font-size: 12px;
  color: var(--accent-green);
  margin-bottom: 6px;
  animation: blink 1.5s ease-in-out infinite;
}
.visitor-hero-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  line-height: 1;
}
.visitor-hero-label {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 8px;
}
.visitor-hero-sub {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Visitor Traffic Chart */
.chart-container.visitor-chart {
  height: 400px;
  border: 1px solid rgba(0, 212, 255, 0.12);
  background: linear-gradient(180deg, #080c0f 0%, #0d0d1a 100%);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.04), inset 0 1px 0 rgba(0,212,255,0.08);
}

/* Three Column Layout */
.visitor-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

/* Visitor Bar Rows (Pages & Referrers & Languages) */
.visitor-bar-row {
  position: relative;
  margin-bottom: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s;
}
.visitor-bar-row:hover {
  border-color: rgba(0,212,255,0.3);
}
.visitor-bar-row.referrer:hover {
  border-color: rgba(170,68,255,0.3);
}
.visitor-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(0,212,255,0.12), rgba(0,212,255,0.03));
  transition: width 0.6s ease;
}
.visitor-bar-fill.ref-fill {
  background: linear-gradient(90deg, rgba(170,68,255,0.12), rgba(170,68,255,0.03));
}
.visitor-bar-fill.lang-fill {
  background: linear-gradient(90deg, rgba(255,215,0,0.12), rgba(255,215,0,0.03));
}
.visitor-bar-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
}
.visitor-bar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 500;
}
.visitor-bar-values {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Browser Breakdown */
.visitor-browsers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.browser-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}
.browser-card:hover {
  border-color: rgba(0,212,255,0.2);
}
.browser-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  transition: width 0.6s ease;
}
.browser-info {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.browser-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}
.browser-pct {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.browser-counts {
  position: relative;
  z-index: 1;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* Visitor Feed */
.visitor-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 600px;
  overflow-y: auto;
}
.visitor-row {
  display: grid;
  grid-template-columns: 120px 65px 38px 90px 60px 55px 55px 40px 65px auto;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid transparent;
  font-size: 11px;
  transition: all 0.3s;
  align-items: center;
}
.visitor-row:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
}
.visitor-row.recent {
  animation: feedIn 0.5s ease-out;
  border-left: 2px solid var(--accent-cyan);
}
.visitor-time {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.5px;
}
.visitor-fp {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-purple);
  opacity: 0.8;
}
.visitor-path {
  color: var(--accent-cyan);
  font-weight: 500;
  font-size: 10px;
}
.visitor-browser {
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.visitor-views {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--accent-green);
  font-weight: 600;
}
.visitor-ref {
  font-size: 9px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Visitor Hero Card Accents */
.visitor-hero-card.accent-green::before { background: var(--accent-green); }
.visitor-hero-card.accent-green .visitor-hero-value { color: var(--accent-green); }
.visitor-hero-card.accent-orange::before { background: var(--accent-orange); }
.visitor-hero-card.accent-orange .visitor-hero-value { color: var(--accent-orange); }

/* Secondary Hero Stats Row */
.visitor-hero-stats.secondary-row {
  grid-template-columns: repeat(4, 1fr);
  padding-top: 0;
  gap: 10px;
}
.visitor-hero-card.mini {
  padding: 12px 14px;
}
.visitor-hero-value.small {
  font-size: 22px;
}

/* Visitor Badge (NEW / RET) */
.visitor-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 2px;
  font-family: var(--font-display);
}
.visitor-badge.new {
  background: rgba(0,255,136,0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0,255,136,0.3);
}
.visitor-badge.ret {
  background: rgba(255,136,0,0.1);
  color: var(--accent-orange);
  border: 1px solid rgba(255,136,0,0.2);
}
.visitor-badge.site {
  background: rgba(168,85,247,0.12);
  color: #c084fc;
  border: 1px solid rgba(168,85,247,0.25);
  text-transform: uppercase;
}
.visitor-badge.dash {
  background: rgba(100,100,140,0.1);
  color: #6a6a9a;
  border: 1px solid rgba(100,100,140,0.2);
  text-transform: uppercase;
}

/* Visitor extra columns */
.visitor-os {
  font-size: 9px;
  color: var(--text-secondary);
}
.visitor-device {
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.visitor-screen {
  font-size: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Device Cards */
.visitor-devices {
  display: grid;
  gap: 8px;
}
.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}
.device-card:hover {
  border-color: rgba(0,212,255,0.2);
}
.device-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.device-info {
  flex: 1;
}
.device-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}
.device-pct {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}
.device-bar-wrap {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.device-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.device-counts {
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Peak Hours Heatmap */
.heatmap-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px;
}
.heatmap-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.heatmap-row {
  display: flex;
  gap: 2px;
  align-items: center;
}
.heatmap-day-label {
  width: 36px;
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-align: right;
  padding-right: 6px;
  flex-shrink: 0;
}
.heatmap-hour-label {
  flex: 1;
  text-align: center;
  font-size: 7px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.heatmap-cell {
  flex: 1;
  height: 20px;
  border-radius: 2px;
  cursor: default;
  transition: all 0.2s;
}
.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 2;
  box-shadow: 0 0 8px rgba(0,255,136,0.4);
}
.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 9px;
  color: var(--text-dim);
}
.heatmap-legend-bar {
  width: 120px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1a1a3a, #4a4a7a, #00d4ff, #00ff88);
}

/* Session Table */
.session-table-wrap {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
}
