/* ═══════════════════════════════════════════════════════════════
   Prospilot Sync Dashboard v2 — Full CSS
   Brand charter: Questrial (headings) + Poppins (body)
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. CSS VARIABLES ─────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:   #FFFCF7;
  --bg-secondary: #F1EDE5;
  --bg-card:      #FBF7F1;
  --bg-accent:    #F5EADA;
  --bg-dark:      #241640;

  /* Borders */
  --border: #E1D6C6;

  /* Text */
  --text-primary:   #2C1F3D;
  --text-heading:   #241640;
  --text-secondary: #A19584;
  --text-muted:     #7E7174;

  /* Accents */
  --accent-orange:      #FF8E38;
  --accent-purple:      #8A38F5;
  --accent-purple-dark: #5847AC;

  /* Status */
  --success: #22C55E;
  --error:   #FF5053;
  --warning: #E8A838;

  /* Typography */
  --font-heading: 'Questrial', Arial, sans-serif;
  --font-body:    'Poppins', Arial, sans-serif;

  /* Shape */
  --radius:      12px;
  --radius-sm:    8px;
  --radius-pill: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(36,22,64,0.06);
  --shadow-md: 0 4px 12px rgba(36,22,64,0.08);
}

/* ── 2. RESET + BASE ──────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

/* ── 3. HEADER ────────────────────────────────────────────────── */
.header {
  background: var(--bg-dark);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  display: block;
  height: 32px;
  width: auto;
}

.header-title {
  font-family: var(--font-heading);
  font-size: 14px;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.production {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge.dry-run {
  background: rgba(255, 142, 56, 0.15);
  color: var(--accent-orange);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.header-countdown-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.header-countdown {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-orange);
}

/* ── 4. DIVIDER ───────────────────────────────────────────────── */
.divider {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-purple), var(--accent-orange));
  opacity: 0.7;
}

/* ── 5. HEALTH BANNER ─────────────────────────────────────────── */
.banner {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.banner.green {
  background: rgba(34, 197, 94, 0.07);
}

.banner.orange {
  background: rgba(255, 142, 56, 0.07);
}

.banner.red {
  background: rgba(255, 80, 83, 0.07);
}

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

.banner.green  .banner-dot { background: var(--success); }
.banner.orange .banner-dot { background: var(--accent-orange); }
.banner.red    .banner-dot { background: var(--error); }

.banner-title {
  font-size: 14px;
  font-weight: 500;
}

.banner-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── 6. KPI ROW ───────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}

.kpi-cell {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.kpi-cell:last-child {
  border-right: none;
}

.kpi-val {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--text-heading);
  display: block;
}

.kpi-val.green  { color: var(--success); }
.kpi-val.orange { color: var(--accent-orange); }
.kpi-val.red    { color: var(--error); }
.kpi-val.purple { color: var(--accent-purple-dark); }
.kpi-val.muted  { color: var(--text-muted); }

.kpi-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-top: 2px;
}

/* ── 7. TAB NAVIGATION ────────────────────────────────────────── */
.tab-nav {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.15s;
}

.tab.active {
  color: var(--accent-purple-dark);
  font-weight: 600;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-orange);
  border-radius: 1px 1px 0 0;
}

.tab:hover {
  color: var(--accent-purple-dark);
}

.tab-badge {
  font-size: 8px;
  background: var(--error);
  color: #ffffff;
  border-radius: 8px;
  padding: 1px 5px;
  margin-left: 4px;
  font-weight: 600;
}

/* ── 8. TAB CONTENT ───────────────────────────────────────────── */
.tab-content {
  min-height: 400px;
  background: var(--bg-primary);
  animation: fadeIn 0.15s ease;
}

/* ── 9. CLIENT TABLE ──────────────────────────────────────────── */
.client-table {
  width: 100%;
  border-collapse: collapse;
}

.client-table thead th {
  background: var(--bg-accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.client-table tbody td {
  padding: 9px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(225, 214, 198, 0.5);
}

.client-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.client-table tbody tr:hover {
  background: var(--bg-accent);
}

.client-table tbody tr.selected-row {
  background: var(--bg-accent);
  box-shadow: inset 3px 0 0 var(--accent-orange);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.dot.green  { background: var(--success); }
.dot.orange { background: var(--accent-orange); }
.dot.red    { background: var(--error); }
.dot.purple { background: var(--accent-purple-dark); }
.dot.muted  { background: var(--text-muted); }

.client-name {
  font-weight: 500;
  color: var(--text-heading);
}

.sync-bar {
  display: inline-block;
  width: 50px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}

.sync-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--success);
}

.freshness {
  font-size: 10px;
  color: var(--text-muted);
}

.freshness.stale {
  color: var(--error);
}

.stat-ok   { color: var(--success); font-weight: 500; }
.stat-warn { color: var(--warning); font-weight: 500; }
.stat-err  { color: var(--error);   font-weight: 500; }
.stat-muted { color: var(--text-muted); }

/* ── 10. SLIDE PANEL ──────────────────────────────────────────── */
.panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 440px;
  background: var(--bg-primary);
  box-shadow: -4px 0 24px rgba(36, 22, 64, 0.1);
  z-index: 100;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.panel.open {
  transform: translateX(0);
}

.panel.hidden {
  display: none;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 22, 64, 0.15);
  z-index: 99;
}

