/* ── Design System (Statiq brand) ── */
:root {
  --primary: #101941;
  --accent: #FC441E;
  --bg: #F5F6F7;
  --white: #ffffff;
  --text: #2d2d2d;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --amber: #f59e0b;
  --red: #ef4444;
  --critical: #dc2626;
  --green: #10b981;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --sidebar-width: 200px;
  --sidebar-collapsed-width: 56px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

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

/* ── Layout ── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width .2s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .sidebar-brand small,
.sidebar.collapsed .sidebar-nav a span,
.sidebar.collapsed .sidebar-footer-text { display: none; }
.sidebar.collapsed .sidebar-brand { font-size: 0; padding: 16px 12px; }
.sidebar.collapsed .sidebar-brand .brand-icon { font-size: 20px; display: block; }
.sidebar.collapsed .sidebar-nav a { padding: 12px 16px; justify-content: center; font-size: 0; }
.sidebar.collapsed .sidebar-nav a .nav-icon { font-size: 18px; }
.sidebar.collapsed + .main,
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-collapsed-width); }

.sidebar-brand {
  padding: 24px 20px 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
}

.sidebar-brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: .7;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 16px 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.sidebar-nav a.active { border-left: 3px solid var(--accent); }

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 32px;
  max-width: 1280px;
}

/* ── Page sections ── */
.page { display: none; }
.page.active { display: block; }

/* ── Page header ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header .subtitle { color: var(--text-light); font-size: 13px; margin-top: 2px; }

/* ── Date range ── */
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-range input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--white);
}

.quick-btns { display: flex; gap: 4px; }

.quick-btn {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
}

.quick-btn:hover, .quick-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ── Stat cards ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.stat-card.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat-card.clickable:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.stat-card.clickable.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(16,25,65,.15); }

.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  font-weight: 600;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.2;
}

.stat-card .value.critical { color: var(--critical); }
.stat-card .value.red { color: var(--red); }
.stat-card .value.amber { color: var(--amber); }
.stat-card .value.green { color: var(--green); }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}

.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-light);
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr { transition: background .1s; cursor: pointer; }
tbody tr:hover { background: #f9fafb; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.badge-critical {
  background: var(--critical);
  color: #fff;
  animation: pulse-critical 1.5s ease-in-out infinite;
}

.badge-red { background: #fee2e2; color: var(--danger); }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-green { background: #d1fae5; color: #065f46; }

@keyframes pulse-critical {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .4); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* ── Health pill ── */
.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.health-dot.h-green { background: var(--green); }
.health-dot.h-yellow { background: var(--warning); }
.health-dot.h-orange { background: #f97316; }
.health-dot.h-red { background: var(--danger); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { opacity: .9; }
.btn-outline { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-back { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 13px; padding: 0; }
.btn-back:hover { color: var(--text); }

/* ── Search & filter bar ── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar input[type="text"] {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  width: 240px;
  background: var(--white);
}

.toolbar select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--white);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  font-size: 12px;
  cursor: pointer;
}

.pagination button:hover { border-color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Heatmap ── */
.heatmap-container { overflow-x: auto; }

.heatmap-grid {
  display: grid;
  gap: 2px;
  font-size: 11px;
}

.heatmap-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.heatmap-label {
  width: 160px;
  min-width: 160px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-light);
}

.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform .1s;
}

.heatmap-cell:hover { transform: scale(1.4); }
.heatmap-cell[title]::after { content: attr(title); }

/* ── Vital signs strip ── */
.vitals-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.vital {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.vital-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vital-info { flex: 1; }
.vital-label { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: .3px; }
.vital-value { font-size: 18px; font-weight: 700; }

/* ── Alerts card ── */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.alert-item:last-child { border-bottom: none; }
.alert-desc { font-size: 13px; }
.alert-evidence { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ── Charts ── */
.chart-container { width: 100%; min-height: 250px; }

/* ── Gantt timeline ── */
.gantt-container { position: relative; overflow-x: auto; min-height: 60px; padding: 10px 0; }

.gantt-bar {
  position: absolute;
  height: 20px;
  border-radius: 3px;
  opacity: .85;
  cursor: pointer;
  transition: opacity .15s;
  min-width: 4px;
}

.gantt-bar:hover { opacity: 1; box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* ── Two-column layout ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: toast-in .3s ease;
}

.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Global loader ── */
.global-loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease;
}

.global-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  max-width: 360px;
}

.loader-brand {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: .5px;
}

.loader-text {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}

.loader-subtext {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.5;
}

.loader-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loader-bar-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 1s ease;
}

.loader-progress {
  font-size: 12px;
  color: var(--text-light);
}

/* ── Loading spinner ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-light);
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

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

/* ── Risk distribution bar ── */
.risk-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 24px;
}

