/* ==========================================================================
   PlantPulse - Industrial Telemetry & Reliability Intelligence
   Design System: Parclgo / Linear / Stripe Ultra-Clean SaaS Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Core Brand Colors (PlantPulse Clean White & Orange Theme) */
  --brand-primary: #EA580C;        /* Vibrant Safety Orange */
  --brand-accent: #EA580C;         /* Vibrant Orange CTA accent */
  --brand-accent-hover: #C2410C;
  --brand-accent-light: #FFF7ED;   /* Soft warm orange background */
  --brand-accent-border: #FDBA74;

  /* Surfaces & Canvas */
  --bg-page: #F8FAFC;              /* Clean soft off-white background */
  --bg-card: #FFFFFF;              /* Crisp pure white cards */
  --bg-sidebar: #FFFFFF;           /* Crisp modern light sidebar */
  --bg-topbar: #FFFFFF;            /* Pure white sticky topbar */
  --bg-muted: #F1F5F9;             /* Soft neutral pill background */
  --bg-subtle: #F8FAFC;            /* Subtle table header & input background */
  --bg-hover: #FFF7ED;             /* Warm soft hover tint */

  /* Typography */
  --text-main: #1E293B;            /* High-contrast slate charcoal */
  --text-body: #334155;            /* Crisp readable body */
  --text-muted: #64748B;           /* Secondary labels & breadcrumbs */
  --text-light: #94A3B8;           /* Subtle placeholders */
  --text-inverse: #FFFFFF;

  /* Borders & Dividers */
  --border-light: #ECEEF2;         /* Ultra-clean subtle hairline border */
  --border-medium: #CBD5E1;
  --border-focus: #EA580C;

  /* Status Colors & Soft Pills (Parclgo style) */
  --status-delivered: #10B981;
  --status-delivered-bg: #ECFDF5;
  --status-delivered-text: #047857;

  --status-transit: #3B82F6;
  --status-transit-bg: #EFF6FF;
  --status-transit-text: #1D4ED8;

  --status-pending: #F59E0B;
  --status-pending-bg: #FFFBEB;
  --status-pending-text: #B45309;

  --status-failed: #EF4444;
  --status-failed-bg: #FEF2F2;
  --status-failed-text: #B91C1C;

  /* Severity System */
  --sev-critical: #EF4444;
  --sev-critical-bg: #FEF2F2;
  --sev-critical-text: #B91C1C;

  --sev-high: #F97316;
  --sev-high-bg: #FFF7ED;
  --sev-high-text: #C2410C;

  --sev-medium: #F59E0B;
  --sev-medium-bg: #FFFBEB;
  --sev-medium-text: #B45309;

  --sev-low: #10B981;
  --sev-low-bg: #ECFDF5;
  --sev-low-text: #047857;

  /* Soft Ambient Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);

  /* Border Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Fonts & Layout Metrics */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* ---- Legacy alias tokens referenced by inline markup ---- */
  --primary-navy: #EA580C;
  --accent-blue: #EA580C;

  /* ---- Functional palette (shared by banners, tiles, RAG chips) ---- */
  --c-green: #059669;   --c-green-bg: #ECFDF5;   --c-green-tx: #047857;
  --c-blue:  #2563EB;   --c-blue-bg: #EFF6FF;     --c-blue-tx: #1D4E8C;
  --c-amber: #D97706;   --c-amber-bg: #FEF3C7;    --c-amber-tx: #B45309;
  --c-red:   #DC2626;   --c-red-bg: #FEF2F2;     --c-red-tx:  #B91C1C;
}

body.dark-mode {
  --c-green: #34D399;   --c-green-bg: rgba(16,185,129,.14);  --c-green-tx: #34D399;
  --c-blue:  #60A5FA;   --c-blue-bg: rgba(59,130,246,.14);   --c-blue-tx: #60A5FA;
  --c-amber: #FBBF24;   --c-amber-bg: rgba(245,158,11,.14);  --c-amber-tx: #FBBF24;
  --c-red:   #F87171;   --c-red-bg: rgba(239,68,68,.14);     --c-red-tx: #F87171;
  --bg-page: #0B0F19;
  --bg-card: #131B2E;
  --bg-sidebar: #0E1422;
  --bg-topbar: #131B2E;
  --bg-muted: #1E293B;
  --bg-subtle: #1E293B;
  --bg-hover: #26334D;

  --text-main: #F8FAFC;
  --text-body: #CBD5E1;
  --text-muted: #94A3B8;
  --text-light: #64748B;

  --border-light: #1E293B;
  --border-medium: #334155;

  --status-delivered-bg: rgba(16, 185, 129, 0.15);
  --status-delivered-text: #34D399;

  --status-transit-bg: rgba(59, 130, 246, 0.15);
  --status-transit-text: #60A5FA;

  --status-pending-bg: rgba(245, 158, 11, 0.15);
  --status-pending-text: #FBBF24;

  --status-failed-bg: rgba(239, 68, 68, 0.15);
  --status-failed-text: #F87171;

  --sev-critical-bg: rgba(239, 68, 68, 0.2);
  --sev-high-bg: rgba(249, 115, 22, 0.2);
  --sev-medium-bg: rgba(245, 158, 11, 0.2);
  --sev-low-bg: rgba(16, 185, 129, 0.2);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

#app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   Sidebar Navigation (Parclgo White & Sleek Dark Pill Style)
   ========================================================================== */
aside.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 16px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 20px 6px;
  border-bottom: 1px solid var(--border-light);
}