.panel-overlay.hidden {
  display: none;
}

.panel-header {
  background: var(--bg-dark);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-client-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-client-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.panel-client-name {
  font-family: var(--font-heading);
  font-size: 14px;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.panel-close {
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.15s;
}

.panel-close:hover {
  color: #ffffff;
}

.panel-meta {
  padding: 6px 18px 10px;
  background: var(--bg-dark);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.panel-meta a {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 500;
}

.panel-meta a:hover {
  text-decoration: underline;
}

.panel-divider {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-purple), var(--accent-orange));
  opacity: 0.7;
}

.panel-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}

.panel-kpi {
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.panel-kpi:last-child {
  border-right: none;
}

.panel-kpi-val {
  font-family: var(--font-heading);
  font-size: 18px;
  display: block;
  color: var(--text-heading);
}

.panel-kpi-lbl {
  font-size: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-top: 2px;
}

/* ── 11. ADVANCED KPIs ────────────────────────────────────────── */
.adv-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.adv-kpi {
  padding: 10px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.adv-kpi:last-child {
  border-right: none;
}

.adv-kpi-val {
  font-family: var(--font-heading);
  font-size: 16px;
  display: block;
  color: var(--text-heading);
}

.adv-kpi-lbl {
  font-size: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

.adv-kpi-trend {
  font-size: 9px;
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

.trend-up   { color: var(--success); }
.trend-down { color: var(--error); }
.trend-flat { color: var(--text-muted); }

/* ── 12. DIRECTION BAR ────────────────────────────────────────── */
.direction-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 14px;
  background: var(--border);
}

.dir-central {
  background: var(--accent-purple-dark);
  height: 100%;
}

.dir-unitaire {
  background: var(--accent-orange);
  height: 100%;
}

.direction-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 14px 8px;
  font-size: 8px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

/* ── 13. PANEL TABS ───────────────────────────────────────────── */
.panel-tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.panel-tab {
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
  transition: color 0.15s;
  font-family: var(--font-body);
}

.panel-tab.active {
  color: var(--accent-purple-dark);
  border-bottom: 2px solid var(--accent-orange);
}

.panel-tab:hover {
  color: var(--accent-purple-dark);
}

.panel-tab .tab-badge {
  font-size: 7px;
  padding: 1px 4px;
}

/* ── 14. ACTIVITY ITEMS ───────────────────────────────────────── */
.act-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(225, 214, 198, 0.4);
  font-size: 11px;
  transition: background 0.12s;
}

.act-item:hover {
  background: var(--bg-accent);
}

.act-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.act-body {
  flex: 1;
  line-height: 1.4;
}

.act-action {
  font-weight: 500;
}

.act-detail {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

.act-error {
  font-size: 10px;
  color: var(--error);
  font-weight: 500;
  display: block;
  margin-top: 1px;
}

.act-time {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.act-direction {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.dir-c2u {
  background: rgba(88, 71, 172, 0.1);
  color: var(--accent-purple-dark);
}

.dir-u2c {
  background: rgba(255, 142, 56, 0.1);
  color: var(--accent-orange);
}

.act-clickable {
  font-size: 10px;
  color: var(--accent-purple);
  cursor: pointer;
  text-decoration: none;
}

.act-clickable:hover {
  text-decoration: underline;
}

/* ── 15. CONTROLS & FILTERS ───────────────────────────────────── */
.controls {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-card);
}

.pill {
  font-size: 10px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: var(--font-body);
}

.pill:hover {
  border-color: var(--accent-purple);
}

.pill.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.filter-select {
  font-size: 11px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-primary);
  outline: none;
}

.filter-select:focus {
  border-color: var(--accent-purple);
}

.filter-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-toggle {
  font-size: 10px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.filter-toggle input {
  accent-color: var(--accent-purple);
  cursor: pointer;
}

.spacer {
  flex: 1;
}

/* ── 16. SUMMARY KPI ROW ──────────────────────────────────────── */
.summary-kpis {
  display: grid;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.summary-kpi {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.summary-kpi:last-child {
  border-right: none;
}

.kpi-trend {
  display: block;
  font-size: 9px;
  font-weight: 600;
  margin-top: 2px;
}

.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--error); }
.kpi-trend.flat { color: var(--text-muted); }

/* ── 17. ANOMALIES TAB ────────────────────────────────────────── */
.anom-summary {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

.anom-item {
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

.anom-item:last-child {
  border-right: none;
}

.anom-item:hover {
  background: var(--bg-accent);
}

.anom-item.active {
  background: var(--bg-accent);
  box-shadow: inset 0 -2px 0 var(--accent-orange);
}

.anom-val {
  font-family: var(--font-heading);
  font-size: 20px;
  display: block;
  color: var(--text-heading);
}

.anom-val.zero  { color: var(--text-muted); }
.anom-val.alert { color: var(--error); }
.anom-val.warn  { color: var(--warning); }

.anom-lbl {
  font-size: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-top: 2px;
}

.anom-batch {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-wrap: wrap;
}

.anom-btn {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: border-color 0.15s;
}

.anom-btn:hover {
  border-color: var(--accent-purple);
}

.anom-btn.danger {
  border-color: var(--error);
  color: var(--error);
}

.anom-btn.danger:hover {
  background: rgba(255, 80, 83, 0.05);
}

.anom-table {
  width: 100%;
  border-collapse: collapse;
}

.anom-table thead th {
  background: var(--bg-accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.anom-table tbody td {
  padding: 9px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(225, 214, 198, 0.5);
}

.anom-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.anom-table tbody tr:hover {
  background: var(--bg-accent);
}

/* ── 18. ANALYTICS CHARTS ─────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.chart-cell {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.chart-cell:nth-child(even) {
  border-right: none;
}

.chart-cell.full-width {
  grid-column: 1 / -1;
  border-right: none;
}

.chart-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.chart-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 10px;
  background: var(--accent-orange);
  border-radius: 1px;
  flex-shrink: 0;
}

.chart-subtitle {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── 19. HEATMAP ──────────────────────────────────────────────── */
.heatmap {
  display: grid;
  gap: 2px;
  font-size: 9px;
}

.hm-header {
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 3px;
}

.hm-client {
  font-weight: 500;
  color: var(--text-heading);
  padding: 3px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-cell {
  border-radius: 3px;
  padding: 3px;
  text-align: center;
  font-size: 8px;
}

.hm-0 { background: var(--bg-card); color: var(--text-muted); }
.hm-1 { background: rgba(34, 197, 94, 0.10); color: var(--success); }
.hm-2 { background: rgba(34, 197, 94, 0.20); color: var(--success); }
.hm-3 { background: rgba(34, 197, 94, 0.35); color: #15803d; }
.hm-4 { background: rgba(34, 197, 94, 0.50); color: #15803d; font-weight: 600; }

/* ── 20. COMPARATIVE TABLE / DATA TABLE ───────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  background: var(--bg-accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 9px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(225, 214, 198, 0.5);
}

.data-table tbody tr {
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: var(--bg-accent);
}

.sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 16px;
  vertical-align: middle;
}

.spark-bar {
  width: 3px;
  border-radius: 1px 1px 0 0;
  background: var(--accent-purple-dark);
}

/* ── 21. SYSTEM TAB ───────────────────────────────────────────── */
.sys-status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}

.sys-card {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.sys-card:last-child {
  border-right: none;
}

.sys-card-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.sys-card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 10px;
  background: var(--accent-orange);
  border-radius: 1px;
  flex-shrink: 0;
}

.sys-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.sys-badge.ok   { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.sys-badge.warn { background: rgba(232, 168, 56, 0.12); color: var(--warning); }
.sys-badge.err  { background: rgba(255, 80, 83, 0.12); color: var(--error); }

.sys-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 0;
}

.sys-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 11px;
}

.sys-label {
  color: var(--text-secondary);
}

.sys-val {
  font-weight: 500;
  color: var(--text-heading);
}

.sys-val.ok   { color: var(--success); }
.sys-val.warn { color: var(--warning); }
.sys-val.err  { color: var(--error); }

.pool-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border);
  margin: 6px 0;
}

.pool-used {
  background: var(--accent-purple-dark);
  height: 100%;
}

.pool-free {
  background: var(--success);
  opacity: 0.4;
  height: 100%;
}

.job-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(225, 214, 198, 0.4);
}

.job-item:last-child {
  border-bottom: none;
}

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

.job-info {
  flex: 1;
}

.job-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-heading);
}

.job-detail {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

.job-countdown {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--accent-orange);
  flex-shrink: 0;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 20px;
}

.config-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.config-val {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--text-heading);
  display: block;
}

.config-lbl {
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-top: 2px;
}

/* ── 22. HEALTH TIMELINE ──────────────────────────────────────── */
.health-timeline {
  display: flex;
  gap: 2px;
  padding: 0 20px 12px;
  align-items: flex-end;
  height: 30px;
}

.ht-bar {
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  flex: 1;
  transition: opacity 0.15s;
}

.ht-bar:hover {
  opacity: 0.8;
}

.ht-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 20px 8px;
  font-size: 7px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

/* ── 23. SECTION TITLES ───────────────────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 20px 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--accent-orange);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── 24. UTILITIES ────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.more-link {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: 12px;
  color: var(--accent-purple);
  border-top: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}

.more-link:hover {
  background: var(--bg-accent);
}

.alert-block {
  margin: 12px 16px;
  background: rgba(255, 80, 83, 0.06);
  border: 1px solid rgba(255, 80, 83, 0.15);
  border-left: 3px solid var(--error);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
}

.alert-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--error);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.alert-detail {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}

.alert-action {
  font-size: 11px;
  color: var(--accent-purple);
  margin-top: 6px;
  cursor: pointer;
  display: inline-block;
}

.alert-action:hover {
  text-decoration: underline;
}

/* Tooltip */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  font-weight: 400;
}

.tooltip:hover::after {
  opacity: 1;
}

/* ── 25. ANIMATIONS ───────────────────────────────────────────── */
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideOut {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-accent) 50%,
    var(--bg-card) 75%
  );
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ── 26. FOOTER ───────────────────────────────────────────────── */
.footer {
  background: var(--bg-dark);
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.footer-text {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}

/* ── 27. SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ── 28. RESPONSIVE HELPERS ───────────────────────────────────── */
@media (max-width: 1024px) {
  .panel {
    width: 380px;
  }

  .anom-summary {
    grid-template-columns: repeat(4, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-cell {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-cell:nth-child(2) {
    border-right: none;
  }

  .panel {
    width: 100%;
  }

  .sys-status-row {
    grid-template-columns: 1fr;
  }

  .sys-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .config-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── HEADER HELP BUTTON ───────────────────────────────────────── */
.header-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  flex-shrink: 0;
}

.header-help:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ── ANOMALY INFO ICON ────────────────────────────────────────── */
.anom-info {
  font-size: 7px;
  opacity: 0.5;
  vertical-align: super;
  cursor: help;
}

/* ── HELP PAGE ────────────────────────────────────────────────── */
.help-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}

.help-content h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.help-content .help-intro {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.help-content h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--text-heading);
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.help-content h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--accent-purple-dark);
  margin: 24px 0 8px;
}

.help-content p {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.help-content ul {
  margin: 8px 0 14px 20px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.7;
}

.help-content li {
  margin-bottom: 5px;
}

.help-content strong {
  color: var(--text-heading);
  font-weight: 600;
}

.help-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.help-section + .help-section {
  margin-top: 0;
}

.help-anom-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}

.help-anom-card:last-child {
  margin-bottom: 0;
}

.help-anom-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.help-anom-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.help-anom-tag.purple { background: rgba(88,71,172,0.1); color: var(--accent-purple-dark); }
.help-anom-tag.red    { background: rgba(255,80,83,0.1); color: var(--error); }
.help-anom-tag.orange { background: rgba(255,142,56,0.1); color: var(--accent-orange); }
.help-anom-tag.yellow { background: rgba(232,168,56,0.1); color: var(--warning); }
.help-anom-tag.muted  { background: rgba(0,0,0,0.05); color: var(--text-muted); }

.help-anom-desc {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.6;
}

.help-glossary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 12px;
}

.help-glossary-table th {
  background: var(--bg-accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 12px;
  text-align: left;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.help-glossary-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(225, 214, 198, 0.4);
  vertical-align: top;
  line-height: 1.5;
}

.help-glossary-table td:first-child {
  font-weight: 600;
  color: var(--accent-purple-dark);
  white-space: nowrap;
  width: 220px;
}

.help-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.help-kpi-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}

.help-kpi-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.help-kpi-val {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: bold;
}

.help-kpi-val.green  { color: var(--success); }
.help-kpi-val.orange { color: var(--accent-orange); }
.help-kpi-val.red    { color: var(--error); }
.help-kpi-val.purple { color: var(--accent-purple-dark); }

.help-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}

.help-dot.green  { background: var(--success); }
.help-dot.orange { background: var(--accent-orange); }
.help-dot.red    { background: var(--error); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover {
  color: #fff;
}