.risk-bar-segment { height: 100%; transition: width .3s; }

/* ── Tooltip ── */
.tooltip-wrapper { position: relative; }

.heatmap-tooltip {
  position: fixed;
  background: var(--primary);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  display: none;
}

/* ── Health breakdown ── */
.health-breakdown {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.health-gauge {
  width: 100px;
  text-align: center;
  flex-shrink: 0;
}

.health-gauge .score {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.health-components {
  flex: 1;
  min-width: 280px;
}

.health-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.health-row .label { width: 130px; color: var(--text-light); flex-shrink: 0; }
.health-row .weight { width: 40px; text-align: right; color: var(--text-light); font-size: 11px; flex-shrink: 0; }
.health-row .bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.health-row .bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s;
}
.health-row .val { width: 50px; text-align: right; font-weight: 600; flex-shrink: 0; }

/* ── Error profile ── */
.error-profile {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.error-profile-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.error-profile-pill.ep-high { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.error-profile-pill.ep-medium { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.error-profile-pill.ep-low { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: 12px;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Comment thread */
.comment-thread { display: flex; flex-direction: column; gap: 12px; }

.comment-item {
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid var(--border);
  font-size: 13px;
}

.comment-item .comment-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.comment-item .comment-text { line-height: 1.5; }

/* ── Tabs ── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.tab-btn:hover { color: var(--text); background: #f8fafc; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: #eef2ff; border-radius: 6px 6px 0 0; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── What's Wrong card ── */
.whats-wrong {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  background: var(--white);
}

.whats-wrong.risk-red { border-color: var(--danger); background: #fef2f2; }
.whats-wrong.risk-amber { border-color: var(--warning); background: #fffbeb; }
.whats-wrong.risk-green { border-color: var(--green); background: #f0fdf4; }

.whats-wrong-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.health-big {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.issue-list { display: flex; flex-direction: column; gap: 6px; }

.issue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
}

.issue-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.issue-icon.warn { background: #fef3c7; color: #92400e; }
.issue-icon.danger { background: #fee2e2; color: #dc2626; }
.issue-icon.ok { background: #d1fae5; color: #059669; }

/* ── AI panel ── */
.ai-content { font-size: 13px; line-height: 1.7; }
.ai-content h1, .ai-content h2, .ai-content h3 { margin: 16px 0 8px; color: var(--primary); }
.ai-content h2 { font-size: 16px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.ai-content h3 { font-size: 14px; }
.ai-content ul, .ai-content ol { margin: 8px 0; padding-left: 24px; }
.ai-content li { margin: 4px 0; }
.ai-content strong { color: var(--text); }
.ai-content code { background: #f1f5f9; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.ai-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.ai-content table th, .ai-content table td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; }
.ai-content table th { background: #f8fafc; font-weight: 600; }
.ai-meta { font-size: 11px; color: var(--text-light); margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ── Connector dots ── */
.conn-dots { display: inline-flex; gap: 3px; }
.conn-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  display: inline-block;
}
.conn-dot.available { background: var(--green); }
.conn-dot.charging { background: #2563eb; }
.conn-dot.preparing, .conn-dot.finishing { background: var(--warning); }
.conn-dot.faulted, .conn-dot.unavailable { background: var(--danger); }
.conn-dot.disconnected, .conn-dot.unknown { background: #d1d5db; }

/* ── Mobile menu toggle ── */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 201;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* Mobile-hidden columns — add to <th> and <td> to hide on mobile */
.mob-hide { }

/* Tablet (1024px) */
@media (max-width: 1024px) {
  .left-panel { width: 40%; padding: 32px; }
  .right-panel { width: 60%; }
}

/* Mobile (768px) */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left .3s ease;
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

  /* Main content */
  .main {
    margin-left: 0;
    padding: 60px 14px 14px;
    max-width: 100%;
  }

  /* Page header */
  .page-header {
    flex-direction: column;
    gap: 10px;
  }
  .page-header h1 { font-size: 18px; }
  .page-header .subtitle { font-size: 11px; }

  /* Date range — stack into rows */
  .date-range {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .date-range input[type="date"] {
    width: calc(50% - 16px);
    font-size: 12px;
    padding: 6px 8px;
  }
  .quick-btns { width: 100%; justify-content: flex-start; }
  .quick-btn { padding: 6px 10px; font-size: 11px; }

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

  /* Toolbar filters — stack */
  .toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .toolbar input[type="text"] { width: 100%; font-size: 13px; }
  .toolbar select { font-size: 11px; padding: 6px 8px; flex: 1; min-width: 80px; }

  /* Tables — hide non-essential columns on mobile */
  .mob-hide { display: none !important; }

  table { font-size: 11px; }
  thead th { font-size: 9px; padding: 6px 6px; white-space: nowrap; }
  tbody td { padding: 6px 6px; font-size: 11px; }

  /* Tabs */
  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    position: relative;
  }
  .tab-nav::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, var(--bg));
    pointer-events: none;
  }
  .tab-btn {
    padding: 10px 14px;
    font-size: 12px;
    min-height: 44px;
  }

  /* Vitals strip */
  .vitals-strip { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .vital { padding: 8px 10px; }
  .vital-label { font-size: 9px; }
  .vital-value { font-size: 14px; }

  /* Grid layouts */
  .grid-2 { grid-template-columns: 1fr; }

  /* What's Wrong card */
  .whats-wrong { padding: 14px; }
  .whats-wrong-header { gap: 10px; }
  .health-big { font-size: 28px; }
  .issue-item { font-size: 12px; }

  /* Cards */
  .card-header { font-size: 12px; flex-wrap: wrap; gap: 6px; padding: 10px 14px; }
  .card-body { padding: 12px; }
  .card-footer { padding: 8px 14px; font-size: 11px; }

  /* Pagination — larger touch targets */
  .pagination button {
    min-width: 36px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Risk bar */
  .risk-bar { height: 8px; }

  /* Badges */
  .badge { font-size: 10px; padding: 2px 6px; }

  /* Connector dots */
  .conn-dot { width: 12px; height: 12px; }

  /* Health breakdown */
  .health-breakdown { flex-direction: column; gap: 16px; }
  .health-gauge { display: flex; align-items: center; gap: 12px; }
  .health-gauge .score { font-size: 32px; }
  .health-row .label { width: 100px; font-size: 11px; }
  .health-row .weight { width: 30px; font-size: 10px; }

  /* Error profile pills */
  .error-profile { gap: 6px; }
  .error-profile-pill { padding: 4px 10px; font-size: 11px; }

  /* Modal */
  .modal { width: 95%; max-height: 90vh; }

  /* NR page */
  .conn-dots { gap: 2px; }
}

/* Very small screens (400px) */
@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr; }
  .vitals-strip { grid-template-columns: 1fr; }
  .date-range input[type="date"] { width: 100%; }
  .main { padding: 56px 10px 10px; }
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 13px;
}