.logo-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #EA580C, #F97316);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(234, 88, 12, 0.35);
  flex-shrink: 0;
}

.logo-badge i, .logo-badge svg {
  width: 20px;
  height: 20px;
  color: #FFFFFF;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-section-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  padding: 6px 14px 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
}

.nav-item i, .nav-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color 0.18s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background: #FFF7ED;
  color: #EA580C;
  transform: translateX(2px);
}

.nav-item:hover i, .nav-item:hover svg {
  color: #EA580C;
}

/* Active Nav State - Vibrant Orange Pill (No Black!) */
.nav-item.active {
  background: linear-gradient(135deg, #EA580C 0%, #F97316 100%) !important;
  color: #FFFFFF !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.28);
}

.nav-item.active i, .nav-item.active svg {
  color: #FFFFFF !important;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-muted);
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.nav-badge.danger {
  background: var(--status-failed-bg);
  color: var(--status-failed-text);
}

.nav-badge.warning {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
}

/* Sidebar Bottom Promo Card (Parclgo Widget) */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.plant-meta-pill {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border: 1px solid #FED7AA;
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(255, 87, 34, 0.06);
}

body.dark-mode .plant-meta-pill {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.1), rgba(15, 23, 42, 0.4));
  border-color: rgba(255, 87, 34, 0.2);
}

.plant-meta-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plant-meta-icon {
  width: 32px;
  height: 32px;
  background: #FF5722;
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plant-meta-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.plant-meta-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.plant-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #047857;
  background: #ECFDF5;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
main.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background: var(--bg-page);
}

/* ==========================================================================
   Topbar Header (Clean, Pill-Styled, Parclgo Architecture)
   ========================================================================== */
header.topbar {
  min-height: 72px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 10px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-xs);
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 220px;
}

.topbar-heading { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.page-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1.15;
}

.page-subtitle {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-sep {
  width: 1px;
  height: 34px;
  background: var(--border-light);
  flex-shrink: 0;
}

/* Pill Filter Selectors — secondary, compact so they don't compete with the title */
.date-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  flex-shrink: 1;
  min-width: 0;
}

.date-filter-group:hover, .date-filter-group:focus-within {
  border-color: var(--brand-accent);
  background: var(--bg-hover);
  box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.08);
}

.filter-select, .as-of-input {
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-body);
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
  font-family: inherit;
  min-width: 0;
}
.filter-select { max-width: 220px; }
.as-of-input { max-width: 130px; }

/* Topbar Right Controls */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-left: auto;
  min-width: 0;
}

/* Group the small utility icon buttons together */
.topbar-icon-group { display: flex; align-items: center; gap: 6px; }
.topbar-divider { width: 1px; height: 30px; background: var(--border-light); flex-shrink: 0; }

/* Modern Pill Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn i, .btn svg {
  width: 15px;
  height: 15px;
}

/* Vibrant Orange CTA Button */
.btn-primary {
  background: linear-gradient(135deg, #EA580C 0%, #F97316 100%) !important;
  color: #FFFFFF !important;
  border-color: #EA580C !important;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.btn-primary:hover {
  background: #C2410C !important;
  border-color: #C2410C !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

/* White & Orange Accent Button */
.btn-accent {
  background: #FFF7ED;
  color: #EA580C;
  border-color: #FDBA74;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.08);
}

.btn-accent:hover {
  background: #FFEDD5;
  color: #C2410C;
  border-color: #FB923C;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.16);
}

/* Clean Outline Pill Button */
.btn-outline {
  background: var(--bg-card);
  color: var(--text-body);
  border-color: var(--border-light);
}

.btn-outline:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-icon i, .btn-icon svg {
  width: 17px;
  height: 17px;
}

/* User Profile & Demo Role Switcher Pill */
.user-profile-widget {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 5px 4px 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  transition: border-color 0.18s, box-shadow 0.18s;
  flex-shrink: 0;
}

.user-profile-widget:hover { border-color: var(--border-medium); box-shadow: var(--shadow-xs); }

.user-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-primary), #1E293B);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.76rem; box-shadow: 0 1px 3px rgba(0,0,0,.14); flex-shrink: 0;
}

.user-meta { line-height: 1.25; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.user-meta #topbar-user-name { font-size: 0.82rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.user-meta #topbar-user-role { font-size: 0.66rem; color: var(--c-blue-tx); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; letter-spacing: 0.01em; }

.logout-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-muted);
  border-radius: var(--radius-full); cursor: pointer; transition: all 0.16s; flex-shrink: 0;
}
.logout-btn:hover { background: var(--c-red-bg); color: var(--c-red-tx); border-color: rgba(220,38,38,.25); }
.logout-btn i, .logout-btn svg { width: 16px; height: 16px; }

/* Ghost button (subtle secondary action, no fill) */
.btn-ghost {
  background: transparent; color: var(--text-body); border-color: var(--border-light);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-main); border-color: var(--border-medium); }

/* Role switcher removed from topbar (switch roles via logout → login) */

/* ==========================================================================
   Page Views & Container Styling
   ========================================================================== */
.page-view {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.page-view.active {
  display: flex;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Cards & Content Modules (Ultra-Clean White with Subtle Borders)
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(203, 213, 225, 0.8);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   KPI Summary Metric Cards (Exact Parclgo Header Row Pattern)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.kpi-card:hover::before {
  background: var(--brand-accent);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Parclgo Rounded Icon Badge */
.kpi-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.kpi-icon-badge i, .kpi-icon-badge svg {
  width: 20px;
  height: 20px;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

/* Parclgo Trend Pill */
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.kpi-trend.positive {
  background: var(--status-delivered-bg);
  color: var(--status-delivered-text);
}

.kpi-trend.negative {
  background: var(--status-failed-bg);
  color: var(--status-failed-text);
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* ==========================================================================
   Segmented Tab Switchers (Parclgo iOS/macOS Control Style)
   ========================================================================== */
.segmented-tab-bar, #capture-tab-bar, #reports-tab-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 4px;
  overflow-x: auto;
  max-width: 100%;
}

.segmented-tab-bar .btn, #capture-tab-bar .btn, #reports-tab-bar .btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
  box-shadow: none;
}

.segmented-tab-bar .btn:hover, #capture-tab-bar .btn:hover, #reports-tab-bar .btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.segmented-tab-bar .btn.btn-primary, #capture-tab-bar .btn.btn-primary, #reports-tab-bar .btn.btn-primary {
  background: linear-gradient(135deg, #EA580C, #F97316) !important;
  border-color: #EA580C !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

/* ==========================================================================
   Controlled Forms & Shop Floor Data Capture (Parclgo Clean Inputs)
   ========================================================================== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .req {
  color: var(--sev-critical);
  font-weight: 700;
}

.form-control, input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.18s ease;
  outline: none;
}

.form-control:hover, input:hover, select:hover, textarea:hover {
  border-color: var(--border-medium);
}

.form-control:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.12);
  background: #FFFFFF;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* Form Action Buttons Bar */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  margin-top: 16px;
}

/* Draft Autosave Pill */
.draft-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #B45309;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Data Tables (Parclgo / Stripe Soft Table Architecture)
   ========================================================================== */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

table.data-table, .styled-table, .table-container table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 640px;
}

table.data-table th, .styled-table th, .table-container th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

table.data-table td, .styled-table td, .table-container td {
  padding: 13px 16px;
  font-size: 0.86rem;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

table.data-table tbody tr:last-child td, .styled-table tbody tr:last-child td,
.table-container tbody tr:last-child td {
  border-bottom: none;
}

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

/* ==========================================================================
   Status Badges & Chips (Parclgo Soft Pill Styles with Dots)
   ========================================================================== */
.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  width: fit-content;
}

.badge::before, .status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-critical, .badge-failed {
  background: var(--status-failed-bg);
  color: var(--status-failed-text);
}

.badge-high {
  background: var(--sev-high-bg);
  color: var(--sev-high-text);
}

.badge-medium, .badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.badge-low, .badge-delivered, .badge-closed {
  background: var(--status-delivered-bg);
  color: var(--status-delivered-text);
}

.badge-progress, .badge-transit {
  background: var(--status-transit-bg);
  color: var(--status-transit-text);
}

/* ==========================================================================
   Kanban Board (Pending Works View)
   ========================================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-col {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 480px;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.kanban-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  transition: all 0.18s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

/* ==========================================================================
   Slide-Over Evidence Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -540px;
  width: 500px;
  max-width: 92vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  z-index: 99995;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   Modals & Overlays (Share, Bulk Upload, Sign-Off)
   ========================================================================== */
.modal-backdrop, .drawer-backdrop, #share-modal-backdrop {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(5px) !important;
  z-index: 99990 !important;
}

.modal-backdrop.open, .drawer-backdrop.open, #share-modal-backdrop.open {
  display: block !important;
}

.modal {
  display: none !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: #FFFFFF !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  z-index: 99999 !important;
  max-width: 560px !important;
  width: 92% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  padding: 24px !important;
}

body.dark-mode .modal {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

.modal.open {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes modalPop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--border-light) !important;
}

.modal-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

/* ==========================================================================
   Demo Mode Controller (Fixed Overlay - Never In-Flow)
   ========================================================================== */
.demo-controller {
  display: none !important;
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  background: #FFFFFF !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  padding: 18px 20px !important;
  z-index: 99999 !important;
  max-width: 440px !important;
  width: calc(100% - 48px) !important;
  flex-direction: column !important;
  gap: 12px !important;
}

body.dark-mode .demo-controller {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

.demo-controller.active {
  display: flex !important;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

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

.demo-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.demo-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #FFF7ED !important;
  color: #C2410C !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: var(--radius-full) !important;
}

.demo-step-num {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
}

.demo-title {
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  margin-bottom: 4px !important;
}

.demo-caption {
  font-size: 0.82rem !important;
  color: var(--text-body) !important;
  line-height: 1.45 !important;
}

.demo-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid var(--border-light) !important;
}

/* ==========================================================================
   Database Traceability Tooltip
   ========================================================================== */
[data-source] {
  position: relative;
}

[data-source]:hover::after {
  content: attr(data-source);
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-primary);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Responsive Adaptations: Desktop, Tablet & Mobile
   ========================================================================== */
@media (max-width: 1280px) {
  .topbar-right .btn .btn-text {
    display: none;
  }
  .topbar-right .btn {
    padding: 8px 10px;
  }
  .user-meta #topbar-user-name { display: none; }  /* keep avatar + logout compact, drop the name */
}

@media (max-width: 1024px) {
  aside.sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
  }
  aside.sidebar.mobile-open { transform: translateX(0); }
  .mobile-only { display: flex !important; }
  main.main-content { margin-left: 0 !important; width: 100%; max-width: 100%; overflow-x: hidden; }
  header.topbar { padding: 10px 16px; }
  .page-view { padding: 16px; gap: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-container { height: 280px; }
}

/* ---- Tablet (<= 768px): stack topbar into usable rows ---- */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  header.topbar { flex-wrap: wrap; }
  .topbar-left { flex: 1 1 auto; width: auto; gap: 8px; }
  .topbar-right { flex: 1 1 100%; width: 100%; justify-content: flex-end; margin-top: 8px; }
  .date-filter-group { padding: 5px 10px; }
  .date-filter-group .as-of-input { max-width: 118px; }
  /* Trello board: 2 columns on phones / small tablets */
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Phone (<= 640px): compact, thumb-friendly topbar & content ---- */
@media (max-width: 640px) {
  header.topbar { padding: 8px 12px; gap: 8px; }
  .topbar-left { width: 100%; }
  .topbar-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .page-title { font-size: 1rem; }

  /* Compact the two date filter pills on phones */
  .date-filter-group { padding: 4px 10px; }
  .date-filter-group span { display: none; }       /* hide "Period:" / "As of:" labels */
  .filter-select { font-size: 0.78rem; }

  .kpi-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .kanban-col { min-height: 200px; }

  .card { padding: 16px; }
  .page-view { padding: 12px; gap: 14px; }

  .modal-content { padding: 20px 16px; }
  .modal { width: 94%; }
  .drawer { width: 100vw; max-width: 100vw; }

  /* Tables: let them scroll horizontally without breaking the page width */
  .table-container { overflow-x: auto; }
  .table-container table { min-width: 680px; }

  .demo-controller { position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

@media (max-width: 420px) {
  html { font-size: 13px; }
  .kpi-value { font-size: 1.5rem; }
  .topbar-right .btn-icon { width: 34px; height: 34px; }
  .topbar-right .user-profile-widget { padding: 3px 8px 3px 3px; }
}

/* Utilities for Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

/* Enhanced Input & Select Controls */
.search-input, .filter-select {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.18s ease;
  outline: none;
  width: 100%;
}

.search-input:hover, .filter-select:hover {
  border-color: var(--border-medium);
}

.search-input:focus, .filter-select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.12);
}

/* Specific Badges */
.badge-hypothesis {
  background: #EFF6FF !important;
  color: #2563EB !important;
  border: 1px solid #BFDBFE !important;
}

.badge-estimate {
  background: #FFFBEB !important;
  color: #D97706 !important;
  border: 1px solid #FDE68A !important;
}

.badge-verified {
  background: #ECFDF5 !important;
  color: #059669 !important;
  border: 1px solid #A7F3D0 !important;
}

.source-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

/* Table Pagination Bar (Parclgo Style) */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.84rem;
  color: var(--text-muted);
  background: var(--bg-card);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pagination-pill {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-body);
  border: 1px solid var(--border-light);
  cursor: pointer;
  background: var(--bg-card);
  transition: all 0.15s;
}

.pagination-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.pagination-pill.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

/* ==========================================================================
   COMPONENT COMPLETION LAYER
   (adds the component classes the HTML & JS render but that were missing,
    closing the gap between the markup and the design system)
   ========================================================================== */

/* ---- KPI icon tile & sub-text ---- */
.kpi-icon, .kpi-icon-badge {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15,23,42,.08);
}
.kpi-icon i, .kpi-icon svg, .kpi-icon-badge i, .kpi-icon-badge svg { width: 20px; height: 20px; }
.kpi-subtext { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Status banners ---- */
.danger-banner, .warning-banner, .info-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius-lg);
  border: 1px solid; box-shadow: var(--shadow-xs);
}
.danger-banner i, .warning-banner i, .info-banner i { width: 24px; height: 24px; flex-shrink: 0; margin-top: 1px; }
.danger-banner { background: var(--c-red-bg); border-color: rgba(220,38,38,.25); color: var(--c-red-tx); }
.warning-banner { background: var(--c-amber-bg); border-color: rgba(217,119,6,.25); color: var(--c-amber-tx); }
.info-banner { background: var(--c-blue-bg); border-color: rgba(37,99,235,.22); color: var(--c-blue-tx); }
.danger-banner div, .warning-banner div, .info-banner div { min-width: 0; }

/* ---- Form controls (class-based) ---- */
.form-select, .form-input, .form-textarea {
  background: var(--bg-card); border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md); padding: 10px 13px; font-size: 0.86rem;
  color: var(--text-main); font-family: inherit; transition: all 0.16s ease; outline: none; width: 100%;
}
.form-select:hover, .form-input:hover, .form-textarea:hover { border-color: var(--border-medium); }
.form-select:focus, .form-input:focus, .form-textarea:focus { border-color: var(--brand-accent); box-shadow: var(--ring-focus, 0 0 0 3px rgba(255,87,34,.12)); }
.form-textarea { min-height: 80px; resize: vertical; }
select.form-select { cursor: pointer; }

/* Filter chip (toggleable) */
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600;
  padding: 6px 12px; border-radius: var(--radius-full); border: 1px solid var(--border-light);
  background: var(--bg-card); color: var(--text-body); cursor: pointer; transition: all 0.16s;
}
.filter-chip:hover { background: var(--bg-hover); border-color: var(--border-medium); }
.filter-chip.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); box-shadow: var(--shadow-xs); }

/* ---- RAG chips ---- */
.rag-chip { display: inline-block; padding: 2px 7px; border-radius: var(--radius-full); font-weight: 800; }
.rag-chip-green { background: var(--c-green-bg); color: var(--c-green-tx); }
.rag-chip-amber { background: var(--c-amber-bg); color: var(--c-amber-tx); }
.rag-chip-red { background: var(--c-red-bg); color: var(--c-red-tx); }

/* ---- SLA badge ---- */
.sla-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700;
  padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--c-blue-bg); color: var(--c-blue-tx); border: 1px solid rgba(37,99,235,.22);
}
.sla-badge i { width: 14px; height: 14px; }

/* ---- Availability tiles ---- */
.avail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.avail-tile {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: 14px; border-left: 4px solid var(--c-green); transition: all 0.18s;
}
.avail-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.avail-tile.tile-good { border-left-color: var(--c-green); }
.avail-tile.tile-warn { border-left-color: var(--c-amber); background: var(--c-amber-bg); }
.avail-tile.tile-bad { border-left-color: var(--c-red); background: var(--c-red-bg); }
.avail-name { font-size: 0.82rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avail-pct { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-main); line-height: 1; }
.avail-days { font-size: 0.74rem; color: var(--text-muted); margin-top: 6px; }

/* ---- Checklist ---- */
.checklist { display: flex; flex-direction: column; gap: 12px; }
.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 14px 16px; transition: border-color 0.16s;
}
.check-item:hover { border-color: var(--border-medium); }
.check-icon { width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check-icon i, .check-icon svg { width: 17px; height: 17px; }
.check-content { flex: 1; min-width: 0; }
.check-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 0.9rem; color: var(--text-main); }
.check-desc { font-size: 0.82rem; color: var(--text-body); margin-top: 4px; }
.check-fix { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; font-style: italic; }

/* ---- Kanban card fields ---- */
.kanban-card-title { font-size: 0.84rem; font-weight: 600; color: var(--text-main); line-height: 1.4; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-size: 0.74rem; color: var(--text-muted); }

/* ---- Drawer section bits ---- */
.drawer-section { display: flex; flex-direction: column; gap: 8px; }
.drawer-section-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.drawer-text { font-size: 0.9rem; color: var(--text-body); line-height: 1.6; }
.drawer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--border-light); background: var(--bg-subtle); }

/* ---- Table row states ---- */
tr.clickable { cursor: pointer; }
.preview-pass td { background: var(--c-green-bg); }
.preview-fail td { background: var(--c-red-bg); }

/* ---- Toasts ---- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  background: var(--brand-primary); color: #fff; padding: 13px 18px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px; animation: toastIn 0.28s cubic-bezier(0.16,1,0.3,1);
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-accent); flex-shrink: 0; }
.toast.success::before { background: #10B981; }
.toast.error::before { background: #EF4444; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---- 5-column grid ---- */
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }

/* ---- Login / sign-in gate (stunning themed glass card) ---- */
/* ---- Login gate · professional split-screen layout ---- */
.login-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(255,87,34,.20), transparent 55%),
    radial-gradient(760px 560px at 0% 108%, rgba(37,99,235,.22), transparent 55%),
    linear-gradient(150deg, #0d1524 0%, #0a0f1a 60%, #0b1020 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto; animation: fadeIn .3s ease;
}
.login-split {
  position: relative; z-index: 1;
  width: 100%; max-width: 1080px; min-height: 620px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 40px 90px -24px rgba(0,0,0,.55);
  display: grid; grid-template-columns: 1.05fr 1fr;
  animation: loginPop .45s cubic-bezier(0.16,1,0.3,1);
}

/* LEFT · Branded hero (dark, themed) */
.login-hero {
  position: relative; padding: 42px 44px;
  background:
    radial-gradient(560px 360px at 100% 0%, rgba(255,87,34,.28), transparent 55%),
    radial-gradient(480px 460px at 0% 110%, rgba(37,99,235,.24), transparent 55%),
    linear-gradient(155deg, #101d31 0%, #0b1424 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; overflow: hidden;
}
.login-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(120% 120% at 80% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
body.dark-mode .login-hero { border-right-color: rgba(255,255,255,.08); }
.login-hero-top, .login-hero-body, .login-hero-foot { position: relative; z-index: 1; }
.login-hero-logo { display: flex; align-items: center; gap: 12px; }
.login-hero-logo > div:last-child div:first-child { color:#fff; font-size:1.02rem; }
.login-hero-logo > div:last-child div:last-child { color: rgba(255,255,255,.6); }
.login-hero-body { padding: 26px 0; }
.login-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 700;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: rgba(255,87,34,.16); color: #ffb488; border: 1px solid rgba(255,87,34,.4);
}
.login-pill i { width: 14px; height: 14px; }
.login-hero h1 {
  font-size: 2.1rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em;
  margin: 18px 0 14px; color: #fff;
}
.login-hero h1 .accent { color: var(--brand-accent); }
.login-hero p { font-size: 0.92rem; line-height: 1.65; color: rgba(255,255,255,.72); max-width: 46ch; }
.login-features { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.login-feature {
  display: flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 600;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  padding: 9px 13px; border-radius: var(--radius-md); color: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
}
.login-feature i { width: 15px; height: 15px; color: #ff8a5a; }
.login-hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 0.7rem; color: rgba(255,255,255,.5); flex-wrap: wrap;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12);
}
.login-powered { font-weight: 600; color: rgba(255,255,255,.85); }

/* RIGHT · Sign-in card (crisp, light) */
.login-form {
  padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-card); position: relative; gap: 16px;
}
.login-form-top { display: flex; align-items: center; justify-content: center; opacity: .96; }
.login-form-card { width: 100%; max-width: 380px; }
.login-status {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 600;
  color: var(--c-green-tx); background: var(--c-green-bg); padding: 5px 12px;
  border-radius: var(--radius-full); border: 1px solid rgba(5,150,105,.2); margin-bottom: 22px;
}
.login-status .pulse-dot { background: #10B981; box-shadow: 0 0 0 2px rgba(16,185,129,.3); animation: pulse 2s infinite; }
.login-logo-orb {
  width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--brand-accent), #F59E0B);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(249,115,22,.32); animation: logoGlow 3s ease-in-out infinite;
}
.login-logo-orb i { width: 26px; height: 26px; }
.login-title { text-align: center; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-main); }
.login-subtitle { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin: 6px 0 26px; }

.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--text-body); margin-bottom: 7px; }
.login-input {
  width: 100%; background: var(--bg-subtle); border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md); padding: 12px 14px; font-size: 0.88rem; font-weight: 500;
  color: var(--text-main); font-family: inherit; outline: none; transition: all .16s ease; cursor: pointer;
}
.login-input:focus { border-color: var(--brand-accent); box-shadow: var(--ring-focus, 0 0 0 3px rgba(249,115,22,.14)); background: var(--bg-card); }

.login-select-wrap { position: relative; display: flex; align-items: center; }
.login-select-wrap .login-input { padding-left: 38px; padding-right: 34px; appearance: none; -webkit-appearance: none; }
.login-select-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.login-select-caret { position: absolute; right: 12px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }

/* Live role clearance preview card */
.login-preview {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 18px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  transition: border-color 0.18s;
}
.login-preview-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.82rem; box-shadow: 0 2px 6px rgba(15,23,42,.18);
}
.login-preview-body { min-width: 0; }
.login-preview-name { font-size: 0.9rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.01em; }
.login-preview-role { font-size: 0.74rem; font-weight: 600; color: var(--c-blue-tx); margin-top: 1px; }

.login-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 22px; }
.login-remember { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text-body); font-weight: 500; cursor: pointer; }
.login-remember input { width: 16px; height: 16px; accent-color: var(--brand-accent); cursor: pointer; }
.login-link { font-size: 0.8rem; font-weight: 600; color: var(--c-blue-tx); background: none; border: none; cursor: pointer; font-family: inherit; }
.login-link:hover { text-decoration: underline; }

.login-submit {
  width: 100%; padding: 13px; font-size: 0.92rem; font-weight: 700;
  justify-content: space-between; gap: 10px;
}
.login-submit > span { margin-left: auto; }
.login-submit i:last-child { opacity: .8; }

.login-trust {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-light);
  font-size: 0.72rem; color: var(--text-muted); font-weight: 600;
}
.login-trust span { display: inline-flex; align-items: center; gap: 5px; }
.login-trust i { width: 14px; height: 14px; color: var(--c-green); }

@keyframes logoGlow { 0%,100% { box-shadow: 0 10px 24px rgba(249,115,22,.32); } 50% { box-shadow: 0 10px 30px rgba(249,115,22,.55); } }
@keyframes loginPop { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---- Login: responsive ---- */
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; max-width: 460px; min-height: 0; }
  .login-hero { border-right: none; border-bottom: 1px solid var(--border-light); padding: 28px 28px 22px; }
  .login-hero h1 { font-size: 1.5rem; }
  .login-hero-body { padding: 14px 0; }
  .login-hero-foot { display: none; }
  .login-form { padding: 26px; }
}
@media (max-width: 420px) {
  .login-overlay { padding: 12px; }
  .login-hero, .login-form { padding: 20px; }
  .login-hero h1 { font-size: 1.35rem; }
  .login-features { gap: 8px; }
}

/* Highlight flash (demo mode) */
@keyframes highlightFlash { 0%,100% { box-shadow: var(--shadow-sm); } 50% { box-shadow: 0 0 0 4px rgba(255,87,34,.5); } }
.highlight-flash { animation: highlightFlash 1.4s ease 2; border-radius: var(--radius-lg); }

/* Empty-state rows (tables & panels with no data) */
.row-empty td { text-align: center; padding: 28px 16px; background: var(--bg-subtle); }

/* ---- Power Input: daily meter entry (non-technical, mobile-first) ---- */
.pe-meta { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.pe-meta-field { display: flex; flex-direction: column; gap: 8px; min-width: 170px; }
.pe-meta-field.grow { flex: 1; min-width: 240px; }
.pe-meta-field .form-label { font-size: 0.95rem; font-weight: 700; color: var(--text-body); }
.pe-day-chip {
  display: inline-flex; align-items: center; font-size: 0.95rem; font-weight: 700;
  color: var(--c-blue-tx); background: var(--c-blue-bg); border: 1px solid rgba(37,99,235,.2);
  padding: 11px 16px; border-radius: var(--radius-md); white-space: nowrap;
}
.pe-meta-field .form-input { padding: 12px 14px; font-size: 1.05rem; }

/* Meter entry form — compact margins & paddings with high item visibility,
   large crisp legible fonts, and instant keyboard Tab data-entry */
/* High density power meter grid: responsive 3-5 columns, zero wasted padding */
#view-power-input .card {
  padding: 12px 14px;
  margin-bottom: 10px !important;
}
#view-power-input .card-header {
  margin-bottom: 8px !important;
}
.meter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 8px; }
.meter-grid.supply { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 8px; }
.meter-row {
  background: #FFFFFF; border: 1px solid var(--border-light);
  border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;
  transition: all 0.16s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.meter-row:hover { border-color: #FDBA74; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.08); }
.meter-row:focus-within { border-color: #EA580C; box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.18); }
.meter-row-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.meter-name { font-size: 1.05rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-name small { display: inline-block; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.meter-area { font-size: 0.72rem !important; font-weight: 700 !important; padding: 1px 6px !important; border-radius: 4px !important; }
/* Three side-by-side fields; zero-mouse rapid entry, fonts kept large & readable */
.meter-row-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.meter-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meter-field label { font-size: 0.82rem; font-weight: 700; color: var(--text-body); text-transform: none; letter-spacing: 0; margin: 0; }
.meter-field .meter-prev {
  background: #F8FAFC; color: var(--text-muted); font-size: 1.05rem; font-weight: 600;
  padding: 4px 6px; height: 35px; border: 1px solid var(--border-light); border-radius: 5px; text-align: right;
}
.meter-field .meter-present {
  padding: 4px 6px; font-size: 1.35rem; font-weight: 800; text-align: right; color: var(--text-main);
  border: 1.5px solid var(--border-medium); border-radius: 5px; height: 35px;
  background: #FFFFFF;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.meter-field .meter-present:focus {
  border-color: #EA580C; box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2); outline: none; background: #FFFBF7;
}
.meter-cons {
  display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding: 4px 6px; border-radius: 5px;
  background: #ECFDF5; color: #047857; font-weight: 800; font-size: 1.35rem; text-align: right;
  border: 1px solid rgba(5, 150, 105, 0.25); height: 35px;
}
.meter-cons-unit { font-size: 0.75rem; font-weight: 700; opacity: .9; margin-left: 1px; }
.meter-flag { min-height: 0; font-size: 0.9rem; line-height: 1.35; }
.pe-flag { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; flex-wrap: wrap; line-height: 1.4; }
.pe-flag i { width: 18px; height: 18px; }
.pe-flag.warn { background: var(--c-amber-bg); color: var(--c-amber-tx); border: 1px solid rgba(217,119,6,.25); }
.pe-flag.spike { background: var(--c-amber-bg); color: var(--c-amber-tx); border: 1px solid rgba(217,119,6,.25); }
.pe-flag.frozen { background: var(--c-purple-bg, #EDE9FE); color: var(--c-purple-tx, #6D28D9); border: 1px solid rgba(124,58,237,.25); }
.pe-reason { margin-left: 8px; width: auto; padding: 6px 10px; font-size: 0.88rem; font-weight: 600; min-width: 170px; border-radius: 6px; }
/* Who-to-alert chip on a flagged meter */
.pe-notify { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 10px;
  border-radius: 8px; background: var(--c-blue-bg, #EFF6FF); color: var(--c-blue-tx, #2563EB);
  font-weight: 700; font-size: 0.85rem; border: 1px solid rgba(37,99,235,.2); }
.pe-notify i { width: 16px; height: 16px; }
.pe-notify small { display: block; font-weight: 600; opacity: .8; font-size: 0.8rem; margin-top: 1px; }

.pe-report-period { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pe-report-period .source-badge { background: var(--bg-subtle); }
.pe-reporting .kpi-card { padding: 16px; }
.pe-reporting .kpi-value { font-size: 1.4rem; }

.pe-recon { border-left: 4px solid var(--c-green); }
.pe-recon.pe-recon-warn { border-left-color: var(--c-amber); }
.pe-recon.pe-recon-bad { border-left-color: var(--c-red); }
.pe-recon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pe-stat { background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.pe-stat span { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.pe-stat strong { font-size: 1.15rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.02em; }
.pe-stat small { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.pe-stat.highlight { background: #FFF7ED; color: #EA580C; border: 1.5px solid #FDBA74; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.08); }
.pe-stat.highlight span { color: #9A3412; }
.pe-stat.highlight strong { color: #EA580C; }
.pe-stat.highlight.warn { background: var(--c-amber-bg); color: var(--c-amber-tx); border-color: var(--c-amber); }
.pe-stat.highlight.bad { background: var(--c-red-bg); color: var(--c-red-tx); border-color: var(--c-red); }
.pe-recon-badge { font-size: 0.78rem; padding: 6px 14px; }
.pe-recon-badge.good { background: var(--c-green-bg); color: var(--c-green-tx); }
.pe-recon-badge.warn { background: var(--c-amber-bg); color: var(--c-amber-tx); }
.pe-recon-badge.bad { background: var(--c-red-bg); color: var(--c-red-tx); }

.pe-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.pe-actions .btn { min-width: 160px; padding: 13px 20px; font-size: 1rem; font-weight: 700; }
.pe-actions .btn i, .pe-actions .btn svg { width: 20px; height: 20px; }

/* ---- Anomaly playbook & open-alerts cards ---- */
.pe-matrix, .pe-alerts { display: flex; flex-direction: column; gap: 10px; }
.pe-matrix-row, .pe-alert-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 12px 14px;
}
.pe-matrix-when { flex: 1 1 45%; min-width: 0; font-size: 0.95rem; font-weight: 600; color: var(--text-body); line-height: 1.4; }
.pe-matrix-who { flex: 1 1 45%; min-width: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 0.9rem; color: var(--text-main); font-weight: 700; }
.pe-matrix-who i { width: 18px; height: 18px; color: var(--brand-accent); flex-shrink: 0; margin-top: 2px; }
.pe-matrix-who small { display: block; font-weight: 600; font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.pe-matrix-sev { flex-shrink: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; padding: 4px 10px; border-radius: var(--radius-full); text-transform: uppercase; }
.pe-alert-sev { flex-shrink: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; padding: 4px 10px; border-radius: var(--radius-full); text-transform: uppercase; min-width: 62px; text-align: center; }
.pe-alert-body { flex: 1 1 auto; min-width: 0; font-size: 0.9rem; font-weight: 700; color: var(--text-main); line-height: 1.35; }
.pe-alert-body small { display: block; font-weight: 500; font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.pe-alert-owner { flex-shrink: 0; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--c-blue-tx, #2563EB); max-width: 160px; }
.pe-alert-owner i { width: 17px; height: 17px; }
.pe-matrix-empty { font-size: 0.9rem; color: var(--text-muted); padding: 8px 0; }

@media (max-width: 720px) {
  .pe-matrix-row, .pe-alert-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pe-matrix-when, .pe-matrix-who { flex-basis: 100%; }
}

/* ---- Testing & Data Tools card ---- */
.pe-tools .btn { padding: 11px 16px; font-size: 0.95rem; }
.pe-tools .btn i, .pe-tools .btn svg { width: 18px; height: 18px; }
.pe-health-badge { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; padding: 4px 11px; border-radius: var(--radius-full); text-transform: uppercase; }

/* ---- Power module readability: larger, calmer type for non-technical readers ---- */
#view-power-input .card-title { font-size: 1.3rem; }
#view-power-input .card-subtitle { font-size: 0.95rem; }
#view-power-input .form-label { font-size: 0.95rem; font-weight: 700; }
#view-power-input .draft-pill { font-size: 0.9rem; padding: 6px 13px; }
#view-power-input .source-badge { font-size: 0.85rem; }
#pe-reporting .kpi-value { font-size: 1.8rem; }
#pe-reporting .kpi-label { font-size: 0.9rem; }
#pe-reporting .card-title { font-size: 1.15rem; }
#pe-reporting .card-subtitle { font-size: 0.9rem; }
#pe-reporting .pe-report-period .source-badge { font-size: 0.85rem; }

@media (max-width: 640px) {
  .meter-row-fields { grid-template-columns: 1fr; }
  .meter-cons, .meter-field .meter-present { text-align: left; }
}
.empty-state { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px; }
.empty-state i, .empty-state svg { width: 34px; height: 34px; color: var(--text-light); opacity: .7; }
.empty-state div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.empty-state strong { font-size: .9rem; font-weight: 700; color: var(--text-body); }
.empty-state span { font-size: .78rem; color: var(--text-muted); max-width: 320px; text-align: center; }

/* Mono code snippets */
code { font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace; background: var(--bg-muted); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }

/* ---- Responsive: 5-col grid & toast on small screens ---- */
@media (max-width: 1280px) { .grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-5 { grid-template-columns: 1fr; } .toast-container { left: 16px; right: 16px; bottom: 16px; max-width: none; } }
