* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Mobile viewport height fix */
html {
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height - excludes mobile browser UI */
  min-height: calc(var(--vh, 1vh) * 100); /* JS fallback */
  overflow-x: hidden;
  max-width: 100vw;
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

:root {
  /* Mobile viewport variable */
  --vh: 1vh;
  /* Light Theme */
  --bg-primary: #fdfdfe;
  --bg-secondary: #f5f7fa;
  --bg-card: #ffffff;
  --bg-card-alt: #fafbfc;
  --bg-sidebar: #ffffff;
  --bg-overlay: rgba(15, 23, 42, 0.4);
  --accent-green: #16a34a;
  --accent-green-light: rgba(22, 163, 74, 0.1);
  --accent-yellow: #ca8a04;
  --accent-yellow-light: rgba(202, 138, 4, 0.1);
  --accent-red: #dc2626;
  --accent-red-light: rgba(220, 38, 38, 0.1);
  --accent-blue: #2563eb;
  --accent-blue-light: rgba(37, 99, 235, 0.1);
  --accent-amber: #d97706;
  --accent-amber-light: rgba(217, 119, 6, 0.1);
  --accent-emerald: #059669;
  --accent-emerald-light: rgba(5, 150, 105, 0.1);
  --accent-purple: #9333ea;
  --accent-purple-light: rgba(147, 51, 234, 0.1);
  --accent-cyan: #0891b2;
  --accent-cyan-light: rgba(8, 145, 178, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-subtle: rgba(0,0,0,0.08);
  --border-default: #e2e8f0;
  --border-light: #f1f5f9;

  /* Radius scale */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --glow-green: rgba(22, 163, 74, 0.15);

  /* Accent dark variants */
  --accent-green-dark: #15803d;

  /* Slate scale */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;

  /* Green scale */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  /* Blue scale */
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;

  /* Red scale */
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;

  /* Yellow scale */
  --yellow-100: #fef3c7;
  --yellow-600: #d97706;

  /* Orange scale */
  --orange-100: #ffedd5;
  --orange-500: #f97316;

  /* Purple scale */
  --purple-100: #f3e8ff;
  --purple-500: #8b5cf6;

  /* Teal scale */
  --teal-100: #ccfbf1;
  --teal-500: #14b8a6;

  /* Analytics Design Tokens */
  --analytics-card-radius: 16px;
  --analytics-card-shadow: 0 2px 12px rgba(0,0,0,0.04);
  --analytics-card-shadow-hover: 0 8px 24px rgba(0,0,0,0.08);
  --analytics-card-padding: 20px;
  --analytics-section-gap: 24px;
  --analytics-kpi-size: 2rem;
  --analytics-label-size: 0.78rem;
  --analytics-delta-positive: var(--accent-green);
  --analytics-delta-negative: var(--accent-red);
  --analytics-delta-neutral: var(--text-muted);
  --analytics-chart-primary: var(--accent-green);
  --analytics-chart-secondary: var(--accent-blue);
  --analytics-chart-warning: var(--accent-amber);
  --analytics-chart-danger: var(--accent-red);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-alt: #334155;
  --bg-sidebar: #1e293b;
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --border-default: #334155;
  --border-light: #1e293b;
  --accent-green-dark: #22c55e;

  /* Slate scale - dark */
  --slate-50: #1e293b;
  --slate-100: #334155;
  --slate-200: #475569;
  --slate-300: #64748b;
  --slate-400: #94a3b8;
  --slate-500: #cbd5e1;
  --slate-600: #e2e8f0;

  /* Green scale - dark */
  --green-50: rgba(22,163,74,0.1);
  --green-100: rgba(22,163,74,0.15);
  --green-200: rgba(22,163,74,0.25);
  --green-300: rgba(22,163,74,0.35);
  --green-500: #4ade80;
  --green-600: #22c55e;
  --green-700: #4ade80;

  /* Blue scale - dark */
  --blue-100: rgba(37,99,235,0.15);
  --blue-500: #60a5fa;
  --blue-600: #3b82f6;

  /* Red scale - dark */
  --red-100: rgba(220,38,38,0.15);
  --red-500: #f87171;
  --red-600: #ef4444;

  /* Yellow scale - dark */
  --yellow-100: rgba(234,179,8,0.15);
  --yellow-600: #facc15;

  /* Orange scale - dark */
  --orange-100: rgba(249,115,22,0.15);
  --orange-500: #fb923c;

  /* Purple scale - dark */
  --purple-100: rgba(139,92,246,0.15);
  --purple-500: #a78bfa;

  /* Teal scale - dark */
  --teal-100: rgba(20,184,166,0.15);
  --teal-500: #2dd4bf;
}

/* The Yard Theme - Nature-inspired green palette */
[data-theme="yard"] {
  --bg-primary: #e8f4ec;
  --bg-secondary: #d4edda;
  --bg-card: #ffffff;
  --bg-card-alt: #f0f9f2;
  --bg-sidebar: #ffffff;
  --bg-overlay: rgba(30, 70, 32, 0.4);

  /* Greens from The Yard palette */
  --accent-green: #22c55e;
  --accent-green-light: rgba(34, 197, 94, 0.15);
  --accent-yellow: #f5a623;
  --accent-yellow-light: rgba(245, 166, 35, 0.15);
  --accent-red: #e74c3c;
  --accent-red-light: rgba(231, 76, 60, 0.1);
  --accent-blue: #3498db;
  --accent-blue-light: rgba(52, 152, 219, 0.1);
  --accent-amber: #f39c12;
  --accent-amber-light: rgba(243, 156, 18, 0.1);
  --accent-emerald: #15803d;
  --accent-emerald-light: rgba(21, 128, 61, 0.1);
  --accent-purple: #9b59b6;
  --accent-purple-light: rgba(155, 89, 182, 0.1);
  --accent-cyan: #00bcd4;
  --accent-cyan-light: rgba(0, 188, 212, 0.1);

  --text-primary: #1a2f1a;
  --text-secondary: #4a5d4a;
  --text-muted: #6b7c6b;
  --border-subtle: rgba(39, 174, 96, 0.15);
  --shadow-sm: 0 1px 3px rgba(39, 174, 96, 0.08);
  --shadow-md: 0 4px 12px rgba(39, 174, 96, 0.1);
  --shadow-lg: 0 10px 40px rgba(39, 174, 96, 0.15);
  --glow-green: rgba(39, 174, 96, 0.2);
}

/* Yard theme specific styles */
[data-theme="yard"] .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f0f9f2 100%);
  border-right-color: rgba(39, 174, 96, 0.1);
}

[data-theme="yard"] .main-content {
  background: linear-gradient(180deg, #e8f4ec 0%, #d4edda 50%, #c8e6c9 100%);
}

[data-theme="yard"] .stat-card {
  border: 1px solid rgba(39, 174, 96, 0.1);
}

/* Subtle grass decoration at bottom for yard theme */
[data-theme="yard"]::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(39, 174, 96, 0.2) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ==================== ACCESSIBILITY ==================== */

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -50px;
  left: 16px;
  padding: 12px 24px;
  background: var(--accent-green);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  z-index: 10001;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

.admin-hint {
  margin: 6px 0 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}

.profile-access-row:first-child {
  border-top: none;
}

.profile-access-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emp-name {
  font-weight: 600;
  color: var(--text-primary);
}

.emp-dept {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-access-empty {
  color: var(--text-muted);
  padding: 12px 0 4px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--slate-300);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Focus indicators */
*:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent-green);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.15);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Font size adjustment */
[data-font-size="large"] {
  font-size: 110%;
}

[data-font-size="larger"] {
  font-size: 120%;
}

/* High contrast mode support */
@media (prefers-contrast: more), (prefers-contrast: high) {
  :root {
    --border-subtle: rgba(0,0,0,0.3);
  }
  [data-theme="dark"] {
    --border-subtle: rgba(255,255,255,0.3);
  }
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* ============================================ */
/* LOGIN SCREEN */
/* ============================================ */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: 
    radial-gradient(ellipse at 20% 20%, rgba(22, 163, 74, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(217, 119, 6, 0.04) 0%, transparent 40%);
  padding: 20px;
  position: relative;
}

.login-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg), 0 0 100px rgba(22, 163, 74, 0.05);
  animation: fadeInUp 0.5s ease-out;
}

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

.login-header { text-align: center; margin-bottom: 36px; }

.logo-container {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-emerald));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 40px;
  box-shadow: 0 8px 32px rgba(22, 163, 74, 0.25);
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-header p { color: var(--text-secondary); font-size: 1rem; }

.form-group { margin-bottom: 24px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.company-selector { display: flex; gap: 12px; }

.company-option {
  flex: 1;
  padding: 16px;
  background: var(--bg-card-alt);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.company-option:hover { border-color: var(--text-muted); }

.company-option.selected {
  border-color: var(--accent-green);
  background: var(--accent-green-light);
}

.company-option .icon { font-size: 1.8rem; margin-bottom: 8px; }
.company-option .name { font-weight: 600; font-size: 0.95rem; }

.pin-input-container {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pin-digit {
  width: 60px;
  height: 72px;
  background: var(--bg-card-alt);
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  transition: all 0.2s ease;
  outline: none;
}

.pin-digit:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 4px var(--glow-green);
}

.pin-digit.filled {
  border-color: var(--accent-green);
  background: var(--accent-green-light);
}

.pin-digit.error {
  border-color: var(--accent-red);
  background: var(--accent-red-light);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-btn {
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-emerald));
  border: none;
  border-radius: var(--radius-lg);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(22, 163, 74, 0.35);
}

.error-message {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--accent-red);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  margin-top: 16px;
  display: none;
  animation: errorShake 0.4s ease;
}

.error-message.visible { display: block; }

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.login-footer p { font-size: 0.85rem; color: var(--text-muted); }

.theme-toggle-float {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle-float:hover { background: var(--bg-secondary); }

/* ============================================ */
/* MAIN PORTAL LAYOUT */
/* ============================================ */
#portalScreen {
  display: none;
  min-height: 100vh;
}

#portalScreen.active { display: flex; }

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height - accounts for mobile browser chrome */
  position: fixed;
  left: 0;
  top: 0;
  z-index: 19001;
  box-shadow: 2px 0 20px rgba(0,0,0,0.03);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-emerald));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.logo-text h2 { font-size: 1.15rem; font-weight: 700; }
.logo-text span { font-size: 0.8rem; color: var(--text-muted); }

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  position: relative;
}

.user-profile-trigger {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
}

.user-avatar.blue { background: var(--accent-blue); }
.user-avatar.green { background: var(--accent-green); }
.user-avatar.purple { background: var(--accent-purple); }
.user-avatar.amber { background: var(--accent-amber); }
.user-avatar.cyan { background: var(--accent-cyan); }

.user-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.user-details .name { font-weight: 600; font-size: 0.95rem; }
.user-details .role { font-size: 0.8rem; color: var(--text-secondary); }

/* Desktop Notification Bell (in sidebar user-info) */
.desktop-notification-bell {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  margin-left: auto;
  cursor: pointer;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-notification-bell:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

.desktop-notification-bell svg {
  display: block;
}

.desktop-notification-bell .notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f44336;
  color: white;
  font-size: 0.6rem;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.desktop-notification-bell .notification-badge.hidden {
  display: none;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
  min-height: 0; /* Allow shrinking for flexbox */
}

.nav-section { margin-bottom: 16px; }
#coreReportsNav { display: block !important; }

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  user-select: none;
}
.nav-section-title:hover { background: var(--bg-hover, rgba(0,0,0,0.04)); }
.nav-section-title::after {
  content: '\25BE';
  font-size: 0.65rem;
  transition: transform 0.2s;
  opacity: 0.5;
}
.nav-section.collapsed .nav-section-title::after {
  transform: rotate(-90deg);
}
.nav-section.collapsed > .nav-item,
.nav-section.collapsed > .reporting-nav-group,
.nav-section.collapsed > #peopleNavList,
.nav-section.collapsed > #savedViewsList {
  display: none !important;
}

.reporting-nav-group {
  margin-top: 8px;
}

.reporting-nav-group-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.reporting-nav-group-toggle:hover {
  background: var(--bg-hover, rgba(0,0,0,0.04));
  color: var(--text-secondary);
}

.reporting-nav-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reporting-nav-group-toggle::after {
  content: '\25BE';
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.2s ease;
}

.reporting-nav-group.collapsed .reporting-nav-group-toggle::after {
  transform: rotate(-90deg);
}

.reporting-nav-group-items {
  margin-top: 4px;
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid var(--border-subtle);
}

.reporting-nav-group.collapsed .reporting-nav-group-items {
  display: none;
}

.reporting-nav-group .nav-item {
  margin-bottom: 1px;
}


.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 2px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--accent-green-light), rgba(22, 163, 74, 0.05));
  color: var(--accent-green);
  border-left: 3px solid var(--accent-green);
  margin-left: -3px;
}

.nav-item .icon { font-size: 1.1rem; width: 26px; text-align: center; display: flex; align-items: center; justify-content: center; }
.nav-item .label { font-size: 0.9rem; }

.nav-item .badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

/* The Yard link */
.yard-link {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: #92400e;
  font-weight: 600;
  --reporting-accent: #b45309;
  --reporting-accent-light: rgba(180, 83, 9, 0.1);
}
.yard-link .reporting-icon-shell {
  width: 30px;
  height: 30px;
  opacity: 1;
  color: #b45309;
}
.yard-link .label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.yard-link:hover {
  background: rgba(180, 83, 9, 0.08);
  color: #78350f;
}
.yard-link:hover .reporting-icon-shell {
  transform: scale(1.1);
}

/* Saved view delete button */
.saved-view-item {
  position: relative;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
}
.saved-view-item .label {
  flex: 1;
}
.saved-view-delete {
  display: inline-block;
  padding: 2px 8px;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  margin-left: 4px;
}
.saved-view-delete:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
}

.sidebar-footer {
  padding: 12px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0; /* Prevent footer from shrinking */
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.theme-switch:hover { background: var(--bg-card-alt); }
.theme-switch .icon { font-size: 1rem; }
.theme-switch .label { font-size: 0.85rem; color: var(--text-secondary); }

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--accent-red-light);
  color: #b91c1c;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn:hover { background: var(--accent-red); color: white; }

[data-theme="dark"] .logout-btn { color: #fca5a5; }

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 24px 28px;
  min-height: 100vh;
  background-image: radial-gradient(ellipse at 80% 20%, rgba(22, 163, 74, 0.03) 0%, transparent 50%);
  overflow-x: hidden;
  max-width: calc(100vw - 280px);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.page-header .subtitle { color: var(--text-secondary); font-size: 0.95rem; }

.header-actions { display: flex; gap: 10px; }

.task-action-label--compact,
.dashboard-action-label--compact,
.team-dashboard-action-label--compact,
.task-scope-label--compact {
  display: none;
}

.dashboard-side-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-mini-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 11px 20px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #15803d, #166534);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #166534, #14532d);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.3);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover { background: var(--bg-secondary); }

/* Data source indicator badge */
.source-badge {
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 500;
  align-items: center;
  gap: 4px;
}
.source-badge.source-d1 {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green-500);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.source-badge.source-jotform {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.btn-warning:hover { background: rgba(217, 119, 6, 0.15); }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

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

.stat-trend {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.stat-trend.up { background: var(--accent-green-light); color: var(--accent-green); }
.stat-trend.down { background: var(--accent-red-light); color: var(--accent-red); }
.stat-trend.neutral { background: var(--bg-secondary); color: var(--text-muted); }

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card.open .stat-value { color: var(--accent-blue); }
.stat-card.escalated .stat-value { color: var(--accent-red); }
.stat-card.today .stat-value { color: var(--accent-amber); }
.stat-card.resolved .stat-value { color: var(--accent-green); }

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

/* Stat Card Clickable */
.stat-card { cursor: pointer; }

/* Morning Briefing Card */
.briefing-card {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid #bae6fd;
}
.briefing-header { margin-bottom: 10px; }
.briefing-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}
.briefing-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.briefing-item.clickable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin: 0 -8px;
  transition: background 0.15s ease;
}
.briefing-item.clickable:hover {
  background: rgba(0,0,0,0.04);
}
.briefing-icon { font-size: 16px; flex-shrink: 0; }
.briefing-text { font-size: 14px; color: var(--text-primary); }
.briefing-arrow { color: var(--text-muted); margin-left: auto; flex-shrink: 0; }

/* Quick Actions Bar */
.quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.quick-action-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  color: var(--text-primary);
}
.quick-action-btn:hover {
  background: var(--green-50);
  border-color: var(--primary);
  color: var(--primary);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 24px;
  min-width: 0;
}

.content-grid > *,
.dashboard-side-column {
  min-width: 0;
  max-width: 100%;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-alt);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header .badge {
  background: var(--accent-red);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  margin-left: 8px;
}

.view-all {
  font-size: 0.85rem;
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
}

.view-all:hover { text-decoration: underline; }

/* Task List */
.task-list { padding: 0; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}

.task-item:hover { background: var(--bg-card-alt); }
.task-item:last-child { border-bottom: none; }

.task-signal {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.task-signal.pending { background: var(--accent-blue); }
.task-signal.in-progress { background: var(--accent-amber); box-shadow: 0 0 8px rgba(217, 119, 6, 0.4); }
.task-signal.escalated { background: var(--accent-red); box-shadow: 0 0 8px rgba(220, 38, 38, 0.4); }
.task-signal.resolved { background: var(--accent-green); }

.task-content { flex: 1; min-width: 0; }

.task-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-type {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.task-type.bag-rate { background: var(--accent-purple-light); color: var(--accent-purple); }
.task-type.truck-wash { background: var(--accent-cyan-light); color: var(--accent-cyan); }
.task-type.inventory { background: var(--accent-amber-light); color: var(--accent-amber); }
.task-type.complaint { background: var(--accent-red-light); color: var(--accent-red); }
.task-type.customer_complaint { background: var(--accent-red-light); color: var(--accent-red); }
.task-type.customer-complaint { background: var(--accent-red-light); color: var(--accent-red); }
.task-type.complaint-type { background: var(--accent-red-light); color: var(--accent-red); font-weight: 600; }
.task-type.compliance { background: var(--accent-blue-light); color: var(--accent-blue); }
.task-type.call-off { background: var(--accent-red-light); color: var(--accent-red); }
.task-type.pto { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.task-type.inventory-compliance { background: var(--accent-amber-light); color: var(--accent-amber); }
.task-type.shop-duties-compliance { background: var(--accent-blue-light); color: var(--accent-blue); }

/* Complaint task visual indicators */
.complaint-badge { font-size: 0.9em; }
.complaint-card { border-left: 3px solid var(--accent-red, #ef4444) !important; }
.kanban-card.complaint-card { border-left: 3px solid var(--accent-red, #ef4444); }
.task-card.complaint-card { border-left: 3px solid var(--accent-red, #ef4444); }

.task-due {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.task-due.overdue { color: var(--accent-red); }
.task-due.due-soon { color: var(--accent-amber); }
.task-due.ok { color: var(--text-muted); }

/* Activity Feed */
.activity-list { padding: 0; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-icon.resolved { background: var(--accent-green-light); color: var(--accent-green); }
.activity-icon.escalated { background: var(--accent-red-light); color: var(--accent-red); }
.activity-icon.created { background: var(--accent-blue-light); color: var(--accent-blue); }
.activity-icon.progress { background: var(--accent-amber-light); color: var(--accent-amber); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text strong { color: var(--text-primary); }

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Workload */
.workload-list { padding: 16px 20px; }

.workload-item { margin-bottom: 18px; }
.workload-item:last-child { margin-bottom: 0; }

.workload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.workload-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 0;
}

.workload-name .avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  background: var(--accent-blue);
}

.workload-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workload-count .overdue { color: var(--accent-red); font-weight: 600; }

.workload-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.workload-progress {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.workload-progress.high { background: linear-gradient(90deg, var(--accent-red), #ef4444); }
.workload-progress.medium { background: linear-gradient(90deg, var(--accent-amber), #f59e0b); }
.workload-progress.low { background: linear-gradient(90deg, var(--accent-green), #22c55e); }

/* ============================================ */
/* TASK DETAIL PANEL */
/* ============================================ */
.task-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  justify-content: flex-end;
}

.task-panel-overlay.active { display: flex; }

.task-panel {
  width: 580px;
  max-width: 100%;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease;
  box-shadow: -10px 0 40px rgba(0,0,0,0.15);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-alt);
}

.panel-header-left { flex: 1; }

.task-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.task-type-badge.escalated { background: var(--accent-red-light); color: var(--accent-red); }
.task-type-badge.pending { background: var(--accent-blue-light); color: var(--accent-blue); }
.task-type-badge.in-progress { background: var(--accent-amber-light); color: var(--accent-amber); }

.panel-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.task-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Task panel: task ID line - muted and truncated */
.panel-task-id, #panelTaskId, .panel-subtitle {
  font-size: 11px;
  color: #9ca3af;
  font-family: inherit;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.panel-header-right { display: flex; gap: 8px; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.icon-btn.close:hover { background: var(--accent-red-light); color: var(--accent-red); }

.status-bar {
  display: flex;
  gap: 12px;
  padding: 14px 24px;
  background: var(--accent-red-light);
  border-bottom: 1px solid var(--border-subtle);
}

.status-bar.pending { background: var(--accent-blue-light); }
.status-bar.in-progress { background: var(--accent-amber-light); }

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  flex: 1;
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.status-text { font-weight: 600; font-size: 0.9rem; color: var(--accent-red); }

.due-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(220, 38, 38, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.due-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-red);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.section { margin-bottom: 28px; }

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-item {
  background: var(--bg-card-alt);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
}

.info-item.full-width { grid-column: span 2; }

.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.info-value { font-size: 0.95rem; font-weight: 500; }
.info-value.mono { font-family: 'JetBrains Mono', monospace; }
.info-value.overdue { color: var(--accent-red); }

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

.assignee-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
}

.assignee-details .name { font-weight: 600; font-size: 1rem; }
.assignee-details .role { font-size: 0.8rem; color: var(--text-muted); }

.edit-btn {
  margin-left: auto;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.summary-box {
  background: var(--bg-card-alt);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.summary-box p { margin-bottom: 10px; }
.summary-box p:last-child { margin-bottom: 0; }
.summary-box strong { color: var(--text-primary); }

.source-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.source-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.source-link .icon { font-size: 1.2rem; }
.source-link .text { flex: 1; }
.source-link .text .label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 2px; }
.source-link .text .value { font-weight: 500; font-size: 0.9rem; }
.source-link .arrow { color: var(--text-muted); }

/* Resolution Notes Textarea */
.notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  background: var(--bg-card-alt);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.6;
}

.notes-textarea:focus {
  border-color: var(--accent-green);
}

.notes-textarea::placeholder { color: var(--text-muted); }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  font-weight: 700;
}

.timeline-dot.created { border-color: var(--accent-blue); color: var(--accent-blue); }
.timeline-dot.escalated { border-color: var(--accent-red); color: var(--accent-red); }
.timeline-dot.comment { border-color: var(--accent-purple); color: var(--accent-purple); }
.timeline-dot.status { border-color: var(--accent-amber); color: var(--accent-amber); }
.timeline-dot.resolved { border-color: var(--accent-green); color: var(--accent-green); background: var(--accent-green-light); }
.timeline-dot.reassign { border-color: var(--accent-cyan, #22d3ee); color: var(--accent-cyan, #22d3ee); }
.timeline-dot.note { border-color: var(--accent-teal, #14b8a6); color: var(--accent-teal, #14b8a6); }
.timeline-dot.default { border-color: var(--text-muted); color: var(--text-muted); }

.timeline-content {
  background: var(--bg-card-alt);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.timeline-actor { font-weight: 600; font-size: 0.9rem; }
.timeline-time { font-size: 0.75rem; color: var(--text-muted); }
.timeline-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

.panel-footer {
  position: sticky;
  bottom: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card, #ffffff);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 10;
}

.panel-footer .btn { flex: 1; justify-content: center; }

/* ============================================ */
/* LEADERSHIP CONSOLE */
/* ============================================ */
.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

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

.header-title h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: 2px; }
.header-title span { font-size: 0.85rem; color: var(--text-muted); }

.header-center { display: flex; gap: 8px; }

.company-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.company-tab {
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.company-tab:hover { background: var(--bg-card); }

.company-tab.active {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-emerald));
  color: white;
  border-color: transparent;
}

.company-tab.rlc.active { background: linear-gradient(135deg, var(--accent-cyan), #0284c7); }
.company-tab.gx.active { background: linear-gradient(135deg, var(--accent-green), var(--accent-emerald)); }

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

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent-green-light);
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-green);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

.datetime { text-align: right; }

.datetime .time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.datetime .date { font-size: 0.85rem; color: var(--text-muted); }

.console-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.console-stats .stat-card {
  text-align: center;
  padding: 18px;
}

.console-stats .stat-icon { font-size: 1.4rem; margin-bottom: 10px; }
.console-stats .stat-value { font-size: 2rem; margin-bottom: 4px; }

.console-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

.left-column { display: flex; flex-direction: column; gap: 20px; }

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Activity Stream */
.activity-stream { max-height: 400px; overflow-y: auto; }

.activity-company {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--accent-green-light);
  color: var(--accent-green);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
}

/* Task Breakdown */
.task-breakdown { padding: 16px 20px; }

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.breakdown-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breakdown-icon { font-size: 1rem; }
.breakdown-label { font-size: 0.9rem; color: var(--text-secondary); }

.breakdown-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Manager Workload Grid */
.workload-grid { padding: 16px 20px; }

.manager-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.manager-row:last-child { border-bottom: none; }

.manager-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
}

.manager-info { flex: 1; }
.manager-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }

.manager-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.manager-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.manager-stats { text-align: right; }
.manager-total { font-weight: 700; font-size: 1.1rem; }
.manager-overdue { font-size: 0.75rem; color: var(--accent-red); }

/* Teams Grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  padding: 0 20px 20px;
}

.team-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.team-card-header {
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-card-title {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-card-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: var(--radius-lg);
}

.team-members-list {
  padding: 8px 0;
  max-height: 400px;
  overflow-y: auto;
}

.team-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.team-member-item:hover {
  background: var(--bg-secondary);
}

.team-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-green), var(--accent-emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}

.team-member-info {
  flex: 1;
  min-width: 0;
}

.team-member-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-member-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.team-member-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.team-member-badge.leadership {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
}

.team-member-badge.manager {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

.team-member-badge.lead-tech {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

@media (max-width: 768px) {
  .teams-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }
}

/* Who's Out */
.whos-out { padding: 12px 20px; }

.out-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.out-type {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
}

.out-type.pto { background: var(--accent-purple-light); color: var(--accent-purple); }
.out-type.calloff { background: var(--accent-red-light); color: var(--accent-red); }
.out-type.birthday { background: #fce7f3; color: #db2777; }

.out-name { font-weight: 600; font-size: 0.9rem; flex: 1; }
.out-detail { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================ */
/* EASTER EGG */
/* ============================================ */
.easter-egg {
  position: fixed;
  bottom: 10px;
  right: 14px;
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.25;
  font-family: 'JetBrains Mono', monospace;
  cursor: default;
  user-select: none;
  transition: opacity 0.3s;
  z-index: 50;
}

.easter-egg:hover { opacity: 0.6; }

/* ============================================ */
/* TASKS VIEW STYLES */
/* ============================================ */
.task-scope-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 14px;
}

.task-scope-btn {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
}

.task-helper-card {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.09), rgba(22, 163, 74, 0.05));
  border: 1px solid rgba(22, 163, 74, 0.18);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.task-ownership-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--badge-color, #64748b) 10%, transparent);
  color: var(--badge-color, #64748b);
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--glow-green);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.filter-select {
  padding: 11px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  min-width: 130px;
}

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

.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--accent-green-light);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  color: var(--accent-green);
  font-weight: 500;
}

.filter-tag .remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.75rem;
}

.filter-tag .remove:hover { opacity: 1; }

.clear-filters {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  transition: color 0.15s;
}

.clear-filters:hover { color: var(--accent-red); }

.results-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-count strong { color: var(--text-primary); }

.view-options { display: flex; gap: 6px; }

.view-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.view-btn:hover { background: var(--bg-secondary); }

.view-btn.active {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

/* Task Card View */
.task-card-view {
  margin-top: 0;
}

.task-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

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

.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.task-card.pending::before { background: var(--accent-amber); }
.task-card.in-progress::before { background: var(--accent-blue); }
.task-card.escalated::before { background: var(--accent-red); }
.task-card.resolved::before { background: var(--accent-green); }

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.task-card-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
  margin-right: 8px;
}

.task-card-status {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-lg);
  font-weight: 500;
  white-space: nowrap;
}

.task-card-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.task-card-status.in-progress { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.task-card-status.escalated { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.task-card-status.resolved { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }

.task-card-body {
  margin-bottom: 12px;
}

.task-card-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-card-type {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.task-card-due {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.task-card-due.overdue { color: var(--accent-red); font-weight: 600; }
.task-card-due.due-soon { color: var(--accent-amber); font-weight: 600; }

.task-card-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-card-assignee .mini-avatar {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}

.task-card-assignee span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Compact List View */
.task-list-view {
  margin-top: 0;
}

.task-compact-list {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.task-list-row {
  appearance: none;
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 4px minmax(180px, 2fr) minmax(130px, auto) auto minmax(120px, auto) minmax(88px, auto);
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.task-list-row:last-child { border-bottom: 0; }
.task-list-row:hover { background: var(--bg-card-alt); }
.task-list-row:focus-visible { outline: 3px solid var(--accent-green-light); outline-offset: -3px; }
.task-list-signal { width: 4px; height: 32px; border-radius: 999px; }
.task-list-main { min-width: 0; display: grid; gap: 1px; }
.task-list-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; font-weight: 650; }
.task-list-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 0.72rem; }
.task-list-labels { display: flex; align-items: center; gap: 5px; min-width: 0; }
.task-list-labels > * { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-list-assignee { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 0.76rem; }
.task-list-assignee > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-list-assignee .mini-avatar { width: 22px; height: 22px; flex: 0 0 22px; font-size: 0.62rem; }
.task-list-due { justify-self: end; white-space: nowrap; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; }
.task-list-due.overdue { color: var(--accent-red); }
.task-list-due.due-soon { color: var(--accent-amber); }
.task-list-empty { display: grid; justify-items: center; gap: 4px; padding: 36px 16px; color: var(--text-muted); text-align: center; }
.task-list-empty > span:first-child { font-size: 1.75rem; }
.task-list-empty strong { color: var(--text-primary); }

/* Kanban View */
.task-kanban-view {
  margin-top: 0;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 500px;
}

.kanban-column {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  margin-bottom: 12px;
}

.kanban-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.kanban-status-dot.pending { background: var(--accent-amber); }
.kanban-status-dot.in-progress { background: var(--accent-blue); }
.kanban-status-dot.escalated { background: var(--accent-red); }
.kanban-status-dot.resolved { background: var(--accent-green); }

.kanban-column-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  flex: 1;
}

.kanban-count {
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.kanban-card:hover {
  border-color: var(--accent-green);
  box-shadow: var(--shadow-sm);
}

.kanban-card-title {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-card-type {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.kanban-card-due {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kanban-card-due.overdue { color: var(--accent-red); }
.kanban-card-due.due-soon { color: var(--accent-amber); }

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.kanban-card-footer .mini-avatar {
  width: 20px;
  height: 20px;
  font-size: 0.6rem;
}

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

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }

  .task-card-grid {
    grid-template-columns: 1fr;
  }
}

.task-table-container {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

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

.task-table th,
.task-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.task-table th {
  background: var(--bg-card-alt);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.task-table th.sortable { cursor: pointer; }
.task-table th.sortable:hover { color: var(--text-primary); }
.task-table th.sorted { color: var(--accent-green); }
.task-table th .sort-icon { margin-left: 4px; }

.task-table tr { cursor: pointer; transition: background 0.15s; }
.task-table tbody tr:nth-child(even) { background: var(--bg-secondary); }
.task-table tbody tr:hover { background: var(--bg-card-alt); }
.task-table tbody tr:last-child td { border-bottom: none; }

.table-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-checkbox:hover { border-color: var(--accent-green); }

.table-checkbox.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.table-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}

.signal-cell { display: flex; align-items: center; }

.task-summary-cell .title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.task-summary-cell .subtitle { font-size: 0.8rem; color: var(--text-muted); }

.assignee-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
}

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.pending { background: var(--accent-blue-light); color: var(--accent-blue); }
.status-badge.in-progress { background: var(--accent-amber-light); color: var(--accent-amber); }
.status-badge.escalated { background: var(--accent-red-light); color: var(--accent-red); }
.status-badge.resolved { background: var(--accent-green-light); color: var(--accent-green); }

.due-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
}

.due-badge.overdue { color: var(--accent-red); }
.due-badge.due-soon { color: var(--accent-amber); }
.due-badge.ok { color: var(--text-muted); }

.action-menu-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.15s;
}

.action-menu-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-alt);
}

.pagination-info { font-size: 0.85rem; color: var(--text-muted); }

.pagination-controls { display: flex; gap: 6px; }

.page-btn {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) { background: var(--bg-secondary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.page-btn.active {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

.quick-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.quick-action-bar .selected-count {
  font-weight: 600;
  font-size: 0.9rem;
}

.quick-action-bar .action-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

/* ============================================ */
/* ADMIN VIEW STYLES */
/* ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-green); }

.admin-stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  width: fit-content;
}

.admin-tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tab-btn:hover:not(:disabled) {
  background: var(--surface-light);
  color: var(--text-primary);
}

.admin-tab-btn.active {
  background: var(--accent);
  color: white;
}

.admin-tab-content {
  animation: fadeIn 0.2s ease-out;
}

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

.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.stat-mini {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-mini-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-mini-icon.blue { background: var(--accent-blue-light); }
.stat-mini-icon.green { background: var(--accent-green-light); }
.stat-mini-icon.purple { background: var(--accent-purple-light); }
.stat-mini-icon.amber { background: var(--accent-amber-light); }
.stat-mini-icon.red { background: rgba(239, 68, 68, 0.15); }
.stat-mini-icon.emerald { background: rgba(16, 185, 129, 0.15); }

.stat-mini-value {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.stat-mini-label { font-size: 0.8rem; color: var(--text-muted); }

/* Week Calendar Grid for Who's Out */
.week-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.week-day-column {
  background: var(--surface-light);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 120px;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.week-day-column.today {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue);
}

.week-day-header {
  text-align: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.week-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.week-day-date {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.week-day-column.today .week-day-name,
.week-day-column.today .week-day-date {
  color: var(--accent-blue);
}

.week-day-absences {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.week-absence-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
}

.week-absence-chip.pto {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.week-absence-chip.calloff {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.week-absence-chip.birthday {
  background: #fce7f3;
  color: #db2777;
}

.week-absence-chip .absence-initials {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.week-absence-chip.pto .absence-initials {
  background: var(--accent-green);
}

.week-absence-chip.calloff .absence-initials {
  background: var(--accent-red);
}

/* Who's Out List Items */
.whosout-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-light);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle);
}

.whosout-item:last-child {
  margin-bottom: 0;
}

.whosout-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.whosout-info {
  flex: 1;
}

.whosout-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.whosout-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.whosout-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.whosout-type-badge {
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.whosout-type-badge.pto {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.whosout-type-badge.calloff {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.whosout-type-badge.birthday {
  background: #fce7f3;
  color: #db2777;
}

.whosout-company-badge {
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  font-size: 0.7rem;
  font-weight: 600;
}

.whosout-company-badge.rlc {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-cyan);
}

.whosout-company-badge.gx {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.whosout-company-badge.both {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.whosout-days-until {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  min-width: 60px;
}

.whosout-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

.whosout-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* Schedule View Styles */
.schedule-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.view-toggle-btn:hover {
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: var(--accent-blue);
  color: white;
}

.schedule-nav {
  display: flex;
  gap: 8px;
}

.schedule-period-header {
  margin-bottom: 16px;
}

.schedule-period-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Week View */
.schedule-week-view {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.schedule-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: 500px;
}

.schedule-day {
  border-right: 1px solid var(--border-subtle);
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.schedule-day:last-child {
  border-right: none;
}

.schedule-day-header {
  padding: 12px;
  text-align: center;
  background: var(--surface-light);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
}

.schedule-day.today .schedule-day-header {
  background: var(--accent-blue-light);
}

.schedule-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedule-day.today .schedule-day-name {
  color: var(--accent-blue);
}

.schedule-day-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.schedule-day.today .schedule-day-num {
  color: var(--accent-blue);
}

.schedule-day-content {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  cursor: pointer;
}

.schedule-day-content:hover {
  background: var(--surface-light);
}

.schedule-absence-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  cursor: default;
}

.schedule-absence-item.pto {
  background: rgba(16, 185, 129, 0.15);
  border-left: 3px solid var(--accent-green);
}

.schedule-absence-item.calloff {
  background: rgba(239, 68, 68, 0.15);
  border-left: 3px solid var(--accent-red);
}

.schedule-absence-item.birthday {
  background: #fdf2f8;
  border-left: 3px solid #ec4899;
}

.schedule-absence-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.schedule-absence-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-absence-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.schedule-absence-badge.pto {
  background: var(--accent-green);
  color: white;
}

.schedule-absence-badge.calloff {
  background: var(--accent-red);
  color: white;
}

.schedule-absence-badge.birthday {
  background: #ec4899;
  color: white;
}

/* Delete Button for Absences - Hidden by default, visible on hover */
.absence-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(100, 100, 100, 0.15);
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
  transition: all 0.15s ease;
  opacity: 0;
  visibility: hidden;
}

/* Show delete button on parent hover */
.week-absence-chip:hover .absence-delete-btn,
.schedule-absence-item:hover .absence-delete-btn,
.absence-list-item:hover .absence-delete-btn,
.popover-absence-item:hover .absence-delete-btn {
  opacity: 0.6;
  visibility: visible;
}

.absence-delete-btn:hover {
  background: var(--accent-red);
  color: white;
  opacity: 1 !important;
  visibility: visible;
}

/* Month View */
.schedule-month-view {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.schedule-month-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-light);
  border-bottom: 1px solid var(--border-subtle);
}

.month-day-header {
  padding: 12px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.schedule-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.month-day-cell {
  min-height: 100px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.month-day-cell:nth-child(7n) {
  border-right: none;
}

.month-day-cell:hover {
  background: var(--surface-light);
}

.month-day-cell.today {
  background: var(--accent-blue-light);
}

.month-day-cell.other-month {
  opacity: 0.4;
}

.month-day-cell.other-month:hover {
  opacity: 0.6;
}

.month-day-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.month-day-cell.today .month-day-num {
  color: var(--accent-blue);
  font-weight: 700;
}

.month-day-absences {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.month-absence-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-absence-chip.pto {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.month-absence-chip.calloff {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.month-absence-chip.birthday {
  background: #fce7f3;
  color: #db2777;
}

.month-absence-more {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 2px 4px;
}

/* Day Detail Popover */
.schedule-day-popover {
  position: fixed;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 320px;
  z-index: 1000;
}

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

.popover-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.popover-close:hover {
  color: var(--text-primary);
}

.popover-body {
  padding: 12px 16px;
  max-height: 250px;
  overflow-y: auto;
}

.popover-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
}

.popover-absence-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.popover-absence-item:last-child {
  margin-bottom: 0;
}

.popover-absence-item.pto {
  background: rgba(16, 185, 129, 0.1);
}

.popover-absence-item.calloff {
  background: rgba(239, 68, 68, 0.1);
}

.popover-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .schedule-week-grid {
    min-height: 400px;
  }

  .schedule-day {
    min-height: 400px;
  }

  .schedule-day-num {
    font-size: 1.2rem;
  }

  .schedule-absence-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .schedule-absence-avatar {
    display: none;
  }
}

@media (max-width: 768px) {
  .schedule-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .view-toggle {
    justify-content: center;
  }

  .schedule-nav {
    justify-content: center;
  }

  .company-tabs {
    justify-content: center;
  }

  .month-day-cell {
    min-height: 80px;
    padding: 4px;
  }

  .month-absence-chip {
    font-size: 0.6rem;
    padding: 2px 4px;
  }
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* People Table (List View) */
.people-table-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.people-table th,
.people-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.people-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}

.people-table tbody tr:hover {
  background: var(--bg-secondary);
}

.people-table .employee-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.people-table .mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.people-table .company-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.people-table .company-badge.rlc {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}

.people-table .company-badge.gx {
  background: rgba(22, 163, 74, 0.15);
  color: var(--accent-green);
}

.people-table .status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
}

.people-table .status-pill.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green-dark);
}

.people-table .status-pill.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.people-table .pin-cell {
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 8px;
}

.people-table .pin-value {
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.people-table .pin-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.people-table .pin-toggle:hover {
  opacity: 1;
}

.people-table .action-btns {
  display: flex;
  gap: 8px;
}

.people-table .action-btn {
  background: var(--bg-secondary);
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.people-table .action-btn:hover {
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.people-table .action-btn.edit:hover {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

.people-table .action-btn.delete:hover {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

/* View Toggle Buttons */
.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 2px;
}

.view-toggle-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.view-toggle-btn:hover {
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--accent-green);
  box-shadow: var(--shadow-sm);
}

.person-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.person-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.person-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border-subtle);
}

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.person-info { flex: 1; }
.person-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.person-role { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }

.person-team {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.person-status {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.person-status.active { background: var(--accent-green-light); color: var(--accent-green); }
.person-status.inactive { background: var(--accent-red-light); color: var(--accent-red); }

.person-details { padding: 16px 20px; }

.person-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.person-details .detail-row:last-child { border-bottom: none; }
.person-details .detail-label { color: var(--text-muted); }
.person-details .detail-value { font-weight: 500; }

.company-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.company-badge.rlc { background: var(--accent-cyan-light); color: var(--accent-cyan); }
.company-badge.gx { background: var(--accent-green-light); color: var(--accent-green); }

.person-actions {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-alt);
}

.person-action-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.person-action-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.person-action-btn.edit:hover { background: var(--accent-blue); color: white; border-color: var(--accent-blue); }
.person-action-btn.delete:hover { background: var(--accent-red-light); color: var(--accent-red); }

/* Add Person Modal */
.modal-overlay-bg {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  display: none;
}

.modal-overlay-bg.active { display: block; }

.add-person-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: none;
  opacity: 0;
  transition: all 0.2s ease;
}

.add-person-modal.active {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#newTaskModal.active {
  display: flex;
  flex-direction: column;
}

#newTaskModal #newTaskForm {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#newTaskModal .modal-body-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#newTaskModal .modal-footer-bar {
  flex-shrink: 0;
}

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

.modal-header-bar h3 { font-size: 1.2rem; font-weight: 700; }

.modal-close-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  touch-action: manipulation;
  -webkit-appearance: none;
  z-index: 10;
}

.modal-close-btn:hover,
.modal-close-btn:active { background: var(--accent-red-light); color: var(--accent-red); }

.modal-body-content { padding: 24px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s;
}

.form-input:focus { border-color: var(--accent-green); box-shadow: 0 0 0 3px var(--glow-green); }

.modal-footer-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-alt);
  border-radius: 0 0 20px 20px;
}

/* Absence Detail Modal */
.absence-detail-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: none;
  opacity: 0;
  transition: all 0.2s ease;
}

.absence-detail-modal.active {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.absence-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.absence-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.absence-detail-title {
  flex: 1;
}

.absence-detail-title h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.absence-detail-type {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  font-weight: 600;
}

.absence-detail-type.pto {
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.absence-detail-type.calloff {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

.absence-detail-body {
  padding: 24px;
}

.absence-detail-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}

.absence-detail-row:last-child {
  margin-bottom: 0;
}

.absence-detail-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.absence-detail-info label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.absence-detail-info span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.absence-detail-photo {
  margin-top: 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
}

.absence-detail-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.absence-detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-alt);
  border-radius: 0 0 20px 20px;
}

.absence-detail-delete-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.absence-detail-delete-btn:hover {
  background: var(--accent-red);
  color: white;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  z-index: 200;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: 1.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
}

.mobile-menu-btn:active {
  transform: scale(0.95);
  background: var(--bg-secondary);
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(60px + max(env(safe-area-inset-top, 0px), 20px));
  padding-top: max(env(safe-area-inset-top, 0px), 20px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 150;
  padding-left: 64px;
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.mobile-header-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.mobile-header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-header-user .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-overlay);
  z-index: 19000;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
}

/* Touch-friendly delete button */
.absence-delete-btn.touch-visible {
  opacity: 0.6 !important;
  visibility: visible !important;
}

#toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
}

/* Tablet breakpoint */
@media (max-width: 1400px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .console-stats { grid-template-columns: repeat(3, 1fr); }
  .console-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar { width: 240px; }
  .main-content { margin-left: 240px; }
  .task-panel { width: 360px; }

  .schedule-week-grid { min-height: 400px; }
  .schedule-day { min-width: 100px; }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  /* Show mobile UI elements */
  .mobile-menu-btn { display: flex; }
  .mobile-header { display: flex; }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.active { pointer-events: auto; }

  /* Sidebar mobile behavior — full-width sheet on small phones */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: min(360px, 100vw);
    z-index: 19001;
    /* Use 100% of screen including area behind bottom nav */
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    background: var(--bg-sidebar, #fff);
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.18);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  /* Push sidebar header down below iOS status bar */
  .sidebar .sidebar-header {
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
  }

  /* Sidebar footer pins to bottom, clears home indicator */
  .sidebar .sidebar-footer {
    margin-top: auto;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    background: rgba(15, 23, 42, 0.56);
  }

  /* Tighter sidebar spacing on mobile */
  .sidebar-nav {
    padding: 8px 10px;
  }
  .nav-section {
    margin-bottom: 12px;
  }
  .nav-item {
    padding: 8px 10px;
    gap: 8px;
  }
  .nav-section-title {
    padding: 6px 10px;
  }
  .sidebar-footer {
    padding: 10px;
  }
  .theme-switch {
    padding: 7px 10px;
    margin-bottom: 6px;
  }
  .logout-btn {
    padding: 8px;
  }

  /* Main content adjustments */
  .main-content {
    margin-left: 0;
    padding-top: calc(76px + env(safe-area-inset-top, 0px));
    max-width: 100vw;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  #dashboardView,
  #dashboardView .content-grid,
  #dashboardView .dashboard-side-column,
  #dashboardView .card,
  #dashboardView .card-body,
  #dashboardView .task-list {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #dashboardView :where(.task-title, .activity-text, .workload-name) {
    overflow-wrap: anywhere;
  }

  .top-bar {
    position: relative;
    top: 0;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .top-bar-left {
    display: none; /* Hide breadcrumb on mobile */
  }

  .top-bar-center {
    order: 1;
    width: 100%;
    justify-content: center;
  }

  .top-bar-right {
    display: none; /* User info in mobile header instead */
  }

  /* Stats grid - 2 columns on tablet, 1 on phone */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Cards */
  .card { border-radius: var(--radius-lg); }
  .card-header { padding: 12px 16px; }

  /* Task panel full width overlay — above bottom nav (z-index: 9999) */
  .task-panel-overlay {
    z-index: 10000;
  }
  .task-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 10001;
    border-radius: 0;
  }
  .panel-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    position: sticky;
    bottom: 0;
    z-index: 10;
  }

  .info-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .info-item { padding: 10px 12px; }
  .info-label { font-size: 10px; }
  .info-value { font-size: 13px; }

  /* Activity timeline - word wrap */
  .timeline-text { font-size: 13px; word-break: break-word; }
  .timeline-header { flex-wrap: wrap; gap: 2px; }

  /* Schedule controls stack */
  .schedule-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .schedule-nav-buttons { width: 100%; justify-content: center; }
  .schedule-view-toggle { width: 100%; justify-content: center; }

  /* Week grid horizontal scroll */
  .schedule-week-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }

  .schedule-day {
    min-width: 140px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  /* Who's Out week calendar scroll */
  .week-calendar-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .week-day-column {
    min-width: 100px;
    flex-shrink: 0;
  }

  /* Month view adjustments */
  .schedule-month-day {
    min-height: 80px;
    padding: 4px;
  }

  .month-absence-chip {
    font-size: 0.65rem;
    padding: 2px 4px;
  }

  /* Forms full width */
  .form-row { grid-template-columns: 1fr; }

  .task-scope-bar {
    gap: 6px;
    margin-top: 0;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .task-scope-btn {
    justify-content: center;
    width: auto;
    flex: 0 0 auto;
    padding-inline: 12px;
    scroll-snap-align: start;
  }

  #tasksView .filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  #tasksView .filter-bar .search-box {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  #tasksView .filter-bar .filter-select {
    width: 100%;
    min-width: 0;
  }

  #tasksView .filter-bar .multi-select-dropdown.filter-select {
    padding: 0;
    border: 0;
    background: transparent;
  }

  #tasksView .filter-bar .multi-select-trigger {
    width: 100%;
    min-width: 0;
  }

  /* Modal adjustments */
  .add-person-modal,
  .absence-detail-modal {
    width: auto;
    max-width: none;
    max-height: none;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    left: 12px;
    transform: none;
    border-radius: 18px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 10021;
  }

  .add-person-modal.active,
  .absence-detail-modal.active {
    display: flex;
    transform: none;
  }

  .modal-overlay-bg {
    z-index: 10020;
  }

  .modal-body-content {
    padding: 16px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #newTaskModal {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  }

  #newTaskModal .task-assignee-list {
    max-height: min(180px, 26vh);
  }

  #newTaskModal .modal-body-content {
    padding-bottom: 24px;
  }

  .modal-footer-bar {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    position: sticky;
    bottom: 0;
    z-index: 1;
  }

  /* Larger touch targets */
  .btn { min-height: 44px; padding: 10px 16px; }
  .filter-select { min-height: 44px; }
  .form-input { min-height: 44px; padding: 10px 12px; }

  .nav-link {
    padding: 14px 16px;
    min-height: 48px;
  }

  /* Task view modes remain user-selectable on mobile. */
  #tasksView #taskTableView {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  #tasksView #taskTableView .task-table { display: table; min-width: 960px; }
  #tasksView .task-card-grid { grid-template-columns: 1fr; gap: 12px; }
  #tasksView .kanban-board { grid-template-columns: 1fr; min-height: 0; }
  #tasksView .kanban-cards { overflow-y: visible; }
  #tasksView .task-list-row {
    min-height: 48px;
    grid-template-columns: 4px minmax(0, 1fr) auto;
    grid-template-areas:
      "signal main status"
      "signal assignee due";
    gap: 2px 8px;
    padding: 7px 9px;
  }
  #tasksView .task-list-signal { grid-area: signal; height: 34px; }
  #tasksView .task-list-main { grid-area: main; }
  #tasksView .task-list-summary { display: none; }
  #tasksView .task-list-labels { display: none; }
  #tasksView .task-list-row > .status-badge { grid-area: status; justify-self: end; }
  #tasksView .task-list-assignee { grid-area: assignee; }
  #tasksView .task-list-due { grid-area: due; }
  #tasksView .task-list-assignee .mini-avatar { display: none; }
  #tasksView .task-list-assignee,
  #tasksView .task-list-due { font-size: 0.7rem; }

  /* ========================================== */
  /* Inventory & PTO Tables Mobile Scroll Fix */
  /* ========================================== */
  /* Single horizontal scroll with touch-friendly scrolling */
  #inventoryView .task-table-container,
  .people-table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    border-radius: var(--radius-lg);
    padding-bottom: 4px;
  }

  #inventoryView .task-table {
    display: table !important; /* Override task table hide for inventory */
    min-width: 600px; /* Ensure table scrolls rather than squishes */
  }

  .people-table {
    min-width: 500px;
  }

  /* PTO Balance table responsive wrapper */
  #ptoBalanceTable:not(.pm-bal-table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  #ptoBalanceTable:not(.pm-bal-table) th,
  #ptoBalanceTable:not(.pm-bal-table) td {
    white-space: nowrap;
    padding: 8px 10px !important;
    font-size: 11px !important;
  }

  /* Scroll indicator shadow for tables */
  #inventoryView .task-table-container::after,
  .people-table-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
    border-radius: 0 12px 12px 0;
  }

  /* Popover adjustments */
  .schedule-popover {
    left: 16px !important;
    right: 16px !important;
    max-width: none;
  }

  /* Toast container on mobile */
  #toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  /* Console stats */
  .console-stats { grid-template-columns: repeat(2, 1fr); }

  /* ========================================== */
  /* Command Center / Leadership Page Mobile */
  /* ========================================== */
  .console-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .console-section {
    padding: 16px;
  }

  .console-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  /* ========================================== */
  /* Who's Out Page Mobile */
  /* ========================================== */
  .whosout-stats-row {
    flex-direction: column !important;
    gap: 12px;
  }

  .whosout-main-grid {
    grid-template-columns: 1fr !important;
  }

  .whosout-item {
    padding: 12px;
  }

  .whosout-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .whosout-name {
    font-size: 0.95rem;
  }

  .whosout-detail {
    font-size: 0.8rem;
  }

  .whosout-badges {
    flex-wrap: wrap;
    gap: 6px;
  }

  .whosout-type-badge,
  .whosout-company-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .whosout-days-until {
    font-size: 0.75rem;
  }

  /* ========================================== */
  /* Schedule Page Mobile */
  /* ========================================== */
  .schedule-week-grid {
    display: block !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .schedule-week-grid > div {
    min-width: 280px;
  }

  .schedule-day-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .schedule-day-content {
    padding: 8px;
    min-height: 80px;
  }

  .schedule-absence-item {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .schedule-absence-name {
    font-size: 0.9rem;
  }

  .schedule-absence-type {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  /* ========================================== */
  /* Admin Page Mobile */
  /* ========================================== */
  .admin-section {
    padding: 16px;
  }

  .admin-section h3 {
    font-size: 1rem;
  }

  .admin-user-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-user-card {
    padding: 12px;
  }

  .admin-actions {
    flex-direction: column;
    gap: 8px;
  }

  .admin-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Admin form on mobile */
  .admin-form-row {
    flex-direction: column;
    gap: 12px;
  }

  .admin-form-row .form-group {
    width: 100%;
  }

  /* User list table to cards */
  .user-list-table {
    display: none;
  }

  .user-list-mobile {
    display: block !important;
  }

  /* ========================================== */
  /* Common Page Header Mobile */
  /* ========================================== */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-actions .btn {
    flex: 1 1 160px;
    justify-content: center;
  }

  .header-actions--compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .header-actions--compact .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    padding: 8px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .task-page-actions {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    align-self: flex-start;
    gap: 4px;
    padding: 3px;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-secondary);
    box-sizing: border-box;
    scrollbar-width: thin;
  }

  .task-page-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    padding-inline: 10px;
    border-radius: 8px;
    box-shadow: none;
  }

  .team-dashboard-actions {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    align-self: flex-start;
    gap: 4px;
    padding: 3px;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-secondary);
    box-sizing: border-box;
    scrollbar-width: thin;
  }

  .team-dashboard-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    padding-inline: 10px;
    border-radius: 8px;
    box-shadow: none;
  }

  .header-actions--dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .header-actions--dashboard .btn {
    width: 100%;
    min-width: 0;
  }

  .dashboard-action-bar {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    align-self: flex-start;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-secondary);
    box-sizing: border-box;
  }

  .dashboard-action-bar .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    padding-inline: 10px;
    border-radius: 8px;
    box-shadow: none;
  }

  .task-action-label--compact,
  .dashboard-action-label--compact,
  .team-dashboard-action-label--compact,
  .task-scope-label--compact {
    display: none;
  }

  .page-header h2 {
    font-size: 1.25rem;
  }

  .page-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-header-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* ========================================== */
  /* Cards & Sections Mobile */
  /* ========================================== */
  .section-grid {
    grid-template-columns: 1fr !important;
  }

  .card-grid {
    grid-template-columns: 1fr !important;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }

  .metric-card {
    padding: 12px;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .metric-label {
    font-size: 0.75rem;
  }

  /* Photo upload section */
  #timeOffPhotoSection {
    padding: 16px;
  }

  #timeOffPhotoPreview img {
    max-width: 100%;
  }

  /* Bottom Navigation Bar */
  .bottom-nav {
    display: flex !important;
  }

  /* Adjust main content for bottom nav */
  .main-content {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  body.modal-open .bottom-nav {
    display: none !important;
  }

  /* Position toast above bottom nav */
  #toast-container {
    bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }
}

/* Bottom Navigation Bar (hidden by default, shown on mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  z-index: 9999;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 8px;
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  /* Prevent transform/filter on ancestors from breaking fixed positioning */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s;
  min-width: 64px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.bottom-nav-item.active {
  color: var(--accent-green);
}

.bottom-nav-item.active .bottom-nav-icon {
  background: var(--accent-green-light);
}

.bottom-nav-icon {
  font-size: 1.25rem;
  margin-bottom: 2px;
  width: 40px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  transition: background 0.2s;
}

.bottom-nav-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  .mobile-header { padding-left: 56px; }

  .stats-grid { grid-template-columns: 1fr; }
  #dashboardView > .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-stats { grid-template-columns: 1fr; }

  .week-day-column { min-width: 85px; }
  .schedule-day { min-width: 120px; }

  .top-bar-center .company-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .card-header h3 { font-size: 1rem; }

  .header-actions {
    flex-direction: column;
  }

  .header-actions--compact {
    flex-direction: row;
  }

  .header-actions .btn,
  .dashboard-mini-stats-grid {
    width: 100%;
  }

  .header-actions--compact .btn {
    width: auto;
  }

  .task-scope-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    width: 100%;
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .task-scope-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 3px;
    gap: 2px;
    font-size: 0.72rem;
    line-height: 1.1;
    white-space: normal;
  }

  #tasksView .pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-inline: 10px;
  }

  #tasksView .pagination-info {
    text-align: center;
  }

  #tasksView .pagination-controls {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .task-page-actions .btn {
    width: auto;
    font-size: 0.76rem;
    gap: 4px;
    padding-inline: 8px;
  }

  .task-action-label--full,
  .dashboard-action-label--full,
  .team-dashboard-action-label--full,
  .task-scope-label--full {
    display: none;
  }

  .task-action-label--compact,
  .dashboard-action-label--compact,
  .team-dashboard-action-label--compact,
  .task-scope-label--compact {
    display: inline;
  }

  .team-dashboard-actions .btn {
    padding-inline: 7px;
    gap: 3px;
    font-size: 0.76rem;
  }

  .stat-card {
    min-width: 0;
    padding: 14px;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .dashboard-mini-stats-grid {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .view-all {
    width: 100%;
  }

  .task-item,
  .activity-item,
  .workload-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .task-item {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 12px;
  }

  .task-signal {
    margin-top: 4px;
  }

  .task-content {
    flex: 1 1 calc(100% - 24px);
  }

  .task-due {
    width: 100%;
    margin-left: 26px;
    white-space: normal;
    text-align: left;
  }

  .task-meta {
    gap: 6px 8px;
  }

  .task-meta span,
  .task-card-type,
  .task-card-due,
  .bottom-nav-label {
    white-space: normal;
  }

  .task-title,
  .activity-text,
  .task-card-title,
  .task-card-summary,
  .task-card-assignee span {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .task-card {
    padding: 12px;
  }

  .task-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .task-card-title,
  .task-card-status,
  .task-card-meta,
  .task-card-assignee {
    width: 100%;
  }

  .task-card-status {
    white-space: normal;
  }

  .task-card-footer {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .task-card-assignee {
    min-width: 0;
  }

  .workload-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 10px;
  }

  .workload-count {
    width: 100%;
  }

  /* Login card */
  .login-card { padding: 24px 20px; }
  .pin-input { width: 45px; height: 55px; font-size: 1.5rem; }

  /* Absence modal */
  .absence-detail-header { padding: 16px; gap: 12px; }
  .absence-detail-avatar { width: 44px; height: 44px; font-size: 1rem; }
  .absence-detail-title h3 { font-size: 1.1rem; }
  .absence-detail-body { padding: 16px; }
  .absence-detail-row { margin-bottom: 12px; }
  .absence-detail-icon { width: 32px; height: 32px; font-size: 0.9rem; }

  /* Command Center small mobile */
  .console-section h3 { font-size: 0.9rem; }

  /* Who's Out small mobile */
  .whosout-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .whosout-badges {
    width: 100%;
    justify-content: flex-start;
  }

  /* Schedule small mobile */
  .schedule-week-grid > div {
    min-width: 100%;
  }

  /* Admin small mobile */
  .admin-user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Metrics grid single column */
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .metric-value {
    font-size: 1.25rem;
  }

  /* Page headers stacked */
  .page-header-actions .btn {
    width: 100%;
    flex: none;
  }

  /* Feedback button - back to left on mobile when sidebar is hidden */
  .feedback-btn {
    left: 24px;
  }
}

/* Tablet breakpoint - adjust feedback button for narrower sidebar */
@media (max-width: 1024px) and (min-width: 769px) {
  .feedback-btn {
    left: 264px; /* 240px sidebar + 24px margin */
  }
}

/* Touch feedback for interactive elements */
.pto-row:hover { background: var(--bg-primary); }
.pto-row:active { background: var(--bg-secondary); }

@media (hover: none) and (pointer: coarse) {
  .nav-link:active,
  .btn:active,
  .company-btn:active,
  .schedule-day:active,
  .week-absence-chip:active,
  .schedule-absence-item:active {
    opacity: 0.8;
    transform: scale(0.98);
  }

  /* Show delete button on touch devices after long press */
  .week-absence-chip.touch-active .absence-delete-btn,
  .schedule-absence-item.touch-active .absence-delete-btn {
    opacity: 0.6;
    visibility: visible;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Import Progress Banner */
.import-progress-banner {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: white;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.import-progress-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.import-progress-icon {
  font-size: 1.5rem;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.import-progress-text {
  flex: 1;
}
.import-progress-text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}
.import-progress-text span {
  font-size: 0.85rem;
  opacity: 0.9;
}
.import-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}
.import-progress-fill {
  height: 100%;
  background: var(--bg-card);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.import-progress-banner.success {
  background: linear-gradient(135deg, #10b981 0%, var(--accent-emerald) 100%);
}
.import-progress-banner.error {
  background: linear-gradient(135deg, var(--red-500) 0%, var(--accent-red) 100%);
}

/* Toast container (dynamically created by showToast in ui.js) */
/* Styles are inline — no CSS needed */

/* Feedback Button - positioned right of sidebar */
.feedback-btn {
  position: fixed;
  bottom: 24px;
  left: 304px; /* 280px sidebar + 24px margin */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
  z-index: 100;
}

.feedback-btn:hover {
  background: var(--accent-green-light);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.feedback-btn svg {
  width: 18px;
  height: 18px;
}

/* M2 mobile/tablet interaction geometry: preserve the existing visual system
   while giving every persistent Portal action a full 44px touch target. */
@media (max-width: 1180px) {
  .skip-link,
  .notification-bell,
  .desktop-notification-bell,
  .cmd-trigger,
  .nav-item,
  .theme-switch,
  .logout-btn,
  .quick-action-btn,
  .view-all,
  #shawnTaskToggle,
  .to-btn.ghost,
  .voc-button,
  .voc-tab-button,
  .voc-back-link,
  .back-link,
  .guide-faq-item summary {
    min-height: 44px;
  }

  .notification-bell,
  .desktop-notification-bell {
    min-width: 44px;
  }

  .view-all,
  .voc-back-link,
  .back-link,
  .guide-faq-item summary {
    display: inline-flex;
    align-items: center;
  }

  .guide-faq-item summary {
    width: 100%;
  }
}

/* A phone rotated into landscape crosses the desktop-sidebar breakpoint while
   retaining a very short viewport. Compact the non-navigation chrome so the
   navigation owns a real scrollport and every focused item can scroll fully
   between the header and footer, including at 200% text size. */
@media (min-width: 769px) and (max-height: 600px) {
  .sidebar {
    overflow: hidden;
  }

  .sidebar-header {
    flex-shrink: 0;
    padding: 6px 12px;
  }

  .sidebar-logo,
  .user-details .role {
    display: none;
  }

  .user-info {
    gap: 6px;
    padding: 4px 6px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .cmd-trigger {
    flex-shrink: 0;
    min-height: 44px;
    margin-bottom: 4px;
  }

  .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
    scroll-padding-block: 8px;
  }

  .sidebar-nav :is(a, button, [tabindex]) {
    scroll-margin-block: 8px;
  }

  .sidebar-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px 12px;
  }

  .sidebar-footer .theme-switch,
  .sidebar-footer .logout-btn {
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0;
  }

  .sidebar-footer .theme-switch {
    justify-content: center;
  }

  .sidebar-footer .theme-switch .label,
  .sidebar-footer .logout-label {
    display: none;
  }
}

/* Feedback and chat remain available from Portal navigation. On compact
   layouts, removing the duplicate floating launchers prevents them from
   covering forms, tables, and the persistent bottom navigation. */
@media (max-width: 768px) {
  .feedback-btn,
  #chatWidget,
  .easter-egg {
    display: none !important;
  }
}

/* Modal Overlay (for reassign, etc.) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.active {
  display: flex;
}
.modal-overlay .modal {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  max-width: 400px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.modal-overlay .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-overlay .modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-overlay .modal-body {
  padding: 20px;
}
.modal-overlay .modal-body .form-group {
  margin-bottom: 16px;
}
.modal-overlay .modal-body .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.modal-overlay .modal-body .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text-primary);
}
.modal-overlay .modal-body .form-group select:focus {
  outline: none;
  border-color: var(--accent-green);
}
.modal-overlay .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Feedback Modal */
.feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.feedback-modal.visible {
  opacity: 1;
  visibility: visible;
}

.feedback-modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s;
}

.feedback-modal.visible .feedback-modal-content {
  transform: scale(1) translateY(0);
}

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

.feedback-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.feedback-close-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.feedback-close-btn:hover {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

.feedback-modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.feedback-type-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.feedback-type-option {
  padding: 12px;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.feedback-type-option:hover {
  background: var(--bg-card-alt);
}

.feedback-type-option.selected {
  border-color: var(--accent-green);
  background: var(--accent-green-light);
}

.feedback-type-option .icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.feedback-type-option .label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.feedback-form-group {
  margin-bottom: 16px;
}

.feedback-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.feedback-input, .feedback-textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.feedback-input:focus, .feedback-textarea:focus {
  outline: none;
  border-color: var(--accent-green);
}

.feedback-textarea {
  min-height: 120px;
  resize: vertical;
}

.feedback-submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent-green);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.feedback-submit-btn:hover {
  opacity: 0.9;
}

.feedback-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Notification Bell */
.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.notification-bell:hover {
  background: var(--bg-card-alt);
  color: var(--accent-green);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--accent-red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.notification-badge.hidden {
  display: none;
}

.notification-dropdown {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
}

.notification-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.notification-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--accent-green);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.mark-all-read:hover {
  text-decoration: underline;
}

.notification-list {
  max-height: calc(70vh - 60px);
  overflow-y: auto;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: var(--bg-secondary);
}

.notification-item.unread {
  background: var(--accent-blue-light);
}

.notification-item.unread:hover {
  background: rgba(37, 99, 235, 0.15);
}

.notification-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.notification-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.notification-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notification-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
}

.notification-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* Notification Dropdown - icon layout */
.notification-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notification-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  padding-top: 1px;
}

.notification-item-body {
  flex: 1;
  min-width: 0;
}

.notification-footer {
  padding: 12px 16px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.notification-view-all {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-green);
  cursor: pointer;
  text-decoration: none;
}

.notification-view-all:hover {
  text-decoration: underline;
}

/* ==================== FULL NOTIFICATIONS VIEW ==================== */

.notif-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.notif-filter-tab {
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.notif-filter-tab:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.notif-filter-tab.active {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

.notif-date-group {
  border-bottom: 1px solid var(--border-subtle);
}

.notif-date-group:last-child {
  border-bottom: none;
}

.notif-date-label {
  padding: 10px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.notif-full-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

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

.notif-full-item:hover {
  background: var(--bg-secondary);
}

.notif-full-item.unread {
  background: rgba(37, 99, 235, 0.06);
}

.notif-full-item.unread:hover {
  background: rgba(37, 99, 235, 0.1);
}

.notif-full-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  padding-top: 2px;
}

.notif-full-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.notif-full-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.notif-full-title {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-full-item.unread .notif-full-title {
  font-weight: 700;
}

.notif-full-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-full-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.notif-full-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.notif-full-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.notif-full-item:hover .notif-full-actions {
  opacity: 1;
}

.notif-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.notif-action-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.notif-delete-btn:hover {
  border-color: var(--red-500);
  color: var(--red-500);
}

/* Mobile responsive for notifications */
@media (max-width: 768px) {
  .notif-full-header {
    flex-direction: column;
    gap: 2px;
  }

  .notif-full-actions {
    opacity: 1;
  }

  .notification-dropdown {
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* Rain Day Button */
.rain-day-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}
.rain-day-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}
@media (max-width: 640px) {
  .rain-day-btn-text { display: none; }
  #rdcWeatherRow { grid-template-columns: 1fr !important; }

  /* Task list cards - compact mobile */
  .task-card { padding: 12px 14px; }
  .task-card-title { font-size: 15px; line-height: 1.3; }
  .task-card-meta { flex-wrap: wrap; gap: 4px; }
  .task-badge { font-size: 11px; padding: 3px 8px; }

  /* Task detail panel - mobile */
  #panelTitle, .panel-title {
    font-size: 18px;
    line-height: 1.35;
    word-break: break-word;
    max-height: 4em;
    overflow: hidden;
  }
  .panel-header {
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .panel-header-left {
    flex: 1 1 100%;
    min-width: 0;
    text-align: left;
  }
  .panel-header-right {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    z-index: 5;
  }
  .panel-header-right .icon-btn:not(.close) {
    display: none;
  }
  .panel-header-right .icon-btn.close {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .panel-header {
    position: relative;
  }
  .panel-title, #panelTitle {
    font-size: 17px;
    line-height: 1.35;
    word-break: break-word;
    padding-right: 40px;
    text-align: left;
  }
  .task-type-badge {
    font-size: 10px;
    padding: 4px 10px;
    margin-bottom: 8px;
  }
  .panel-header-meta { font-size: 11px; color: #9ca3af; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  /* Task type section header */
  .section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle, #f0f0f0);
  }

  /* Type action buttons */
  #panelTypeActions { margin-top: 0; padding: 0 0 4px; }
  #panelTypeActions .btn { font-size: 14px; padding: 12px 8px; }
  #panelTypeActions select.form-input, #panelTypeActions input.form-input {
    font-size: 15px;
    padding: 10px 12px;
  }
}

/* Launch Console */
.launch-console-section { margin-bottom: 24px; }
.launch-trigger {
  width: 100%; display: flex; align-items: center; gap: 16px; padding: 18px 24px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border: none; border-radius: var(--radius-lg); cursor: pointer; text-align: left;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 15px rgba(220,38,38,0.25);
}
.launch-trigger:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(220,38,38,0.35); }
.launch-trigger.open { border-radius: 12px 12px 0 0; }
.launch-trigger-icon { font-size: 28px; animation: iconPulse 2s ease infinite; }
@keyframes iconPulse { 0%,100%{transform:scale(1);opacity:1;} 50%{transform:scale(1.1);opacity:0.85;} }
.launch-trigger-text { flex: 1; }
.launch-trigger-title { display: block; font-size: 16px; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: 1.5px; }
.launch-trigger-subtitle { display: block; font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 2px; }
.launch-trigger-chevron { font-size: 18px; color: white; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1); }
.launch-trigger.open .launch-trigger-chevron { transform: rotate(180deg); }
.launch-console-panel { max-height: 0; overflow: hidden; transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1); }
.launch-console-panel.open { max-height: 600px; }
.launch-console-wrapper {
  background: linear-gradient(180deg, #1a1f2e 0%, #0f1219 100%);
  border-radius: 0 0 12px 12px; padding: 28px; position: relative; overflow: hidden;
}
.launch-console-wrapper::before {
  content:''; position:absolute; top:0; left:0; right:0; bottom:0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 25px 25px; pointer-events: none;
}
.console-status-panel {
  background: #000; border: 2px solid #1a3a2a; border-radius: var(--radius-md);
  padding: 14px 20px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.console-status-panel::before {
  content:''; position:absolute; top:0; left:-100%; width:100%; height:100%;
  background: linear-gradient(90deg, transparent, rgba(45,90,61,0.1), transparent);
  animation: scanline 4s linear infinite;
}
@keyframes scanline { 0%{left:-100%;} 100%{left:100%;} }
.console-status-text {
  font-family: 'Courier New', monospace; color: #4ade80; font-size: 13px;
  text-align: center; text-transform: uppercase; letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(74,222,128,0.5); position: relative;
}
.console-status-text.warning { color: #f87171; text-shadow: 0 0 8px rgba(248,113,113,0.6); animation: statusBlink 0.5s ease infinite; }
.console-status-text.armed { color: #fbbf24; text-shadow: 0 0 12px rgba(251,191,36,0.7); animation: statusBlink 0.8s ease infinite; }
@keyframes statusBlink { 0%,100%{opacity:1;} 50%{opacity:0.6;} }
.console-layout { display: grid; grid-template-columns: 1fr 200px 1fr; gap: 28px; align-items: center; position: relative; z-index: 1; }
@media (max-width: 800px) { .console-layout { grid-template-columns: 1fr; gap: 24px; } .console-key-section { flex-direction: row !important; justify-content: center; } }
.console-key-section { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.console-key-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }
.console-key-slot {
  width: 90px; height: 90px; background: linear-gradient(145deg, #1e2433, #0c0f15);
  border-radius: 50%; border: 3px solid #2d3748; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.5);
}
.console-key-slot:hover { border-color: #fbbf24; box-shadow: inset 0 4px 12px rgba(0,0,0,0.5), 0 0 20px rgba(251,191,36,0.2); }
.console-key-visual { width: 6px; height: 28px; background: #374151; border-radius: 2px; position: relative; transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1); }
.console-key-visual::before {
  content:''; position:absolute; top:-14px; left:50%; transform:translateX(-50%);
  width:18px; height:18px; border:3px solid #374151; border-radius:50%; transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.console-key-slot.inserted .console-key-visual { width:18px; background:linear-gradient(180deg,#fbbf24,#f59e0b); box-shadow:0 0 15px rgba(251,191,36,0.5); }
.console-key-slot.inserted .console-key-visual::before { border-color:#fbbf24; background:linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow:0 0 10px rgba(251,191,36,0.4); }
.console-key-slot.turned .console-key-visual { transform: rotate(90deg); }
.console-key-lights { display: flex; gap: 10px; }
.console-key-light { width:10px; height:10px; border-radius:50%; background:#1f2937; border:2px solid #374151; transition:all 0.3s ease; }
.console-key-light.inserted { background:#fbbf24; border-color:#fbbf24; box-shadow:0 0 8px #fbbf24; }
.console-key-light.turned { background:#4ade80; border-color:#4ade80; box-shadow:0 0 8px #4ade80; }
.console-button-section { display: flex; justify-content: center; }
.console-glass-assembly { position: relative; width: 160px; height: 180px; perspective: 800px; }
.console-glass-lid {
  position:absolute; top:0; left:0; right:0; height:90px;
  background:linear-gradient(180deg,rgba(255,255,255,0.15),rgba(255,255,255,0.05));
  border:2px solid rgba(255,255,255,0.2); border-bottom:none; border-radius:16px 16px 0 0;
  transform-origin:top center; transition:all 0.8s cubic-bezier(0.4,0,0.2,1);
  cursor:pointer; z-index:5; backdrop-filter:blur(4px);
}
.console-glass-lid::before { content:'🔒'; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:24px; opacity:0.5; transition:all 0.3s ease; }
.console-glass-lid::after { content:'LIFT TO ARM'; position:absolute; bottom:10px; left:50%; transform:translateX(-50%); font-size:9px; font-weight:700; color:rgba(255,255,255,0.4); letter-spacing:1.5px; white-space:nowrap; }
.console-glass-lid:hover { border-color:rgba(255,255,255,0.35); }
.console-glass-lid.unlocked::before { content:'🔓'; }
.console-glass-lid.unlocked:hover { border-color:rgba(251,191,36,0.5); }
.console-glass-lid.open { transform:rotateX(-120deg); opacity:0; pointer-events:none; }
.console-glass-lid.locked { cursor:not-allowed; }
.console-button-base {
  position:absolute; bottom:0; left:0; right:0; height:105px;
  background:linear-gradient(180deg,#252d3d,#1a202c); border:2px solid #374151;
  border-top:none; border-radius:0 0 16px 16px; display:flex; align-items:center;
  justify-content:center; box-shadow:inset 0 -8px 20px rgba(0,0,0,0.3);
}
.console-button-base::after {
  content:''; position:absolute; bottom:0; left:0; right:0; height:14px;
  background:repeating-linear-gradient(-55deg,#fbbf24,#fbbf24 10px,#1a202c 10px,#1a202c 20px);
  border-radius:0 0 14px 14px;
}
.console-rain-button { width:90px; height:90px; border-radius:50%; border:none; cursor:not-allowed; position:relative; margin-bottom:8px; transition:all 0.2s ease; }
.console-button-rim { position:absolute; top:0; left:0; width:100%; height:100%; border-radius:50%; background:linear-gradient(145deg,#374151,#1f2937); box-shadow:0 6px 20px rgba(0,0,0,0.4); }
.console-button-top {
  position:absolute; top:7px; left:7px; width:calc(100% - 14px); height:calc(100% - 14px);
  border-radius:50%; background:linear-gradient(145deg,#4b5563,#374151); display:flex;
  flex-direction:column; align-items:center; justify-content:center; transition:all 0.2s ease;
  box-shadow:inset 0 -4px 12px rgba(0,0,0,0.3);
}
.console-rain-button.armed { cursor:pointer; }
.console-rain-button.armed .console-button-top {
  background:linear-gradient(145deg,#ef4444,#b91c1c);
  box-shadow:0 0 35px rgba(239,68,68,0.5),inset 0 -4px 12px rgba(0,0,0,0.2);
  animation:buttonGlow 1.5s ease infinite;
}
@keyframes buttonGlow {
  0%,100%{box-shadow:0 0 35px rgba(239,68,68,0.5),inset 0 -4px 12px rgba(0,0,0,0.2);}
  50%{box-shadow:0 0 55px rgba(239,68,68,0.7),0 0 80px rgba(239,68,68,0.3),inset 0 -4px 12px rgba(0,0,0,0.2);}
}
.console-rain-button.armed:hover .console-button-top { transform:scale(1.05); }
.console-rain-button.armed:active .console-button-top { transform:scale(0.95); }
.console-button-icon { font-size:24px; filter:grayscale(100%) brightness(0.5); transition:all 0.3s ease; }
.console-rain-button.armed .console-button-icon { filter:none; }
.console-button-text { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:#6b7280; margin-top:2px; }
.console-rain-button.armed .console-button-text { color:white; text-shadow:0 1px 2px rgba(0,0,0,0.5); }
.console-progress { display:flex; justify-content:center; gap:24px; margin-top:24px; position:relative; z-index:1; }
.console-step { display:flex; align-items:center; gap:8px; color:#4b5563; font-size:12px; font-weight:500; transition:all 0.3s ease; }
.console-step.active { color:#fbbf24; }
.console-step.completed { color:#4ade80; }
.console-step-num {
  width:26px; height:26px; border-radius:50%; background:#1f2937; border:2px solid #374151;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; transition:all 0.3s ease;
}
.console-step.active .console-step-num { border-color:#fbbf24; background:rgba(251,191,36,0.15); color:#fbbf24; }
.console-step.completed .console-step-num { border-color:#4ade80; background:#4ade80; color:#000; }

/* Storm Overlay */
.storm-overlay {
  position:fixed; top:0; left:0; right:0; bottom:0;
  background:linear-gradient(180deg,#050510 0%,#0a0a20 30%,#101030 70%,#0a0a15 100%);
  z-index:10000; opacity:0; visibility:hidden; transition:all 0.8s cubic-bezier(0.4,0,0.2,1);
}
.storm-overlay.active { opacity:1; visibility:visible; }
.storm-rain { position:absolute; top:0; left:0; right:0; bottom:0; overflow:hidden; }
.storm-raindrop {
  position:absolute; width:2px;
  background:linear-gradient(180deg,transparent,rgba(150,180,220,0.5),rgba(150,180,220,0.7));
  border-radius:0 0 2px 2px; animation:rainFall linear infinite;
}
@keyframes rainFall { 0%{transform:translateY(-100vh) rotate(10deg);opacity:0;} 5%{opacity:1;} 95%{opacity:1;} 100%{transform:translateY(100vh) rotate(10deg);opacity:0;} }
.storm-clouds { position:absolute; top:0; left:0; right:0; height:50%; overflow:hidden; }
.storm-cloud { position:absolute; background:radial-gradient(ellipse,rgba(30,30,50,0.8) 0%,transparent 70%); border-radius:50%; filter:blur(40px); animation:cloudDrift linear infinite; }
@keyframes cloudDrift { 0%{transform:translateX(-100%);} 100%{transform:translateX(100vw);} }
.storm-lightning { position:absolute; top:0; left:0; right:0; bottom:0; background:white; opacity:0; z-index:5; }
.storm-lightning.flash { animation:lightningFlash 0.2s ease-out; }
@keyframes lightningFlash { 0%{opacity:0;} 5%{opacity:0.9;} 10%{opacity:0.15;} 15%{opacity:0.85;} 20%{opacity:0.1;} 25%{opacity:0.6;} 100%{opacity:0;} }
.storm-content { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center; z-index:10; }
.storm-icon { font-size:80px; margin-bottom:20px; animation:stormIconFloat 3s ease infinite; filter:drop-shadow(0 0 30px rgba(251,191,36,0.3)); }
@keyframes stormIconFloat { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-12px);} }
.storm-title { font-size:48px; font-weight:900; color:#fbbf24; text-transform:uppercase; letter-spacing:8px; margin-bottom:12px; text-shadow:0 0 30px rgba(251,191,36,0.6),0 4px 15px rgba(0,0,0,0.5); }
.storm-subtitle { font-size:16px; color:rgba(255,255,255,0.7); letter-spacing:4px; text-transform:uppercase; margin-bottom:8px; }
.storm-date { font-size:24px; color:#4ade80; font-weight:600; margin-bottom:40px; text-shadow:0 0 15px rgba(74,222,128,0.5); }
.storm-buttons { display:flex; gap:16px; justify-content:center; }
@media (max-width: 600px) {
  .storm-title { font-size:28px; letter-spacing:4px; }
  .storm-icon { font-size:60px; }
  .console-progress { flex-direction:column; align-items:center; gap:10px; }
}

/* Rain Day Modal */
.rain-day-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.rain-day-modal {
  background: var(--bg-card); border-radius: 16px; width: 90%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.rain-day-modal-header {
  padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between;
}
.rain-day-modal-header h2 { margin: 0; font-size: 1.25rem; }
.rain-day-modal-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--text-muted); padding: 4px 8px; border-radius: var(--radius-sm);
}
.rain-day-modal-close:hover { background: var(--bg-hover); }
.rain-day-modal-body { padding: 20px 24px; }
.rain-day-modal-body .form-group { margin-bottom: 16px; }
.rain-day-modal-body .form-label {
  display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--text-secondary);
}
.rain-day-modal-body .form-input,
.rain-day-modal-body .form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: inherit; font-size: 0.9rem; box-sizing: border-box;
}
.rain-day-modal-body .form-textarea { resize: vertical; min-height: 60px; }
.rain-day-modal-body .form-input:focus,
.rain-day-modal-body .form-textarea:focus { border-color: var(--blue-500); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.rd-pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.rd-pill {
  padding: 6px 14px; border-radius: var(--radius-xl); border: 2px solid var(--border);
  background: var(--bg-card); cursor: pointer; font-size: 0.85rem; font-weight: 500;
  transition: all 0.15s;
}
.rd-pill:hover { border-color: #93c5fd; background: #eff6ff; }
.rd-pill.selected { border-color: var(--blue-500); background: var(--blue-100); color: var(--blue-600); font-weight: 600; }
.rd-time-range { display: flex; align-items: center; gap: 10px; }
.rd-time-range input { flex: 1; }
.rd-time-range span { color: var(--text-muted); font-size: 0.85rem; }
.rain-day-stats-preview {
  background: #f0f9ff; border-radius: 10px; padding: 12px 16px; margin-top: 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.rain-day-stats-preview .stat-label { font-size: 0.85rem; color: #1e40af; }
.rain-day-stats-preview .stat-value { font-size: 1.5rem; font-weight: 800; color: #1d4ed8; }
.rain-day-modal-footer {
  padding: 16px 24px 20px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
}
.rain-day-modal-footer .rd-info { font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.rain-day-modal-footer .rd-submit {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white;
  padding: 12px; border: none; border-radius: 10px; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: all 0.2s;
}
.rain-day-modal-footer .rd-submit:hover { background: linear-gradient(135deg, #2563eb, #1e40af); }
.rain-day-modal-footer .rd-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Rain Day Dashboard Widget */
.rain-day-widget-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe; border-radius: var(--radius-lg); padding: 16px;
}
.rain-day-widget-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rain-day-widget-header h4 { margin: 0; font-size: 0.9rem; color: #1e40af; }
.rain-day-widget-count { font-size: 2rem; font-weight: 800; color: #1d4ed8; }
.rain-day-widget-label { font-size: 0.8rem; color: var(--blue-500); }
.rain-day-widget-last { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════ */
/* DRAINAGE RISK MAP VIEW — scoped under #drainageRiskView      */
/* ══════════════════════════════════════════════════════════════ */
#drainageRiskView .drm-page-header { margin-bottom: 20px; }
#drainageRiskView .drm-page-title {
  font-size: 24px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
}
#drainageRiskView .drm-page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

#drainageRiskView .drm-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px;
}
#drainageRiskView .drm-stat-card {
  background: var(--card-bg, #fff); border-radius: var(--radius-lg); padding: 20px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
#drainageRiskView .drm-stat-value { font-size: 28px; font-weight: 700; }
#drainageRiskView .drm-stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
#drainageRiskView .drm-stat-value.safe { color: var(--green-500); }
#drainageRiskView .drm-stat-value.caution { color: #eab308; }
#drainageRiskView .drm-stat-value.avoid { color: var(--red-500); }
#drainageRiskView .drm-stat-value.info { color: var(--accent-green, #2d5a3d); }

#drainageRiskView .drm-content-card {
  background: var(--card-bg, #fff); border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; overflow: hidden;
}
#drainageRiskView .drm-card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between;
}
#drainageRiskView .drm-card-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
#drainageRiskView .drm-card-header-actions { display: flex; align-items: center; gap: 8px; }
#drainageRiskView .drm-card-body { padding: 16px 20px; }
#drainageRiskView .drm-card-body.no-pad { padding: 0; }

#drainageRiskView .drm-view-toggle {
  display: inline-flex; background: var(--bg-secondary, #f5f7f5);
  border-radius: var(--radius-md); padding: 3px; gap: 2px;
}
#drainageRiskView .drm-view-toggle button {
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  border: none; background: transparent; color: #475569;
  cursor: pointer; transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
#drainageRiskView .drm-view-toggle button.active {
  background: var(--card-bg, #fff); color: #166534; font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Weather Bar */
#drainageRiskView .weather-bar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
#drainageRiskView .weather-bar.loading { opacity: 0.6; }
#drainageRiskView .weather-bar.error .weather-detail { color: var(--red-500); }
#drainageRiskView .weather-bar.hidden { display: none !important; }
#drainageRiskView .weather-status { display: flex; align-items: center; gap: 8px; }
#drainageRiskView .weather-icon { font-size: 22px; }
#drainageRiskView .weather-temp { font-size: 22px; font-weight: 700; }
#drainageRiskView .weather-detail { font-size: 12px; color: var(--text-muted); }
#drainageRiskView .weather-metrics { display: flex; gap: 16px; }
#drainageRiskView .weather-metric { text-align: center; }
#drainageRiskView .weather-metric .metric-label { display: block; font-size: 10px; color: var(--text-muted); }
#drainageRiskView .weather-metric .metric-value { display: block; font-size: 13px; font-weight: 600; }
#drainageRiskView .precip-summary { display: flex; gap: 16px; margin-left: auto; }
#drainageRiskView .precip-item { text-align: center; }
#drainageRiskView .precip-item span:first-child { display: block; font-size: 10px; color: var(--text-muted); }
#drainageRiskView .precip-item span:last-child { display: block; font-size: 13px; font-weight: 600; }
#drainageRiskView .last-updated { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
#drainageRiskView .btn-refresh {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  padding: 3px 10px; border-radius: 4px; font-family: 'Outfit', sans-serif;
  font-size: 11px; cursor: pointer; transition: all 0.2s;
}
#drainageRiskView .btn-refresh:hover { border-color: var(--accent-green, #2d5a3d); color: var(--accent-green, #2d5a3d); }

/* Controls Row */
#drainageRiskView .controls-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
#drainageRiskView .controls-row.hidden { display: none !important; }
#drainageRiskView .slider-group { display: flex; align-items: center; gap: 10px; }
#drainageRiskView .slider-group label { font-size: 13px; font-weight: 500; white-space: nowrap; }
#drainageRiskView .slider-value {
  font-size: 13px; font-weight: 600; color: var(--accent-green, #2d5a3d);
  background: var(--accent-green-light, #e8f4ea); padding: 2px 8px; border-radius: 4px;
  min-width: 36px; text-align: center;
}
#drainageRiskView input[type="range"] { height: 6px; -webkit-appearance: none; appearance: none; background: var(--border); border-radius: 3px; outline: none; }
#drainageRiskView input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: var(--accent-green, #2d5a3d); border-radius: 50%; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
#drainageRiskView input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; background: var(--accent-green, #2d5a3d); border-radius: 50%; cursor: pointer; border: none; }

/* Map Card */
#drainageRiskView .map-card { position: relative; }
#drainageRiskView .map-card .drm-card-body.no-pad { position: relative; }
#drainageRiskView #drm-map { width: 100%; height: calc(100vh - 380px); min-height: 450px; }
#drainageRiskView .leaflet-tile-pane { filter: grayscale(90%) brightness(1.05); }
[data-theme="dark"] #drainageRiskView .leaflet-tile-pane { filter: grayscale(90%) brightness(0.7) invert(1); }
#drainageRiskView .map-info {
  position: absolute; top: 12px; right: 12px; background: var(--card-bg, #fff);
  border-radius: var(--radius-md); padding: 6px 12px; font-size: 11px;
  font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.08); z-index: 400; color: var(--text-primary);
}
#drainageRiskView .drm-loading-overlay {
  position: absolute; inset: 0; background: rgba(255,255,255,0.8);
  display: flex; align-items: center; justify-content: center; z-index: 450; transition: opacity 0.3s;
}
[data-theme="dark"] #drainageRiskView .drm-loading-overlay { background: rgba(26,26,26,0.8); }
#drainageRiskView .loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent-green, #2d5a3d); border-radius: 50%; animation: drm-spin 0.8s linear infinite; }
@keyframes drm-spin { to { transform: rotate(360deg); } }

/* Quick Nav chips */
#drainageRiskView .quick-nav-overlay {
  position: absolute; top: 12px; left: 55px; z-index: 400;
  display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 200px);
}
#drainageRiskView .nav-chip {
  padding: 4px 10px; border-radius: 16px; font-size: 11px; font-weight: 500;
  background: var(--card-bg, #fff); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-family: 'Outfit', sans-serif; color: var(--text-primary);
}
#drainageRiskView .nav-chip:hover { border-color: var(--accent-green, #2d5a3d); color: var(--accent-green, #2d5a3d); }
#drainageRiskView .nav-chip.active { background: var(--accent-green, #2d5a3d); color: white; border-color: var(--accent-green, #2d5a3d); }

/* Legend Overlay */
#drainageRiskView .legend-overlay {
  position: absolute; bottom: 28px; left: 12px; z-index: 400;
  background: var(--card-bg, #fff); border-radius: var(--radius-md);
  padding: 10px 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); max-width: 200px;
}
#drainageRiskView .legend-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 6px; }
#drainageRiskView .legend-items { display: flex; flex-direction: column; gap: 3px; }
#drainageRiskView .legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; }
#drainageRiskView .legend-swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
#drainageRiskView .legend-label { flex: 1; font-weight: 500; }
#drainageRiskView .legend-range { color: var(--text-muted); font-size: 10px; }

/* Keep the global feedback launcher reachable beside the map legend. The
   legend intentionally sits above map content, so their default bottom-left
   positions must not overlap on pointer-based desktop layouts. */
@media (min-width: 1025px) {
  body:has(#drainageRiskView:not(.hidden)) .feedback-btn {
    left: 472px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  body:has(#drainageRiskView:not(.hidden)) .feedback-btn {
    left: 432px;
  }
}

/* Opacity control */
#drainageRiskView .opacity-control {
  position: absolute; bottom: 28px; right: 12px; z-index: 400;
  background: var(--card-bg, #fff); border-radius: var(--radius-md);
  padding: 8px 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 8px; font-size: 11px;
}
#drainageRiskView .opacity-control input[type="range"] { width: 80px; }

/* Detail Panel */
#drainageRiskView .detail-overlay {
  position: absolute; top: 0; right: 0; bottom: 0; width: 320px;
  background: color-mix(in srgb, var(--card-bg, #fff) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 450; overflow-y: auto; transform: translateX(100%);
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: transform 0.3s ease, opacity 0.2s ease, visibility 0s linear 0.3s;
  box-shadow: -2px 0 12px rgba(0,0,0,0.1);
  border-left: 1px solid var(--border);
}
#drainageRiskView .detail-overlay.open {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}
#drainageRiskView .detail-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
#drainageRiskView .detail-panel-header h4 { font-size: 14px; font-weight: 600; }
#drainageRiskView .detail-close {
  background: transparent; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-muted); width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
#drainageRiskView .detail-close:hover { background: var(--bg-secondary); }
#drainageRiskView .detail-body { padding: 16px; }

/* Detail panel inner styles */
#drainageRiskView .detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
#drainageRiskView .risk-badge { padding: 4px 12px; border-radius: var(--radius-xl); font-size: 12px; font-weight: 600; color: white; }
#drainageRiskView .detail-coord { font-size: 11px; color: var(--text-muted); }
#drainageRiskView .detail-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
#drainageRiskView .detail-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
#drainageRiskView .detail-section h4 { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 8px; }
#drainageRiskView .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#drainageRiskView .detail-item { display: flex; flex-direction: column; gap: 1px; }
#drainageRiskView .detail-item .label { font-size: 10px; color: var(--text-muted); }
#drainageRiskView .detail-item .value { font-size: 12px; font-weight: 600; }
#drainageRiskView .detail-rows { display: flex; flex-direction: column; gap: 6px; }
#drainageRiskView .detail-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
#drainageRiskView .detail-row .label { color: var(--text-muted); }
#drainageRiskView .detail-row .value { font-weight: 600; }
#drainageRiskView .dry-time-bar { width: 100%; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
#drainageRiskView .dry-time-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
#drainageRiskView .score-breakdown { display: flex; flex-direction: column; gap: 5px; }
#drainageRiskView .score-component { display: flex; align-items: center; gap: 6px; font-size: 10px; }
#drainageRiskView .score-component .comp-label { width: 82px; flex-shrink: 0; color: var(--text-muted); }
#drainageRiskView .score-component .comp-bar-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
#drainageRiskView .score-component .comp-bar-fill { height: 100%; border-radius: 3px; }
#drainageRiskView .score-component .comp-value { width: 26px; text-align: right; font-weight: 600; }
#drainageRiskView .score-composition { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
#drainageRiskView .score-composition strong { color: var(--text-primary); }
#drainageRiskView .drying-factors { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10px; color: var(--text-muted); margin-top: 4px; }
#drainageRiskView .drying-factors strong { color: var(--text-primary); }
#drainageRiskView .forecast-warning { margin-top: 6px; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; background: rgba(249,115,22,0.1); color: #ea580c; }
[data-theme="dark"] #drainageRiskView .forecast-warning { background: rgba(249,115,22,0.15); color: #fb923c; }
#drainageRiskView .rec-badge {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 11px;
  font-weight: 600; margin-top: 8px; text-align: center; line-height: 1.4;
}
#drainageRiskView .rec-badge.safe { background: rgba(34,197,94,0.12); color: var(--accent-green); }
#drainageRiskView .rec-badge.warning { background: rgba(234,179,8,0.12); color: #b45309; }
#drainageRiskView .rec-badge.danger { background: rgba(239,68,68,0.12); color: var(--accent-red); }
#drainageRiskView .rec-badge.extreme { background: rgba(153,27,27,0.15); color: #991b1b; }
[data-theme="dark"] #drainageRiskView .rec-badge.safe { background: rgba(34,197,94,0.15); color: #4ade80; }
[data-theme="dark"] #drainageRiskView .rec-badge.warning { background: rgba(234,179,8,0.15); color: #facc15; }
[data-theme="dark"] #drainageRiskView .rec-badge.danger { background: rgba(239,68,68,0.15); color: #f87171; }
[data-theme="dark"] #drainageRiskView .rec-badge.extreme { background: rgba(153,27,27,0.2); color: #fca5a5; }

/* Collapsible Panels */
#drainageRiskView .collapse-header {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 0;
  background: none; border: none; font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s; width: 100%; text-align: left;
}
#drainageRiskView .collapse-header:hover { color: var(--accent-green, #2d5a3d); }
#drainageRiskView .collapse-body { display: none; padding-top: 12px; }
#drainageRiskView .collapse-body.open { display: block; }
#drainageRiskView .collapse-body p { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
#drainageRiskView .collapse-body ul { font-size: 12px; color: var(--text-muted); line-height: 1.6; padding-left: 18px; margin-bottom: 10px; }
#drainageRiskView .weight-presets { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
#drainageRiskView .preset-btn {
  padding: 5px 12px; border: 1px solid var(--border); background: var(--card-bg, #fff);
  border-radius: 16px; font-family: 'Outfit', sans-serif; font-size: 11px;
  font-weight: 500; cursor: pointer; transition: all 0.2s; color: var(--text-primary);
}
#drainageRiskView .preset-btn.active { background: var(--accent-green, #2d5a3d); color: white; border-color: var(--accent-green, #2d5a3d); }
#drainageRiskView .weight-slider { margin-bottom: 6px; }
#drainageRiskView .weight-slider label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 2px; }
#drainageRiskView .weight-total { font-size: 12px; font-weight: 600; text-align: center; padding: 6px; border-radius: 4px; margin: 6px 0; }
#drainageRiskView .weight-total.valid { background: rgba(34,197,94,0.1); color: var(--accent-green); }
#drainageRiskView .weight-total.invalid { background: rgba(239,68,68,0.1); color: var(--accent-red); }
#drainageRiskView .split-note { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
#drainageRiskView .btn-reset {
  display: block; width: 100%; padding: 8px; border: 1px solid var(--border);
  background: var(--card-bg, #fff); border-radius: var(--radius-sm); font-family: 'Outfit', sans-serif;
  font-size: 12px; cursor: pointer; margin-top: 8px; color: var(--text-primary);
}
#drainageRiskView .btn-reset:hover { border-color: var(--accent-green, #2d5a3d); }
#drainageRiskView .info-weights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Education Panel */
#drainageRiskView .education-panel {
  background: var(--card-bg, #fff); border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; overflow: hidden;
}
#drainageRiskView .education-panel .drm-card-header { cursor: pointer; user-select: none; }
#drainageRiskView .education-panel .drm-card-header:hover { background: var(--bg-hover); }
#drainageRiskView .education-panel .drm-card-body { display: none; }
#drainageRiskView .education-panel .drm-card-body.open { display: block; }
#drainageRiskView .edu-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
#drainageRiskView .edu-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
#drainageRiskView .edu-section h4 {
  font-size: 14px; font-weight: 600; color: var(--accent-green, #2d5a3d);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] #drainageRiskView .edu-section h4 { color: #6ee7b7; }
#drainageRiskView .edu-section h5 { font-size: 12px; font-weight: 600; color: var(--text-primary); margin: 10px 0 4px; }
#drainageRiskView .edu-section p { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
#drainageRiskView .edu-section ul, #drainageRiskView .edu-section ol { font-size: 12px; color: var(--text-muted); line-height: 1.7; padding-left: 20px; margin-bottom: 10px; }
#drainageRiskView .edu-section li { margin-bottom: 3px; }
#drainageRiskView .edu-section strong { color: var(--text-primary); }
#drainageRiskView .edu-factor {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px;
  background: var(--bg-secondary); border-radius: var(--radius-sm); margin-bottom: 6px;
}
#drainageRiskView .edu-factor .factor-weight {
  flex-shrink: 0; width: 40px; height: 24px; border-radius: 4px;
  background: var(--accent-green, #2d5a3d); color: white; font-size: 11px;
  font-weight: 600; display: flex; align-items: center; justify-content: center;
}
#drainageRiskView .edu-factor .factor-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
#drainageRiskView .edu-factor .factor-desc strong { color: var(--text-primary); }
#drainageRiskView .edu-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
#drainageRiskView .edu-table th {
  background: var(--bg-hover); color: var(--text-primary); font-weight: 600;
  padding: 6px 10px; text-align: left; border: 1px solid var(--border);
}
#drainageRiskView .edu-table td { padding: 5px 10px; border: 1px solid var(--border); }
#drainageRiskView .edu-table tr:hover { background: var(--bg-secondary); }
#drainageRiskView .drm-badge-a { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; background: #dcfce7; color: #166534; }
#drainageRiskView .drm-badge-b { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; background: #ecfccb; color: #3f6212; }
#drainageRiskView .drm-badge-c { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; background: #fef9c3; color: #854d0e; }
#drainageRiskView .drm-badge-d { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; background: #fee2e2; color: #991b1b; }
[data-theme="dark"] #drainageRiskView .drm-badge-a { background: rgba(34,197,94,0.2); color: #86efac; }
[data-theme="dark"] #drainageRiskView .drm-badge-b { background: rgba(132,204,22,0.2); color: #bef264; }
[data-theme="dark"] #drainageRiskView .drm-badge-c { background: rgba(234,179,8,0.2); color: #fde047; }
[data-theme="dark"] #drainageRiskView .drm-badge-d { background: rgba(239,68,68,0.2); color: #fca5a5; }
[data-theme="dark"] #drainageRiskView .edu-factor { background: #1e1e1e; }
[data-theme="dark"] #drainageRiskView .edu-table th { background: #2a2a2a; }

/* Leaflet popup overrides */
#drainageRiskView .leaflet-popup-content-wrapper { border-radius: 8px !important; font-family: 'Outfit', sans-serif !important; box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important; }
#drainageRiskView .leaflet-popup-content { margin: 12px 16px !important; font-size: 13px !important; line-height: 1.5 !important; }
#drainageRiskView .popup-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
#drainageRiskView .popup-risk { display: inline-block; padding: 2px 8px; border-radius: var(--radius-lg); font-size: 11px; font-weight: 600; color: white; margin-bottom: 6px; }
#drainageRiskView .popup-detail { color: var(--text-muted); font-size: 12px; }

/* Responsive */
@media (max-width: 768px) {
  #drainageRiskView .drm-stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  #drainageRiskView .drm-stat-card { padding: 14px; }
  #drainageRiskView .drm-stat-value { font-size: 22px; }
  #drainageRiskView #drm-map { height: calc(100dvh - 320px); min-height: 350px; }
  #drainageRiskView .quick-nav-overlay { max-width: calc(100% - 100px); overflow-x: auto; flex-wrap: nowrap; }
  #drainageRiskView .weather-bar { flex-direction: column; gap: 8px; }
  #drainageRiskView .weather-metrics { gap: 10px; }
  #drainageRiskView .precip-summary { margin-left: 0; }
  #drainageRiskView .detail-overlay {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 70vh; border-radius: 16px 16px 0 0;
    transform: translateY(100%); border-left: none; border-top: 1px solid var(--border);
  }
  #drainageRiskView .detail-overlay.open { transform: translateY(0); }
  #drainageRiskView .info-weights-grid { grid-template-columns: 1fr; }
  #drainageRiskView .controls-row { gap: 12px; }
}

/* ==================== INVENTORY VIEW ==================== */
.inv-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.inv-tabs::-webkit-scrollbar { display: none; }

.inv-tab-btn {
  padding: 10px 18px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.inv-tab-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.inv-tab-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.inv-tab-content {
  animation: fadeIn 0.2s ease;
}

/* Inventory status badges */
.inv-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
}

.inv-status.ok {
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.inv-status.low {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

.inv-status.out {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

/* Inventory compliance cards */
.inv-compliance-good { border-left: 3px solid var(--accent-green); }
.inv-compliance-warn { border-left: 3px solid var(--accent-amber); }
.inv-compliance-bad { border-left: 3px solid var(--accent-red); }

@media (max-width: 768px) {
  .inv-tabs { gap: 6px; }
  .inv-tab-btn { padding: 8px 12px; font-size: 0.8rem; }
}


/* ==================== PERFORMANCE MODULE STYLES ==================== */

/* --- Bag Rate Slider --- */
.br-slider-container { margin-top: 12px; }
.br-slider {
  height: 10px;
  background: linear-gradient(to right, #ffcdd2 0%, #ffe0b2 25%, #c8e6c9 40%, #c8e6c9 60%, #bbdefb 75%, #e1bee7 100%);
  border-radius: 5px;
  position: relative;
}
.br-slider-optimal {
  position: absolute;
  top: -2px;
  height: 14px;
  background: rgba(34, 197, 94, 0.25);
  border-radius: 7px;
}
.br-slider-marker {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  background: #2d5a3d;
  border: 2px solid white;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.br-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* --- Charts Row --- */
.br-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.br-chart-container { min-height: 260px; }

/* --- Tech Grid --- */
.br-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.br-tech-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.br-tech-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.br-tech-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.br-tech-name { font-weight: 600; font-size: 0.9rem; }
.br-company-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}
.br-company-badge.gx { background: var(--accent-green-light, #dcfce7); color: var(--accent-green, #166534); }
.br-company-badge.rlc { background: var(--accent-cyan-light, #cffafe); color: var(--accent-cyan, #0891b2); }
.br-flag-unlinked { background: #fef3c7; color: #92400e; text-transform: lowercase; }
.br-flag-inactive { background: #e2e8f0; color: #475569; text-transform: lowercase; }
.br-tech-rate {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}
.br-tech-rate-label { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 8px; }
.br-tech-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.br-status-badge {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}
.br-tech-meta { font-size: 0.7rem; color: var(--text-muted); }

/* --- View Controls --- */
.br-view-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.br-view-toggle { display: flex; gap: 4px; }
.br-tech-count { font-size: 0.85rem; color: var(--text-muted); }

/* --- Leaderboard --- */
.br-leaderboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.br-leader-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.br-leader-item.attention { background: rgba(239,68,68,0.03); }
.br-leader-rank { font-size: 1.2rem; width: 28px; text-align: center; }
.br-leader-info { flex: 1; }
.br-leader-name { font-weight: 600; font-size: 0.9rem; }
.br-leader-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.br-leader-rate { font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* --- Detail Panel (Bag Rate + Employee Perf) --- */
.br-detail-panel,
.employee-perf-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-card, #fff);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}
.br-detail-panel.open,
.employee-perf-panel.open {
  right: 0;
}
.br-detail-panel-header,
.employee-perf-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-card, #fff);
  z-index: 1;
}
.br-detail-panel-header h3,
.employee-perf-panel-header h3 { margin: 0; }
.br-detail-panel-body,
.employee-perf-panel-body { padding: 20px; }

.br-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.br-detail-stat { text-align: center; }
.br-detail-stat-value { font-size: 1.4rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.br-detail-stat-label { font-size: 0.7rem; color: var(--text-muted); }
.br-detail-monthly { margin-bottom: 20px; }
.br-detail-monthly h4 { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 12px; }
.br-monthly-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 80px;
  gap: 6px;
}
.br-monthly-bar-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; }
.br-monthly-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; }
.br-monthly-bar.optimal { background: #4caf50; }
.br-monthly-bar.near-optimal { background: #8bc34a; }
.br-monthly-bar.needs-work { background: #ff9800; }
.br-monthly-label { font-size: 0.6rem; color: var(--text-muted); margin-top: 4px; }
.br-monthly-value { font-size: 0.55rem; color: var(--text-secondary); font-weight: 500; }
.br-detail-comparison { padding: 12px; background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); margin-bottom: 16px; }
.br-detail-rank { font-weight: 600; }
.br-detail-vs-team { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* --- 5-Tier Status Badges --- */
.br-status-badge.very-heavy { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.br-status-badge.running-hot { background: rgba(249,115,22,0.15); color: #ea580c; }
.br-status-badge.optimal { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.br-status-badge.running-light { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.br-status-badge.very-light { background: rgba(139,92,246,0.15); color: #7c3aed; }
.br-status-badge.no-data { background: rgba(107,114,128,0.1); color: var(--text-muted); }

/* --- Company Performance Cards Grid --- */
.br-company-perf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.br-company-perf-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  border-top: 3px solid var(--accent-green);
  transition: box-shadow 0.2s;
}
.br-company-perf-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.br-company-perf-card .perf-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.br-company-perf-card .perf-card-title { font-weight: 700; font-size: 1.05rem; }
.br-company-perf-card .perf-card-rate {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  margin: 4px 0 2px;
}
.br-company-perf-card .perf-card-sub { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.br-delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}
.br-delta-badge.up { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.br-delta-badge.down { background: rgba(239,68,68,0.12); color: var(--accent-red); }
.br-delta-badge.flat { background: rgba(107,114,128,0.1); color: var(--text-muted); }
.br-company-perf-card .perf-card-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.br-company-perf-card .perf-card-stats span { display: flex; flex-direction: column; gap: 2px; }
.br-company-perf-card .perf-card-stats strong { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }

/* --- Quick Stats Panel --- */
.br-quick-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.br-quick-stat-item {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  flex: 1;
  min-width: 120px;
  text-align: center;
}
.br-quick-stat-item .stat-val { font-size: 1.4rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.br-quick-stat-item .stat-lbl { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* --- Sparkline --- */
.br-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  margin-top: 6px;
}
.br-spark-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent-green);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.br-spark-bar.no-data { background: var(--border-subtle); }

/* --- Search/Filter Bar --- */
.br-filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.br-search-input {
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: var(--bg-card, #fff);
  color: var(--text-primary);
  min-width: 180px;
}
.br-search-input::placeholder { color: var(--text-muted); }
.br-search-input:focus { outline: none; border-color: var(--accent-green); box-shadow: 0 0 0 2px rgba(34,197,94,0.15); }

/* --- Tech Card Enhancements (left border by status) --- */
.br-tech-card.status-very-heavy { border-left: 3px solid var(--accent-red); }
.br-tech-card.status-running-hot { border-left: 3px solid #ea580c; }
.br-tech-card.status-optimal { border-left: 3px solid var(--accent-green); }
.br-tech-card.status-running-light { border-left: 3px solid var(--accent-blue); }
.br-tech-card.status-very-light { border-left: 3px solid #7c3aed; }
.br-tech-card.status-no-data { border-left: 3px solid #9ca3af; }

/* --- Sort Indicators --- */
.br-sort-header { cursor: pointer; user-select: none; white-space: nowrap; }
.br-sort-header:hover { color: var(--accent-green); }
.br-sort-active { color: var(--accent-green); font-weight: 700; }
.br-sort-arrow { font-size: 0.7rem; margin-left: 3px; opacity: 0.5; }
.br-sort-active .br-sort-arrow { opacity: 1; }

/* --- Daily Breakdown (Detail Panel) --- */
.br-daily-breakdown { margin-bottom: 20px; }
.br-daily-breakdown h4 { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 10px; }
.br-daily-table { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.br-daily-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); font-weight: 500; }
.br-daily-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); }

/* --- Personal Trend Chart (Detail Panel) --- */
.br-personal-trend { margin-bottom: 20px; }
.br-personal-trend h4 { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 10px; }
.br-personal-trend canvas { max-height: 200px; }

/* --- Comparison Bars (Detail Panel) --- */
.br-comparison-bars { margin-bottom: 20px; }
.br-comparison-bars h4 { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 10px; }
.br-comparison-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.8rem;
}
.br-comparison-bar-item .bar-label { width: 80px; text-align: right; color: var(--text-muted); flex-shrink: 0; }
.br-comparison-bar-item .bar-track { flex: 1; height: 12px; background: var(--bg-secondary, #f3f4f6); border-radius: var(--radius-sm); overflow: hidden; }
.br-comparison-bar-item .bar-fill { height: 100%; border-radius: var(--radius-sm); transition: width 0.4s ease; }
.br-comparison-bar-item .bar-value { width: 50px; font-weight: 600; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }

/* --- Explanation Panels & Info Buttons --- */
.br-chart-explain {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  margin: -4px 0 8px;
  line-height: 1.4;
}
.br-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-green);
  background: transparent;
  color: var(--accent-green);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  padding: 0;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.br-info-btn:hover {
  background: var(--accent-green);
  color: #fff;
}
.br-info-panel {
  display: none;
  background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(34,197,94,0.02));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.br-info-panel.visible { display: block; }
.br-info-panel h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.br-info-panel ul {
  margin: 4px 0 8px 16px;
  padding: 0;
}
.br-info-panel ul li { margin-bottom: 3px; }
.br-action-tip {
  border-left: 3px solid var(--accent-green);
  background: rgba(34,197,94,0.05);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* --- Advanced Date Filters --- */
.br-advanced-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.br-advanced-filters.hidden { display: none; }
.br-advanced-filters > div {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.br-advanced-filters label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.br-advanced-filters input[type="date"],
.br-advanced-filters input[type="number"] {
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  background: var(--bg-card, #fff);
  color: var(--text-primary);
}
.br-advanced-filters input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.15);
}
.br-period-label {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-green);
  margin-bottom: 12px;
}

/* --- Review Cards --- */
.review-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.review-card-enhanced {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  text-align: left;
}
.review-card-enhanced:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.review-card-enhanced.completed { border-left: 3px solid var(--accent-green); }
.review-card-enhanced.pending { border-left: 3px solid var(--accent-amber); }
.review-card-enhanced.overdue { border-left: 3px solid var(--accent-red); }
.review-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.review-card-name { font-weight: 600; font-size: 0.95rem; }
.review-card-subline { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.review-card-company { font-size: 0.7rem; color: var(--text-muted); }
.review-card-status-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.review-card-age { font-size: 0.75rem; color: var(--text-muted); }
.review-score-circle,
.review-score-circle-lg {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 8px auto;
  font-weight: 700;
}
.review-score-circle-lg { width: 80px; height: 80px; }
.review-score-circle .score-value,
.review-score-circle-lg .score-value { font-size: 1.4rem; line-height: 1; }
.review-score-circle-lg .score-value { font-size: 1.8rem; }
.review-score-circle .score-max,
.review-score-circle-lg .score-max { font-size: 0.65rem; color: var(--text-muted); font-weight: 400; }
.review-score-circle.excellent,
.review-score-circle-lg.excellent { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.review-score-circle.good,
.review-score-circle-lg.good { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.review-score-circle.needs-improvement,
.review-score-circle-lg.needs-improvement { background: rgba(234,179,8,0.15); color: var(--accent-amber); }
.review-status-tag { font-size: 0.8rem; color: var(--text-muted); padding: 12px 0; }
.review-status-tag.completed { color: var(--accent-green); }
.review-status-tag.pending { color: var(--accent-amber); }
.review-card-meta {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
}
.review-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* --- Review Detail Modal --- */
.review-detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.review-detail-modal-inner {
  background: var(--bg-card, #fff);
  border-radius: 16px;
  max-width: 920px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.review-detail-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-card, #fff);
  z-index: 1;
}
.review-detail-modal-top h3 { margin: 0; }
.review-detail-modal-body { padding: 24px; }
.review-detail-header h2 { margin: 0 0 8px; font-size: 1.2rem; }
.review-detail-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.review-detail-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.review-detail-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-muted);
  font-size: 12px;
}
.review-detail-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.review-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.review-overall-score { text-align: center; margin: 20px 0; }
.score-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
.review-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.review-metrics-grid--dense {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.review-metric-item { text-align: center; padding: 12px; background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); }
.review-metric-value { font-size: 1.3rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.review-metric-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.review-detail-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.review-detail-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.review-detail-field-value {
  color: var(--text-primary);
  line-height: 1.55;
}
.review-section {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: var(--radius-md);
}
.review-section h3 { margin: 0 0 10px; font-size: 1rem; }
.review-section.strengths { border-left: 3px solid var(--accent-green); }
.review-section.improvements { border-left: 3px solid var(--accent-amber); }
.review-section ul { margin: 0; padding-left: 20px; }
.review-section li { margin-bottom: 6px; line-height: 1.5; }
.review-acknowledge-section {
  margin-top: 20px;
  padding: 16px;
  background: rgba(59,130,246,0.08);
  border-radius: var(--radius-md);
}

/* --- Customer Feedback Hero --- */
.fb-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.fb-hero-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}
.fb-hero-card.compliment { border-bottom: 3px solid var(--accent-green); }
.fb-hero-card.complaint { border-bottom: 3px solid var(--accent-red); }
.fb-hero-card.ratio { border-bottom: 3px solid var(--accent-blue); }
.fb-hero-icon { font-size: 1.5rem; margin-bottom: 4px; }
.fb-hero-value { font-size: 1.8rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.fb-hero-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* --- Feedback Toggle --- */
.feedback-toggle-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.feedback-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-card, #fff);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.feedback-toggle-btn:hover { border-color: var(--text-muted); }
.feedback-toggle-btn.active.compliment {
  border-color: var(--accent-green);
  background: rgba(34,197,94,0.08);
  color: var(--accent-green);
}
.feedback-toggle-btn.active.complaint {
  border-color: var(--accent-red);
  background: rgba(239,68,68,0.08);
  color: var(--accent-red);
}
.toggle-count {
  background: var(--bg-secondary, #f1f5f9);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}
.feedback-toggle-btn.active .toggle-count { background: rgba(255,255,255,0.3); }

/* --- Enhanced Feedback Cards --- */
.feedback-card-enhanced {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.2s;
}
.feedback-card-enhanced:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.feedback-card-enhanced.compliment { border-left: 3px solid var(--accent-green); }
.feedback-card-enhanced.complaint { border-left: 3px solid var(--accent-red); }
.feedback-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.category-badge {
  padding: 3px 10px;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-secondary);
}
.category-badge.service_quality { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.category-badge.technician_behavior { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.category-badge.communication { background: rgba(139,92,246,0.12); color: var(--accent-purple, #8b5cf6); }
.category-badge.timeliness { background: rgba(234,179,8,0.12); color: var(--accent-amber); }
.category-badge.results { background: rgba(6,182,212,0.12); color: var(--accent-cyan, #0891b2); }
.feedback-date { font-size: 0.8rem; color: var(--text-muted); }
.customer-quote {
  font-style: italic;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  border: none;
}
.feedback-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.customer-info { display: flex; gap: 12px; }
.company-tag {
  padding: 2px 8px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* --- AI Insights Panel --- */
.ai-insights-panel {
  background: linear-gradient(135deg, rgba(139,92,246,0.06) 0%, rgba(59,130,246,0.06) 100%);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-lg);
  min-height: fit-content;
  padding: 18px 20px;
  margin: 0 0 18px;
  overflow: visible;
}
.ai-insights-panel.for-complaints {
  background: linear-gradient(135deg, rgba(239,68,68,0.06) 0%, rgba(234,179,8,0.06) 100%);
  border-color: rgba(239,68,68,0.2);
}
.ai-insights-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
}
.ai-icon { font-size: 1.2rem; }
.ai-refresh-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.ai-refresh-btn:hover { color: var(--text-primary); }
.ai-insights-content {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: visible;
  font-size: 0.9rem;
  line-height: 1.55;
}
.ai-insights-content ul { margin: 0; padding-left: 20px; }
.ai-insights-content li { margin-bottom: 6px; }
.ai-insights-content li:last-child { margin-bottom: 0; }
.fb-ai-insight-block h4 {
  margin: 0 0 6px;
  color: var(--text-primary, #0f172a);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==================== FEEDBACK ANALYTICAL POWERHOUSE ==================== */

/* --- Feedback Tabs --- */
.fb-tab-group {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 10px;
  padding: 4px;
}
.fb-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.fb-tab:hover { color: var(--text-primary); }
.fb-tab.active {
  background: var(--bg-card, #fff);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* --- Charts Row --- */
.fb-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.fb-chart-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.fb-chart-card h3 { margin: 0 0 12px; font-size: 0.95rem; }
.fb-chart-wrap { position: relative; height: 250px; }

/* --- Breakdown Row --- */
.fb-breakdown-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.fb-breakdown-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.fb-breakdown-card h3 { margin: 0 0 16px; font-size: 0.95rem; }
.fb-breakdown-item { margin-bottom: 14px; }
.fb-breakdown-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; }
.fb-breakdown-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.fb-bar-fill.compliment { background: var(--accent-green); }
.fb-bar-fill.complaint { background: var(--accent-red); }
.fb-breakdown-stats {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
}
.fb-empty-text { color: var(--text-muted); padding: 12px; font-style: italic; }

/* --- Leaderboard Row --- */
.fb-leaderboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.fb-leaderboard-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.fb-leaderboard-card h3 { margin: 0 0 16px; font-size: 0.95rem; }
.fb-leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.fb-leaderboard-item:last-child { border-bottom: none; }
.fb-rank { font-size: 1.1rem; width: 28px; text-align: center; }
.fb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-green-light, rgba(34,197,94,0.15));
  color: var(--accent-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
}
.fb-avatar.complaint {
  background: var(--accent-red-light, rgba(239,68,68,0.15));
  color: var(--accent-red);
}
.fb-leader-name { flex: 1; font-weight: 500; font-size: 0.9rem; }
.fb-leader-count {
  font-size: 0.8rem; font-weight: 600; color: var(--accent-green);
  font-family: 'JetBrains Mono', monospace;
}
.fb-leader-count.complaint { color: var(--accent-red); }

/* --- Filter Bar --- */
.fb-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.fb-search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--bg-card, #fff);
}
.fb-search-input:focus { outline: 2px solid var(--accent-green); border-color: transparent; }

/* --- Data Table --- */
.fb-table-container { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
.fb-data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.fb-data-table thead { background: var(--bg-secondary, #f9fafb); }
.fb-data-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.fb-sortable { cursor: pointer; user-select: none; }
.fb-sortable:hover { color: var(--accent-green); }
.fb-sort-arrow { font-size: 0.75rem; color: var(--text-muted); }
.fb-data-table td { padding: 10px 12px; border-top: 1px solid var(--border-subtle); }
.fb-table-row { cursor: pointer; transition: background 0.15s; }
.fb-table-row:hover { background: var(--bg-secondary, #f9fafb); }
.fb-cell-date { white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
.fb-cell-excerpt { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.fb-empty-cell { text-align: center; padding: 40px; color: var(--text-muted); }
.fb-empty-cell-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.fb-empty-cell-title {
  font-weight: 600;
  color: var(--text-secondary, #374151);
  margin-bottom: 4px;
}

.fb-empty-cell-copy {
  font-size: 13px;
}

/* --- Type & Status Badges --- */
.fb-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600;
  text-transform: capitalize;
}
.fb-type-badge.compliment { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.fb-type-badge.complaint { background: rgba(239,68,68,0.12); color: var(--accent-red); }
.fb-type-badge.neutral { background: var(--bg-secondary, #f1f5f9); color: var(--text-muted); }
.fb-status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 600; text-transform: capitalize;
}
.fb-status-badge.new { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.fb-status-badge.acknowledged { background: rgba(139,92,246,0.12); color: var(--accent-purple, #8b5cf6); }
.fb-status-badge.in_progress { background: rgba(234,179,8,0.12); color: var(--accent-amber); }
.fb-status-badge.resolved { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.fb-status-badge.closed { background: var(--bg-secondary, #f1f5f9); color: var(--text-muted); }

/* --- Mode Badge (Internal / External) --- */
.fb-mode-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.fb-mode-badge.external { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.fb-mode-badge.internal { background: rgba(59,130,246,0.12); color: var(--accent-blue, #3b82f6); }

/* --- Pagination --- */
.fb-pagination {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding: 12px 0; font-size: 0.85rem;
}
.fb-page-info { color: var(--text-muted); }
.fb-page-btns { display: flex; gap: 4px; }
.fb-page-btn {
  padding: 6px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--bg-card, #fff); cursor: pointer; font-family: inherit; font-size: 0.8rem;
}
.fb-page-btn:hover:not(:disabled) { border-color: var(--accent-green); color: var(--accent-green); }
.fb-page-btn.active { background: var(--accent-green); color: #fff; border-color: var(--accent-green); }
.fb-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.fb-page-ellipsis { padding: 6px 4px; color: var(--text-muted); }
.fb-page-size {
  padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.8rem; background: var(--bg-card, #fff);
}

/* --- Mobile Cards --- */
.fb-mobile-cards { display: none; flex-direction: column; gap: 10px; }
.fb-mobile-card {
  background: var(--bg-card, #fff); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 14px; cursor: pointer; transition: box-shadow 0.2s;
}
.fb-mobile-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.fb-mobile-card.compliment { border-left: 3px solid var(--accent-green); }
.fb-mobile-card.complaint { border-left: 3px solid var(--accent-red); }
.fb-mobile-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fb-mobile-date { font-size: 0.8rem; color: var(--text-muted); }
.fb-mobile-excerpt { font-style: italic; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.fb-mobile-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 0.8rem; color: var(--text-muted); }

/* --- Detail Panel --- */
.fb-detail-overlay {
  position: fixed; inset: 0; background: var(--bg-overlay, rgba(0,0,0,0.4));
  backdrop-filter: blur(4px); z-index: 1000; display: none; justify-content: flex-end;
}
.fb-detail-overlay.active { display: flex; }
.fb-detail-panel {
  width: 580px; max-width: 100%; height: 100vh;
  background: var(--bg-card, #fff); border-left: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  animation: slideIn 0.3s ease; box-shadow: -10px 0 40px rgba(0,0,0,0.15);
}
.fb-detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-alt, var(--bg-card, #fff));
}
.fb-detail-header-left { flex: 1; }
.fb-detail-type-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--radius-md); font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; margin-bottom: 8px;
}
.fb-detail-type-badge.compliment { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.fb-detail-type-badge.complaint { background: rgba(239,68,68,0.12); color: var(--accent-red); }
.fb-detail-header h2 { font-size: 1.2rem; font-weight: 700; margin: 0; line-height: 1.3; }
.fb-detail-body {
  flex: 1; overflow-y: auto; padding: 24px;
}

/* --- Editor Fields --- */
.fb-editor-field { margin-bottom: 16px; }
.fb-editor-field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted, #6c757d); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.fb-editor-field input, .fb-editor-field select, .fb-editor-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-subtle, #e5e7eb); border-radius: 8px;
  font-size: 0.9rem; font-family: inherit; background: var(--surface-secondary, #f9fafb); color: var(--text-primary, #1a1a1a);
  box-sizing: border-box;
}
.fb-editor-field input:focus, .fb-editor-field select:focus, .fb-editor-field textarea:focus {
  outline: none; border-color: #2d5a3d; box-shadow: 0 0 0 3px rgba(45,90,61,0.1);
}

/* --- Detail Sections --- */
.fb-detail-section { margin-bottom: 24px; }
.fb-detail-section h3 {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 12px;
}
.fb-detail-quote {
  font-style: italic; font-size: 1rem; line-height: 1.6;
  padding: 12px 16px; margin: 0; border-left: 3px solid var(--accent-green);
  background: rgba(34,197,94,0.04); border-radius: 0 8px 8px 0;
}
.fb-detail-desc { color: var(--text-secondary); line-height: 1.5; margin: 8px 0 0; }
.fb-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fb-detail-field label {
  display: block; font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px;
}
.fb-detail-field span { font-size: 0.9rem; }
.fb-detail-resolution { color: var(--text-secondary); line-height: 1.5; margin: 0 0 12px; }
.fb-detail-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
}

/* --- Timeline --- */
.fb-detail-timeline { display: flex; flex-direction: column; gap: 0; }
.fb-timeline-item {
  display: flex; gap: 12px; padding: 8px 0;
  position: relative;
}
.fb-timeline-item:not(:last-child)::after {
  content: ''; position: absolute; left: 7px; top: 28px; bottom: -8px;
  width: 2px; background: var(--border-subtle);
}
.fb-timeline-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-secondary, #e5e7eb); border: 2px solid var(--border-subtle);
  margin-top: 2px;
}
.fb-timeline-item.resolved .fb-timeline-dot { background: var(--accent-green); border-color: var(--accent-green); }
.fb-timeline-label { font-weight: 500; font-size: 0.85rem; }
.fb-timeline-date { font-size: 0.8rem; color: var(--text-muted); }

/* --- Resolution Actions --- */
.fb-detail-actions { margin-top: 12px; }
.fb-resolution-input {
  width: 100%; min-height: 80px; padding: 10px; margin-bottom: 10px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  font-family: inherit; font-size: 0.85rem; resize: vertical;
}
.fb-action-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.fb-inline-message {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.fb-inline-message--error {
  color: var(--accent-red);
}

/* --- Related Feedback --- */
.fb-related-item {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: var(--radius-md); cursor: pointer; transition: background 0.15s;
}
.fb-related-item:hover { background: var(--bg-secondary, #f9fafb); }
.fb-related-excerpt { flex: 1; font-size: 0.85rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-related-date { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.fb-related-loading,
.fb-related-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

.fb-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fb-attachment-link {
  display: inline-block;
  border: 1px solid var(--border-subtle, #d1d5db);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card, #fff);
}

.fb-attachment-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
}

.fb-attachment-label {
  padding: 8px 12px;
  display: block;
  font-size: 0.85rem;
}

/* --- Insights Tab --- */
.fb-insights-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.fb-insight-card {
  background: var(--bg-card, #fff); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 20px;
}
.fb-insight-card h3 { margin: 0 0 4px; font-size: 0.95rem; }
.fb-insight-card .subtitle { margin: 0 0 16px; font-size: 0.8rem; color: var(--text-muted); }
.fb-insights-loading {
  padding: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.fb-insights-summary {
  margin: 0 0 12px;
}

.fb-insights-recommendations {
  margin: 12px 0 8px;
}

/* --- Heatmap --- */
.fb-heatmap-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.fb-heatmap-cell {
  padding: 12px 8px; border-radius: var(--radius-md); text-align: center;
  transition: transform 0.15s;
}
.fb-heatmap-cell:hover { transform: scale(1.05); }
.fb-heatmap-cell--zero { background: var(--bg-secondary, #f1f5f9); }
.fb-heatmap-cell--low { background: rgba(34, 197, 94, 0.22); }
.fb-heatmap-cell--mid { background: rgba(34, 197, 94, 0.38); }
.fb-heatmap-cell--high { background: rgba(34, 197, 94, 0.58); }
.fb-heatmap-cell--peak { background: rgba(34, 197, 94, 0.78); }
.fb-heatmap-day { font-size: 0.7rem; font-weight: 600; margin-bottom: 4px; }
.fb-heatmap-count { font-size: 1.1rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* --- Feedback Responsive --- */
@media (max-width: 768px) {
  .fb-charts-row { grid-template-columns: 1fr; }
  .fb-breakdown-row { grid-template-columns: 1fr; }
  .fb-leaderboard-row { grid-template-columns: 1fr; }
  .fb-insights-grid { grid-template-columns: 1fr; }
  .fb-filter-bar { flex-direction: column; }
  .fb-search-input { min-width: unset; }
  .fb-table-container { display: none; }
  .fb-mobile-cards { display: flex !important; }
  .fb-detail-panel { width: 100%; }
  .fb-detail-grid { grid-template-columns: 1fr; }
  .fb-hero-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .fb-tab-group { flex-direction: column; }
  .fb-heatmap-grid { grid-template-columns: repeat(4, 1fr); }
  .fb-hero-row { grid-template-columns: 1fr 1fr; }
  .fb-pagination { flex-direction: column; align-items: flex-start; }
}

/* --- Employee Performance Panel --- */
.emp-perf-header { margin-bottom: 20px; }
.emp-perf-role { font-weight: 600; font-size: 1rem; }
.emp-perf-company { font-size: 0.85rem; color: var(--text-muted); }
.emp-perf-section { margin-bottom: 20px; }
.emp-perf-section h4 { margin: 0 0 12px; font-size: 0.9rem; color: var(--text-secondary); }
.emp-perf-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.emp-perf-mini-stat { text-align: center; padding: 10px; background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); }
.mini-stat-value { font-size: 1.2rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.mini-stat-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

/* --- Benchmark Bars (Portal) --- */
.benchmark-item-portal { margin-bottom: 16px; }
.benchmark-header-portal { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.85rem; }
.benchmark-value-portal { font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.benchmark-bar-container-portal { height: 8px; background: var(--bg-secondary, #e5e7eb); border-radius: 4px; overflow: hidden; }
.benchmark-bar-portal { height: 100%; background: var(--accent-green); border-radius: 4px; transition: width 0.5s ease; }
.benchmark-bar-portal.warning { background: var(--accent-amber); }
.benchmark-meta-portal { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* --- Team Performer Items --- */
.team-performer-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
}
.team-performer-item:hover { background: var(--bg-secondary, #f9fafb); }

/* ==================== EMPLOYEE DETAIL PANEL (EXPANDED) ==================== */

/* --- Expanded Metrics Grid --- */
.portal-emp-metrics-group { margin-bottom: 16px; }
.portal-emp-metrics-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
.portal-emp-metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.portal-emp-metric-card { background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); padding: 10px; text-align: center; }
.portal-emp-metric-value { font-size: 1.1rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }
.portal-emp-metric-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

/* --- Bag Rate Rich Visualization --- */
.portal-emp-br-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.portal-emp-br-stat { text-align: center; padding: 10px; background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); }
.portal-emp-br-stat-value { font-size: 1.3rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.portal-emp-br-stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.portal-emp-br-stat-sub { font-size: 0.65rem; color: var(--text-secondary); margin-top: 2px; }

.portal-emp-br-slider-wrap { background: var(--bg-secondary, #f9fafb); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.portal-emp-br-slider { height: 14px; background: linear-gradient(to right, #ffcdd2 0%, #ffe0b2 25%, #c8e6c9 40%, #c8e6c9 60%, #bbdefb 75%, #e1bee7 100%); border-radius: 7px; position: relative; margin: 10px 0; }
.portal-emp-br-slider-optimal { position: absolute; top: 0; height: 100%; background: rgba(34, 197, 94, 0.3); border-radius: 7px; }
.portal-emp-br-slider-marker { position: absolute; top: -8px; width: 28px; height: 28px; background: #2d5a3d; border: 2px solid white; border-radius: 50%; transform: translateX(-50%); box-shadow: 0 2px 6px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; color: white; font-size: 0.5rem; font-weight: 600; }
.portal-emp-br-slider-team { position: absolute; top: 18px; transform: translateX(-50%); font-size: 0.6rem; color: var(--text-muted); white-space: nowrap; }
.portal-emp-br-slider-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-top: 18px; }

.portal-emp-br-comparison { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.portal-emp-br-comp-card { background: var(--bg-secondary, #f9fafb); border-radius: 10px; padding: 10px; display: flex; align-items: center; gap: 8px; }
.portal-emp-br-comp-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.portal-emp-br-comp-icon.declining { background: var(--accent-red-light) !important; }

.portal-emp-br-monthly { background: var(--bg-secondary, #f9fafb); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.portal-emp-br-monthly-bars { display: flex; align-items: flex-end; justify-content: space-between; height: 70px; gap: 4px; }
.portal-emp-br-monthly-item { flex: 1; display: flex; flex-direction: column; align-items: center; }
.portal-emp-br-monthly-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; }
.portal-emp-br-monthly-bar.optimal { background: #4caf50; }
.portal-emp-br-monthly-bar.near-optimal { background: #8bc34a; }
.portal-emp-br-monthly-bar.needs-work { background: #ff9800; }
.portal-emp-br-monthly-label { font-size: 0.55rem; color: var(--text-muted); margin-top: 3px; }
.portal-emp-br-monthly-value { font-size: 0.5rem; color: var(--text-secondary); font-weight: 500; }

.portal-emp-br-highlights { display: flex; gap: 8px; margin-bottom: 14px; }
.portal-emp-br-highlight { flex: 1; padding: 10px; border-radius: 10px; text-align: center; }
.portal-emp-br-highlight.best { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); }
.portal-emp-br-highlight.worst { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.3); }
.portal-emp-br-highlight span { font-size: 1.1rem; display: block; margin-bottom: 4px; }
.portal-emp-br-highlight .month { font-weight: 600; font-size: 0.85rem; }
.portal-emp-br-highlight .pct { font-size: 0.7rem; color: var(--text-secondary); }

/* --- SVG Trend Chart --- */
.portal-emp-trends { position: relative; }
.portal-emp-trend-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.portal-emp-trend-tab { padding: 4px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-card); font-size: 0.75rem; cursor: pointer; transition: all 0.15s; color: var(--text-secondary); font-family: inherit; }
.portal-emp-trend-tab.active { background: var(--accent-green); color: white; border-color: var(--accent-green); }
.portal-emp-trend-chart-area { min-height: 100px; }
.portal-emp-trend-svg { width: 100%; height: 100px; }

.portal-emp-trend-indicators { display: flex; gap: 8px; margin-top: 10px; }
.portal-emp-trend-indicator { flex: 1; text-align: center; padding: 8px; background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); }
.portal-emp-trend-indicator-label { font-size: 0.7rem; color: var(--text-muted); display: block; }
.portal-emp-trend-indicator-value { font-size: 1rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; display: block; }
.portal-emp-trend-indicator-change { font-size: 0.7rem; font-weight: 600; }
.portal-emp-trend-indicator-change.up { color: var(--accent-green); }
.portal-emp-trend-indicator-change.down { color: var(--accent-red); }
.portal-emp-trend-indicator-change.stable { color: var(--text-muted); }

.portal-emp-season-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.portal-emp-season-card { background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); padding: 10px; text-align: center; }
.portal-emp-season-label { font-size: 0.7rem; color: var(--text-muted); }
.portal-emp-season-value { font-size: 1.1rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.portal-emp-season-change { font-size: 0.7rem; font-weight: 600; }
.portal-emp-season-change.improved { color: var(--accent-green); }
.portal-emp-season-change.declined { color: var(--accent-red); }

/* --- WACU Grid --- */
.portal-emp-wacu-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
.portal-emp-wacu-card { background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); padding: 10px; text-align: center; }
.portal-emp-wacu-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 500; }
.portal-emp-wacu-value { font-size: 1.1rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--accent-green); }
.portal-emp-wacu-total { font-size: 0.8rem; color: var(--text-secondary); text-align: center; padding: 8px 0; }

/* --- Sales Bars --- */
.portal-emp-sales-total { font-size: 1.4rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; margin-bottom: 12px; }
.portal-emp-sales-item { margin-bottom: 10px; }
.portal-emp-sales-header { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 4px; }
.portal-emp-sales-header span:first-child { font-weight: 500; }
.portal-emp-sales-header span:last-child { font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.portal-emp-sales-bar { height: 8px; background: var(--bg-secondary, #e5e7eb); border-radius: 4px; overflow: hidden; }
.portal-emp-sales-fill { height: 100%; background: linear-gradient(90deg, var(--accent-green), #22c55e); border-radius: 4px; transition: width 0.5s ease; }

/* --- Comparison Bars --- */
.portal-emp-comparison { margin-bottom: 12px; }
.portal-emp-comparison-label { font-size: 0.8rem; margin-bottom: 4px; }
.portal-emp-comparison-track { position: relative; height: 10px; background: var(--bg-secondary, #e5e7eb); border-radius: 5px; overflow: visible; }
.portal-emp-comparison-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.portal-emp-comparison-fill.good { background: linear-gradient(90deg, var(--accent-green), #22c55e); }
.portal-emp-comparison-fill.warning { background: linear-gradient(90deg, var(--accent-amber), #f59e0b); }
.portal-emp-comparison-avg { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--text-primary); border-radius: 1px; transform: translateX(-1px); }
.portal-emp-comparison-value { font-size: 0.75rem; font-weight: 600; font-family: 'JetBrains Mono', monospace; text-align: right; margin-top: 2px; }

/* --- Time Off List --- */
.portal-emp-vacation-balance { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-secondary, #f9fafb); border-radius: var(--radius-md); margin-bottom: 12px; font-size: 0.85rem; }
.portal-emp-timeoff-heading { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin: 10px 0 6px; }
.portal-emp-timeoff-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.8rem; }
.portal-emp-timeoff-date { font-weight: 600; font-family: 'JetBrains Mono', monospace; min-width: 60px; color: var(--text-secondary); }

/* --- Per-Employee Feedback --- */
.portal-emp-praise-hero { display: flex; align-items: center; gap: 10px; padding: 14px; background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.04)); border-radius: var(--radius-lg); margin-bottom: 14px; }
.portal-emp-praise-count { font-size: 2rem; font-weight: 700; color: var(--accent-green); font-family: 'JetBrains Mono', monospace; }

.portal-emp-fb-toggle { display: flex; gap: 6px; margin-bottom: 12px; }
.portal-emp-fb-btn { flex: 1; padding: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); font-size: 0.75rem; font-weight: 500; cursor: pointer; transition: all 0.15s; background: var(--bg-card); color: var(--text-secondary); font-family: inherit; text-align: center; }
.portal-emp-fb-btn.active { background: var(--accent-green); color: white; border-color: var(--accent-green); }

.portal-emp-fb-card { padding: 12px; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--border-subtle); }
.portal-emp-fb-card.compliment { border-left: 3px solid var(--accent-green); }
.portal-emp-fb-card.complaint { border-left: 3px solid var(--accent-red); }
.portal-emp-fb-category { font-size: 0.65rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--bg-secondary, #f0f0f0); color: var(--text-secondary); }

.portal-emp-ai-insights { background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06)); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.portal-emp-ai-header { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; }

/* --- Employee Review Cards in Panel --- */
.portal-emp-review-card { padding: 12px; border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: background 0.15s; }
.portal-emp-review-card:hover { background: var(--bg-secondary, #f9fafb); }
.portal-emp-review-badge { font-size: 0.65rem; padding: 2px 8px; border-radius: 4px; background: var(--accent-red-light); color: var(--accent-red); font-weight: 600; }

/* --- Challenge Cards --- */
.portal-challenge-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent-red); color: white; font-size: 0.7rem; font-weight: 700; padding: 0 6px; margin-left: 6px; }

.portal-challenge-card { padding: 12px; border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 8px; }
.portal-challenge-card.completed { opacity: 0.7; }
.portal-challenge-card.in-progress { border-left: 3px solid var(--accent-blue); }

.portal-challenge-status { font-size: 0.65rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; background: var(--bg-secondary, #f0f0f0); color: var(--text-secondary); }
.portal-challenge-status.completed { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }
.portal-challenge-status.in-progress { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.portal-challenge-status.new { background: rgba(234, 179, 8, 0.15); color: var(--accent-amber); }

.portal-challenge-priority { font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; background: var(--accent-red-light); color: var(--accent-red); font-weight: 600; }
.portal-challenge-due { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.portal-challenge-due.overdue { color: var(--accent-red); font-weight: 600; }
.portal-challenge-due.soon { color: var(--accent-amber); font-weight: 600; }
.portal-challenge-actions { display: flex; gap: 6px; margin-top: 8px; }

/* --- Challenge Library --- */
.portal-library-filter { background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.portal-library-filter.active { background: var(--accent-green); color: white; border-color: var(--accent-green); }

.portal-library-card { padding: 14px; border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 10px; }
.portal-library-badge { font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.portal-library-badge.featured { background: rgba(234, 179, 8, 0.15); color: var(--accent-amber); }
.portal-library-badge.portal-difficulty-easy { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }
.portal-library-badge.portal-difficulty-medium { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.portal-library-badge.portal-difficulty-hard { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

/* --- Team Challenge Cards --- */
.portal-team-challenge-card { padding: 14px; border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 10px; }
.portal-team-challenge-progress { margin-top: 8px; }
.portal-team-challenge-bar { height: 8px; background: var(--bg-secondary, #e5e7eb); border-radius: 4px; overflow: hidden; }
.portal-team-challenge-fill { height: 100%; background: linear-gradient(90deg, var(--accent-green), #22c55e); border-radius: 4px; transition: width 0.5s ease; }

/* ==================== END EMPLOYEE DETAIL STYLES ==================== */

/* --- Responsive --- */
@media (max-width: 768px) {
  .br-company-perf-grid { grid-template-columns: 1fr; }
  .br-charts-row { grid-template-columns: 1fr; }
  .br-tech-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .br-leaderboard-row { grid-template-columns: 1fr; }
  .br-advanced-filters { flex-direction: column; align-items: stretch; }
  .br-advanced-filters .btn { width: 100%; }
  .fb-hero-row { grid-template-columns: repeat(2, 1fr); }
  .review-cards-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .review-metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .review-detail-modal { padding: 10px; }
  .review-detail-modal-inner { max-height: 90vh; }
  .review-detail-header-top { flex-direction: column; }
  .review-card-actions .btn { flex: 1 1 140px; }
  .emp-perf-stat-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .portal-emp-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-emp-br-comparison { grid-template-columns: 1fr; }
  .portal-emp-wacu-grid { grid-template-columns: repeat(3, 1fr); }
  .portal-emp-season-cards { grid-template-columns: 1fr; }
  .portal-emp-fb-toggle { flex-direction: column; }
}
@media (max-width: 480px) {
  .br-quick-stats { flex-direction: column; }
  .fb-hero-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .feedback-toggle-group { flex-direction: column; }
  .review-detail-meta { flex-direction: column; gap: 4px; }
  .portal-emp-metrics-grid { grid-template-columns: 1fr 1fr; }
  .portal-emp-br-stats { grid-template-columns: 1fr; }
  .portal-emp-br-highlights { flex-direction: column; }
  .portal-emp-wacu-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════ */
/* TEAM DASHBOARD — FPA-03                                       */
/* ══════════════════════════════════════════════════════════════ */

/* Summary Bar */
.td-summary-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  min-width: 0;
}
.td-summary-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 0;
  overflow-wrap: anywhere;
}
.td-summary-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.td-summary-card.has-attention { background: var(--yellow-100); border: 1px solid var(--accent-amber); }
[data-theme="dark"] .td-summary-card.has-attention { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); }
.td-summary-val { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.td-summary-lbl { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.td-summary-sub { font-size: 0.75rem; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.td-attention-card .td-summary-val { color: var(--accent-amber); }

/* Zero/empty metric styling */
.metric-empty { opacity: 0.6; border-style: dashed !important; }
.metric-empty .td-summary-val,
.metric-empty .td-detail-metric-val,
.metric-empty .td-metric-val,
.metric-empty .stat-val,
.metric-empty .br-detail-stat-value { color: var(--text-muted) !important; font-style: italic; }
.no-data-label { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }

/* Status dots */
.td-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.td-status-dot.td-status-very-heavy { background: var(--accent-red); }
.td-status-dot.td-status-running-hot { background: #ea580c; }
.td-status-dot.td-status-optimal { background: var(--accent-green); }
.td-status-dot.td-status-running-light { background: var(--accent-blue); }
.td-status-dot.td-status-very-light { background: #7c3aed; }
.td-status-dot.td-status-no-data { background: var(--text-muted); }

/* Filter Bar */
.td-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.td-search-wrap { position: relative; flex: 1; min-width: 180px; }
.td-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text-primary);
  box-sizing: border-box;
}
.td-search-input:focus { outline: none; border-color: var(--accent-green); }
.td-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 1rem; color: var(--text-muted);
  cursor: pointer; padding: 2px 6px;
}
.td-filter-bar .filter-select { min-width: 120px; }
.td-view-toggle { display: flex; gap: 2px; margin-left: auto; }
.td-view-btn {
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.15s;
}
.td-view-btn:first-child { border-radius: 6px 0 0 6px; }
.td-view-btn:last-child { border-radius: 0 6px 6px 0; }
.td-view-btn.active { background: var(--accent-green); color: white; border-color: var(--accent-green); }

/* Collapsible Sections */
.td-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.td-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.td-section-header h3 { margin: 0; font-size: 0.95rem; }
.td-collapse-btn {
  background: none; border: none; font-size: 0.85rem;
  color: var(--text-muted); cursor: pointer; padding: 4px 8px;
}
.td-section-body { padding: 0 16px 12px; }
.td-section-body.collapsed { display: none; }

/* Leader/Attention Items */
.td-leader-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.td-leader-item:last-child { border-bottom: none; }
.td-leader-rank { font-size: 1.2rem; width: 28px; text-align: center; flex-shrink: 0; }
.td-leader-info { flex: 1; min-width: 0; }
.td-leader-name { font-weight: 600; font-size: 0.9rem; }
.td-leader-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.td-leader-rate { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.td-leader-rate > span:first-child { font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; }

/* Attention items */
.td-attention-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.td-attention-item:last-child { border-bottom: none; }
.td-attention-info { flex: 1; min-width: 0; }
.td-attention-reasons { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.td-reason-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(239,68,68,0.1);
  color: var(--accent-red);
  font-weight: 500;
  white-space: nowrap;
}
.td-severity-high { border-left: 3px solid var(--accent-red); padding-left: 10px; }
.td-severity-medium { border-left: 3px solid var(--accent-amber); padding-left: 10px; }
.td-attention-count-badge {
  font-size: 0.75rem;
  background: var(--accent-amber);
  color: white;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 6px;
}

/* Status Badges */
.td-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.td-status-very-heavy { background: rgba(220,38,38,0.1); color: var(--accent-red); }
.td-status-running-hot { background: rgba(234,88,12,0.1); color: #ea580c; }
.td-status-optimal { background: rgba(22,163,74,0.1); color: var(--accent-green); }
.td-status-running-light { background: rgba(37,99,235,0.1); color: var(--accent-blue); }
.td-status-very-light { background: rgba(124,58,237,0.1); color: #7c3aed; }
.td-status-no-data { background: rgba(107,114,128,0.1); color: var(--text-muted); }

/* Employee Header */
.td-employee-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}
.td-employee-count { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
#td-compare-toggle { font-size: 13px; transition: all 0.15s; }

/* Card Grid */
.td-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.td-emp-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border-left: 4px solid var(--border-subtle);
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 0;
  max-width: 100%;
}
.td-emp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.td-emp-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.td-emp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.td-emp-identity { flex: 1; min-width: 0; }
.td-emp-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}
.td-emp-role {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
}
.td-emp-badges { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.td-active-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slate-300); }
.td-active-dot.active { background: var(--green-500); }
.td-emp-card-divider { height: 1px; background: var(--border-subtle); margin: 8px 0; }
.td-emp-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  text-align: center;
  margin-bottom: 8px;
}
.td-metric-item { }
.td-metric-val { font-weight: 700; font-size: 0.9rem; }
.td-metric-lbl { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.td-emp-card-footer { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.td-emp-card-footer > * {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.td-route-edit-btn { background: none; border: none; cursor: pointer; padding: 0 2px; font-size: 0.75rem; opacity: 0.6; transition: opacity 0.15s; }
.td-route-edit-btn:hover { opacity: 1; }

/* Feedback badges on cards */
.td-fb-badge {
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: var(--radius-md);
  font-weight: 600;
}
.td-fb-badge.compliment { background: rgba(22,163,74,0.1); color: var(--accent-green); }
.td-fb-badge.complaint { background: rgba(220,38,38,0.1); color: var(--accent-red); }
.td-fb-badge.badge-count { background: rgba(245,158,11,0.1); color: #b45309; }

/* Table View */
.td-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.td-table thead { position: sticky; top: 0; z-index: 2; background: var(--bg-card); }
.td-table th {
  height: 44px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}
.td-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.td-alt-row { background: rgba(0,0,0,0.015); }
[data-theme="dark"] .td-alt-row { background: rgba(255,255,255,0.02); }
.td-table tr:hover { background: rgba(22,163,74,0.04); }
.td-th-sticky { position: sticky; left: 0; background: var(--bg-card); z-index: 1; }

/* Frozen headers are useful with a mouse-sized canvas, but at touch widths
   they can cover the keyboard target that the browser is bringing into view—
   especially after rotation or text zoom. The table remains horizontally
   scrollable without those overlay layers. */
@media (max-width: 1180px) {
  .td-table thead,
  .td-th-sticky {
    position: static;
  }
}

/* Empty State */
.td-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Detail Panel */
.td-detail-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 460px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow: hidden;
}
.td-detail-panel.open { right: 0; }
.td-detail-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.td-detail-panel-header h3 { margin: 0; font-size: 1.1rem; }
.td-detail-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.td-detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  padding: 0 16px;
}
.td-tab-btn {
  padding: 10px 16px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.td-tab-btn:hover { color: var(--text-primary); }
.td-tab-btn.active { color: var(--accent-green); border-bottom-color: var(--accent-green); font-weight: 600; }
.td-detail-tabs-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.td-detail-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  flex-shrink: 0;
}

/* Detail Panel Metrics */
.td-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.td-detail-metric-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.td-detail-metric-val { font-size: 1.3rem; font-weight: 700; }
.td-detail-metric-lbl { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* Detail Sections */
.td-detail-section { margin-bottom: 20px; }
.td-detail-section h4 { font-size: 0.85rem; font-weight: 600; margin: 0 0 10px; color: var(--text-secondary); }

/* Badges */
.td-badge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.td-badge-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}
.td-badge-icon { font-size: 1rem; }

/* Reviews */
.td-review-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}
.td-review-item:last-child { border-bottom: none; }

/* Feedback in detail */
.td-fb-summary-card {
  flex: 1;
  text-align: center;
  padding: 14px;
  border-radius: 10px;
}
.td-fb-summary-card.compliment { background: rgba(22,163,74,0.08); }
.td-fb-summary-card.complaint { background: rgba(220,38,38,0.08); }
.td-fb-summary-val { font-size: 1.4rem; font-weight: 700; }
.td-fb-summary-card.compliment .td-fb-summary-val { color: var(--accent-green); }
.td-fb-summary-card.complaint .td-fb-summary-val { color: var(--accent-red); }
.td-fb-summary-lbl { font-size: 0.75rem; color: var(--text-muted); }

.td-fb-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.td-fb-item:last-child { border-bottom: none; }
.td-fb-item.compliment { border-left: 3px solid var(--accent-green); padding-left: 12px; }
.td-fb-item.complaint { border-left: 3px solid var(--accent-red); padding-left: 12px; }
.td-fb-date { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.td-fb-text { font-size: 0.85rem; line-height: 1.4; }
.td-fb-status-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: var(--radius-md);
  background: rgba(245,158,11,0.1);
  color: var(--accent-amber);
  font-weight: 500;
  margin-left: 6px;
}
.td-fb-status-tag.resolved { background: rgba(22,163,74,0.1); color: var(--accent-green); }

/* PTO bar */
.td-pto-bar-container { margin-bottom: 8px; }
.td-pto-bar {
  height: 12px;
  background: var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.td-pto-bar-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-sm);
  transition: width 0.3s;
}
.td-pto-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Mini table */
.td-mini-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.td-mini-table th { padding: 6px 8px; text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.td-mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); }

/* ── TEAM DASHBOARD RESPONSIVE ── */
@media (max-width: 1200px) {
  .td-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .td-summary-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .td-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-detail-panel { width: 100vw; right: -100vw; }
}

@media (max-width: 640px) {
  .td-summary-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-summary-bar .td-summary-card:last-child { grid-column: 1 / -1; }
  .td-card-grid { grid-template-columns: 1fr; }
  .td-filter-bar { flex-direction: column; align-items: stretch; }
  .td-filter-bar .filter-select { min-width: unset; }
  .td-search-wrap { min-width: unset; }
  .td-view-toggle { align-self: flex-end; }
  .td-emp-metrics { grid-template-columns: repeat(2, 1fr); }
  .td-detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .td-attention-item { flex-direction: column; align-items: flex-start; gap: 6px; }
}


/* ==================== PERSISTENT COMPANY TOGGLE ==================== */
.company-toggle-container {
  margin-bottom: 16px;
}

.company-toggle {
  display: inline-flex;
  gap: 0;
  background: var(--bg-secondary, #f0f0f0);
  border-radius: 10px;
  padding: 3px;
}

.company-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text-muted, #666);
  transition: all 0.2s;
  min-height: 44px;
  white-space: nowrap;
}

.company-btn.active {
  background: var(--bg-card, white);
  color: var(--accent-green, #166534);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.company-btn:hover:not(.active):not(:disabled) {
  color: var(--text-primary, #333);
  background: rgba(0,0,0,0.03);
}

.company-toggle.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.company-toggle.disabled .company-btn {
  cursor: not-allowed;
  pointer-events: none;
}

.company-btn.active[data-company="RLC"] {
  border-bottom: 2px solid #c5972c;
}

.company-btn.active[data-company="GX"] {
  border-bottom: 2px solid var(--accent-green, #166534);
}

/* Static label for non-leadership roles */
.company-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-secondary, #f0f0f0);
  color: var(--text-secondary, #555);
  margin-bottom: 16px;
}

.company-label.rlc {
  border-left: 3px solid var(--accent-cyan, #0891b2);
}

.company-label.gx {
  border-left: 3px solid var(--accent-green, #166534);
}

@media (max-width: 480px) {
  .company-toggle {
    display: flex;
    width: 100%;
  }
  .company-btn {
    flex: 1;
    text-align: center;
    font-size: 13px;
    padding: 8px 8px;
  }
}

/* ==================== ENTITY DEEP-LINKS ==================== */
.entity-link {
  color: var(--accent-green-dark);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.entity-link:hover {
  color: #3d7a4d;
  text-decoration: underline;
}

/* Notification navigation arrow */
.notif-nav-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.notification-item[data-navigable]:hover .notif-nav-arrow,
.notif-full-item[data-navigable]:hover .notif-nav-arrow {
  opacity: 1;
}
.notification-item[data-navigable] {
  position: relative;
}
.notif-full-item[data-navigable] {
  position: relative;
}
.notification-item[data-navigable]:hover {
  background: var(--green-50);
}

/* Needs Attention quick-action buttons */
.td-attention-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.td-attention-actions button {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-300);
  background: var(--bg-card);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.15s;
}
.td-attention-actions button:hover {
  border-color: var(--accent-green-dark);
  color: var(--accent-green-dark);
  background: var(--green-50);
}

/* Bag rate tech card profile link */
.br-profile-link {
  font-size: 12px;
  display: inline-flex;
  margin-top: 0;
  text-align: center;
  opacity: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.br-tech-card:hover .br-profile-link {
  opacity: 1;
}
.br-tech-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ==================== PH-08: POLISH & MICRO-INTERACTIONS ==================== */

/* Loading Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-subtle) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 120px;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
}
.skeleton-card .skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
}
.skeleton-card .skeleton-line:first-child {
  height: 20px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.06);
}
.skeleton-line { height: 16px; margin-bottom: 8px; background: rgba(0,0,0,0.04); border-radius: 4px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-circle { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }
.skeleton-list-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

/* Enhanced kanban card hover */
.kanban-card:hover {
  transform: translateY(-1px);
}

/* Live Data Indicator */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0); }
}

/* Detail Breadcrumbs */
.detail-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: 'Outfit', sans-serif;
}
.detail-breadcrumb-parent {
  color: var(--accent-green-dark);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.detail-breadcrumb-parent:hover {
  text-decoration: underline;
}
.detail-breadcrumb-sep {
  margin: 0 6px;
  color: var(--slate-300);
}
.detail-breadcrumb-current {
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

/* ============================================ */
/* MOBILE RESPONSIVENESS (WB-FIX-4)            */
/* ============================================ */
@media (max-width: 768px) {
  /* Modal close (x) buttons — 44px minimum touch target */
  [id*="Modal"] button[onclick*="close"]:not(.btn),
  [id*="Modal"] button[style*="cursor:pointer"]:not(.btn),
  .rain-day-modal-close,
  .detail-close,
  .popover-close,
  .modal-close,
  .icon-btn.close {
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    touch-action: manipulation;
  }

  /* Modal Cancel/Save/Upload action buttons — 44px minimum height */
  [id*="Modal"] div[style*="flex-end"] button,
  [id*="Modal"] div[style*="justify-content"] button,
  .modal-overlay .modal-footer .btn,
  .modal-footer-bar .btn,
  .rain-day-modal-footer .rd-submit {
    min-height: 44px !important;
    padding: 10px 18px !important;
    font-size: 1rem !important;
    touch-action: manipulation;
  }

  /* Small list action buttons (Edit/Delete/Remove) */
  .btn-sm {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
    font-size: 0.85rem;
    touch-action: manipulation;
  }

  /* Quick Settings toggle — 44px minimum height */
  #quickSettingsToggle {
    min-height: 44px !important;
    touch-action: manipulation;
  }
}

/* ================================================================ */
/* OPS REPORTING VIEW (scoped under #opsReportingView)              */
/* ================================================================ */

#opsReportingView .or-content-area {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

/* Department Tabs */
#opsReportingView .or-dept-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow-x: auto;
}

#opsReportingView .or-dept-tab {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 150ms ease;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

#opsReportingView .or-dept-tab:hover { background: var(--slate-50); color: var(--text-primary); }

#opsReportingView .or-dept-tab.active { color: white; font-weight: 600; }
#opsReportingView .or-dept-tab.active[data-dept="Lawn"] { background: var(--green-600); }
#opsReportingView .or-dept-tab.active[data-dept="Pest"] { background: var(--orange-500); }
#opsReportingView .or-dept-tab.active[data-dept="Tree Care"] { background: var(--teal-500); }
#opsReportingView .or-dept-tab.active[data-dept="Liquid/Soil"] { background: var(--blue-500); }

/* Filter Bar */
#opsReportingView .or-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

#opsReportingView .or-period-toggle {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 3px;
  box-shadow: var(--shadow-sm);
}

#opsReportingView .or-period-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 150ms ease;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

#opsReportingView .or-period-btn:hover { color: var(--text-primary); }
#opsReportingView .or-period-btn.active { background: var(--accent-green); color: white; }

#opsReportingView .or-filter-bar input[type="date"],
#opsReportingView .or-filter-bar select {
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.8rem;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color 150ms ease;
}

#opsReportingView .or-filter-bar input[type="date"]:focus,
#opsReportingView .or-filter-bar select:focus {
  border-color: var(--accent-green);
}

#opsReportingView .or-apply-btn {
  padding: 7px 18px;
  background: var(--accent-green);
  color: white;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 150ms ease;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
#opsReportingView .or-apply-btn:hover { background: var(--accent-green-dark); }

/* Summary Cards */
#opsReportingView .or-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

#opsReportingView .or-summary-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 250ms ease;
}

#opsReportingView .or-summary-card:hover { box-shadow: var(--shadow-md); }

#opsReportingView .or-summary-card .or-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

#opsReportingView .or-summary-card .or-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

#opsReportingView .or-summary-card .or-card-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

#opsReportingView .or-summary-card .or-card-accent {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  margin-top: 12px;
}

/* Charts Grid */
#opsReportingView .or-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

#opsReportingView .or-chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

#opsReportingView .or-chart-card.wide { grid-column: span 2; }

#opsReportingView .or-chart-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

#opsReportingView .or-chart-wrap {
  position: relative;
  height: 280px;
}

#opsReportingView .or-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* Bottom Grid (Leaderboard + MDR) */
#opsReportingView .or-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

#opsReportingView .or-bottom-grid.no-mdr { grid-template-columns: 1fr; }

#opsReportingView .or-section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

#opsReportingView .or-section-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Leaderboard Table */
#opsReportingView .or-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#opsReportingView .or-leaderboard-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-subtle);
}

#opsReportingView .or-leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--text-primary);
}

#opsReportingView .or-leaderboard-table tr:last-child td { border-bottom: none; }

#opsReportingView .or-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

#opsReportingView .or-rank-1 { background: var(--yellow-100); color: #92400e; }
#opsReportingView .or-rank-2 { background: var(--slate-100); color: var(--slate-600); }
#opsReportingView .or-rank-3 { background: #fff7ed; color: #9a3412; }
#opsReportingView .or-rank-other { background: var(--slate-50); color: var(--slate-500); }

#opsReportingView .or-metric-highlight {
  font-weight: 700;
  font-size: 0.9rem;
}

/* MDR Stats */
#opsReportingView .or-mdr-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#opsReportingView .or-mdr-stat {
  text-align: center;
  padding: 16px 12px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
}

#opsReportingView .or-mdr-stat .or-big-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

#opsReportingView .or-mdr-stat .or-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Empty State */
#opsReportingView .or-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

#opsReportingView .or-empty-state .or-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

#opsReportingView .or-empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#opsReportingView .or-empty-state p {
  font-size: 0.85rem;
  max-width: 360px;
  margin: 0 auto;
}

/* Loading Overlay */
#opsReportingView .or-loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
}

#opsReportingView .or-loading-overlay.active { display: flex; }

#opsReportingView .or-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Skeleton Placeholders */
#opsReportingView .or-skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

#opsReportingView .or-skeleton-card { height: 120px; border-radius: var(--radius-lg); }
#opsReportingView .or-skeleton-chart { height: 280px; border-radius: var(--radius-lg); }

/* Employee Links */
#opsReportingView .employee-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-green);
  cursor: pointer;
  transition: all 150ms ease;
}
#opsReportingView .employee-link:hover {
  color: var(--accent-green-dark);
  border-bottom-style: solid;
}

/* Ops Reporting Responsive */
@media (max-width: 1024px) {
  #opsReportingView .or-summary-cards { grid-template-columns: repeat(2, 1fr); }
  #opsReportingView .or-charts-grid { grid-template-columns: 1fr; }
  #opsReportingView .or-chart-card.wide { grid-column: span 1; }
  #opsReportingView .or-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  #opsReportingView .or-summary-cards { grid-template-columns: 1fr; }
  #opsReportingView .or-dept-tabs { gap: 2px; padding: 3px; }
  #opsReportingView .or-dept-tab { min-width: 80px; padding: 8px 10px; font-size: 0.8rem; }
  #opsReportingView .or-filter-bar { gap: 8px; }
  #opsReportingView .or-filter-bar input[type="date"],
  #opsReportingView .or-filter-bar select { flex: 1; min-width: 0; }
  #opsReportingView .or-chart-wrap { height: 220px; }
  #opsReportingView .or-mdr-stats { grid-template-columns: 1fr; }
}


/* ================================================================ */
/* SUBMISSIONS VIEW (scoped under #submissionsView)                 */
/* ================================================================ */

/* View Management */
#submissionsView .sub-view { display: none; }
#submissionsView .sub-view.sub-active { display: block; }

#submissionsView .sub-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

#submissionsView .sub-bc-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#submissionsView .sub-bc-link:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

/* List Header */
#submissionsView .sub-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

#submissionsView .sub-list-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

#submissionsView .sub-list-header .sub-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-left: 8px;
  font-weight: 400;
}

/* Filters Bar */
#submissionsView .sub-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

#submissionsView .sub-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

#submissionsView .sub-filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#submissionsView .sub-filter-group select,
#submissionsView .sub-filter-group input {
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-card);
  outline: none;
  transition: border-color 150ms ease;
}

#submissionsView .sub-filter-group select:focus,
#submissionsView .sub-filter-group input:focus {
  border-color: var(--accent-green);
}

#submissionsView .sub-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

/* Submissions Table */
#submissionsView .sub-table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

#submissionsView .sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

#submissionsView .sub-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--slate-50);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

#submissionsView .sub-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-100);
  white-space: nowrap;
}

#submissionsView .sub-table tbody tr {
  cursor: pointer;
  transition: background 150ms ease;
}

#submissionsView .sub-table tbody tr:hover { background: var(--green-50); }
#submissionsView .sub-table tbody tr:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: -2px;
  background: var(--green-50);
}
#submissionsView .sub-table tbody tr:last-child td { border-bottom: none; }

/* Form Type & Company Badges */
#submissionsView .sub-form-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

#submissionsView .sub-form-type-badge.sub-teod { background: var(--blue-100); color: var(--blue-600); }
#submissionsView .sub-form-type-badge.sub-mdr { background: var(--purple-100); color: var(--purple-500); }

#submissionsView .sub-company-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
}

#submissionsView .sub-company-badge.sub-rlc { background: var(--teal-100); color: var(--teal-500); }
#submissionsView .sub-company-badge.sub-gx { background: var(--green-100); color: var(--green-700); }

/* Pagination */
#submissionsView .sub-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

#submissionsView .sub-pagination-controls {
  display: flex;
  gap: 4px;
}

/* Buttons (scoped) */
#submissionsView .sub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 150ms ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

#submissionsView .sub-btn-primary { background: var(--accent-green); color: white; }
#submissionsView .sub-btn-primary:hover { background: var(--accent-green-dark); }

#submissionsView .sub-btn-secondary {
  background: var(--slate-100);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
#submissionsView .sub-btn-secondary:hover { background: var(--slate-200); }

#submissionsView .sub-btn-ghost { color: var(--text-secondary); padding: 6px 10px; background: none; }
#submissionsView .sub-btn-ghost:hover { background: var(--slate-100); color: var(--text-primary); }

#submissionsView .sub-btn-danger {
  background: var(--red-100);
  color: var(--red-600);
  border: 1px solid transparent;
}
#submissionsView .sub-btn-danger:hover { background: var(--red-500); color: white; }

#submissionsView .sub-btn-sm { padding: 4px 10px; font-size: 0.8rem; }
#submissionsView .sub-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Detail Header */
#submissionsView .sub-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

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

/* Detail Meta Cards — green-tinted bar */
#submissionsView .sub-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 20px 24px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

#submissionsView .sub-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#submissionsView .sub-meta-item .sub-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green-700);
  margin-bottom: 2px;
}

#submissionsView .sub-meta-item .sub-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Section Cards */
#submissionsView .sub-section-card {
  background: var(--bg-card, white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

#submissionsView .sub-section-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--slate-50);
  color: var(--text-primary);
}

#submissionsView .sub-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#submissionsView .sub-section-count {
  margin-left: auto;
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
}

#submissionsView .sub-section-card-body {
  padding: 18px 20px;
}

/* Field Grid */
#submissionsView .sub-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

#submissionsView .sub-field-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#submissionsView .sub-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #64748b);
}

#submissionsView .sub-field-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

#submissionsView .sub-field-value.sub-computed { color: var(--blue-600); font-weight: 600; }
#submissionsView .sub-field-value.sub-empty { color: var(--text-muted, #94a3b8); font-style: italic; }

#submissionsView .sub-computed-tag {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--blue-500);
  text-transform: none;
  letter-spacing: 0;
}

/* JSON Key-Value Grid */
#submissionsView .sub-kv-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 0.85rem;
}
#submissionsView .sub-kv-key {
  color: var(--text-secondary, #64748b);
  font-weight: 500;
  white-space: nowrap;
}
#submissionsView .sub-kv-val {
  font-weight: 600;
  color: var(--text-primary);
}

/* Pill badges for arrays */
#submissionsView .sub-pill {
  display: inline-block;
  padding: 2px 10px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  color: var(--green-700);
  margin: 2px;
}

/* Bag Rate Status Badges */
#submissionsView .sub-bag-rate-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

#submissionsView .sub-bag-rate-status.optimal { background: var(--green-100); color: var(--green-700); }
#submissionsView .sub-bag-rate-status.heavy { background: var(--yellow-100); color: var(--yellow-600); }
#submissionsView .sub-bag-rate-status.very_heavy { background: var(--red-100); color: var(--red-600); }
#submissionsView .sub-bag-rate-status.light { background: var(--orange-100); color: var(--orange-500); }
#submissionsView .sub-bag-rate-status.very_light { background: var(--red-100); color: var(--red-600); }

/* Edit Banner (audit trail) */
#submissionsView .sub-edit-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: #854d0e;
  margin-bottom: 16px;
}
#submissionsView .sub-edit-banner::before { content: '\270F\FE0F'; }
#submissionsView .sub-edit-banner strong { font-weight: 700; }

#submissionsView .sub-edit-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

#submissionsView .sub-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#submissionsView .sub-edit-field label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

#submissionsView .sub-edit-field input,
#submissionsView .sub-edit-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-card);
  outline: none;
  transition: border-color 150ms ease;
}

#submissionsView .sub-edit-field input:focus,
#submissionsView .sub-edit-field textarea:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

#submissionsView .sub-edit-field input.sub-changed {
  border-color: var(--blue-500);
  background: var(--blue-100);
}

#submissionsView .sub-edit-field .sub-original-value {
  font-size: 0.7rem;
  color: var(--text-muted);
}

#submissionsView .sub-edit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

#submissionsView .sub-edit-reason-group { flex: 1; }

#submissionsView .sub-edit-reason-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

#submissionsView .sub-edit-reason-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

#submissionsView .sub-edit-reason-group input:focus {
  border-color: var(--accent-green);
}

/* Loading + Empty States */
#submissionsView .sub-loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

#submissionsView .sub-loading-state .sub-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

#submissionsView .sub-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

#submissionsView .sub-empty-state .sub-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* Employee Links */
#submissionsView .employee-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-green);
  cursor: pointer;
  transition: all 150ms ease;
}
#submissionsView .employee-link:hover {
  color: var(--accent-green-dark);
  border-bottom-style: solid;
}

/* Active Filter Badge */
#submissionsView .sub-active-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--green-700);
}

#submissionsView .sub-active-filter-badge .sub-clear-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green-200);
  color: var(--green-700);
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 150ms ease;
}

#submissionsView .sub-active-filter-badge .sub-clear-filter:hover {
  background: var(--green-300);
}

/* Submissions Responsive */
@media (max-width: 768px) {
  #submissionsView .sub-filters-bar { flex-direction: column; }
  #submissionsView .sub-filter-group { min-width: 100%; }
  #submissionsView .sub-detail-meta { grid-template-columns: 1fr 1fr; padding: 14px 16px; }
  #submissionsView .sub-field-grid { grid-template-columns: 1fr 1fr; }
  #submissionsView .sub-edit-field-grid { grid-template-columns: 1fr; }
  #submissionsView .sub-list-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  #submissionsView .sub-detail-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  #submissionsView .sub-edit-actions { flex-direction: column; }
  #submissionsView .sub-edit-reason-group { width: 100%; }
  #submissionsView .sub-section-card-header { padding: 12px 14px; }
  #submissionsView .sub-section-card-body { padding: 14px; }
  #submissionsView .sub-edit-banner { flex-wrap: wrap; }
  #submissionsView { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 480px) {
  #submissionsView .sub-detail-meta { grid-template-columns: 1fr; }
  #submissionsView .sub-field-grid { grid-template-columns: 1fr; }
  #submissionsView .sub-kv-grid { grid-template-columns: 1fr; gap: 2px 0; }
}

/* EOD Workbench Revamp */
#submissionsView .page-header {
  margin-bottom: 18px;
}

#submissionsView .sub-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: 18px;
  align-items: start;
}

#submissionsView .sub-workbench-main,
#submissionsView .sub-inspector {
  min-width: 0;
}

#submissionsView .sub-list-header {
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

#submissionsView .sub-list-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

#submissionsView .sub-list-header p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#submissionsView .sub-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#submissionsView .sub-chip-btn,
#submissionsView .sub-tab-btn,
#submissionsView .sub-page-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

#submissionsView .sub-chip-btn:hover,
#submissionsView .sub-tab-btn:hover,
#submissionsView .sub-page-btn:hover,
#submissionsView .sub-page-btn.sub-active,
#submissionsView .sub-chip-btn.sub-chip-active {
  background: var(--green-50);
  border-color: var(--green-300);
  color: var(--green-700);
}

#submissionsView .sub-edited-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.68rem;
  font-weight: 800;
  vertical-align: middle;
}

#submissionsView .sub-filters-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 1fr));
  align-items: end;
  border-radius: 8px;
  box-shadow: none;
}

#submissionsView .sub-filter-search {
  min-width: 220px;
}

#submissionsView .sub-filter-actions .btn {
  min-height: 34px;
}

#submissionsView .sub-table-wrap {
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

#submissionsView .sub-table tbody tr {
  scroll-margin-top: 96px;
}

#submissionsView .sub-table tbody tr.sub-selected {
  background: var(--green-50);
  box-shadow: inset 3px 0 0 var(--accent-green);
}

#submissionsView .sub-inspector {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

#submissionsView .sub-inspector::-webkit-scrollbar {
  width: 10px;
}

#submissionsView .sub-inspector::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border: 3px solid var(--bg-card);
  border-radius: 999px;
}

#submissionsView .sub-inspector-empty {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
  color: var(--text-secondary);
}

#submissionsView .sub-empty-eyebrow {
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid var(--green-200);
  border-radius: 999px;
  color: var(--green-700);
  background: var(--green-50);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#submissionsView .sub-inspector-empty h2 {
  margin: 12px 0 6px;
  color: var(--text-primary);
  font-size: 1.25rem;
}

#submissionsView .sub-inspector-empty p {
  margin: 0;
  line-height: 1.5;
}

#submissionsView .sub-inspector-view {
  display: none;
  padding: 18px;
}

#submissionsView .sub-inspector-view.sub-active {
  display: block;
}

#submissionsView .sub-detail-header {
  position: sticky;
  top: -18px;
  z-index: 2;
  margin: -18px -18px 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

#submissionsView .sub-detail-header-left {
  min-width: 0;
}

#submissionsView .sub-detail-header h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#submissionsView .sub-mobile-back {
  display: none;
}

#submissionsView .sub-detail-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

#submissionsView .sub-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

#submissionsView .sub-summary-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  background: var(--slate-50);
  min-width: 0;
}

#submissionsView .sub-summary-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#submissionsView .sub-summary-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.2;
}

#submissionsView .sub-summary-ok {
  background: var(--green-50);
  border-color: var(--green-200);
}

#submissionsView .sub-summary-warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

#submissionsView .sub-detail-tabs {
  position: sticky;
  top: 54px;
  z-index: 1;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 0 12px;
  margin-bottom: 2px;
  background: var(--bg-card);
}

#submissionsView .sub-section-card {
  border-radius: 8px;
  scroll-margin-top: 115px;
}

#submissionsView .sub-section-card-header {
  padding: 12px 14px;
}

#submissionsView .sub-section-card-body {
  padding: 14px;
}

#submissionsView .sub-field-grid,
#submissionsView .sub-edit-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#submissionsView .sub-field-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-card);
}

#submissionsView .sub-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#submissionsView .sub-field-value {
  line-height: 1.42;
  overflow-wrap: anywhere;
}

#submissionsView .sub-summary-loading {
  opacity: 0.72;
}

#submissionsView .sub-edit-actions {
  position: sticky;
  bottom: -18px;
  margin: 18px -18px -18px;
  padding: 14px 18px;
  background: var(--bg-card);
}

#submissionsView .sub-audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#submissionsView .sub-audit-entry {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  position: relative;
}

#submissionsView .sub-audit-entry:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: -14px;
  width: 2px;
  background: var(--border-subtle);
}

#submissionsView .sub-audit-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green-100);
  border: 2px solid var(--accent-green);
  margin-top: 2px;
  z-index: 1;
}

#submissionsView .sub-audit-body {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  background: var(--slate-50);
}

#submissionsView .sub-audit-original .sub-audit-body {
  background: var(--green-50);
  border-color: var(--green-200);
}

#submissionsView .sub-audit-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

#submissionsView .sub-audit-meta {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

#submissionsView .sub-audit-reason {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.83rem;
  font-weight: 600;
}

#submissionsView .sub-audit-changes {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

#submissionsView .sub-audit-change {
  display: grid;
  grid-template-columns: minmax(110px, 0.4fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-card);
}

#submissionsView .sub-audit-change span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#submissionsView .sub-audit-change strong {
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
}

#submissionsView .sub-audit-recalc,
#submissionsView .sub-audit-empty {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

@media (max-width: 1180px) {
  #submissionsView .sub-workbench {
    grid-template-columns: 1fr;
  }

  #submissionsView .sub-inspector {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 80;
    max-height: 86vh;
    border-radius: 14px 14px 0 0;
    display: none;
  }

  #submissionsView .sub-inspector.sub-open {
    display: block;
  }

  #submissionsView .sub-inspector-empty {
    display: none !important;
  }

  #submissionsView .sub-mobile-back {
    display: inline-flex;
  }
}

@media (max-width: 900px) {
  #submissionsView .sub-filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #submissionsView .sub-list-header {
    align-items: flex-start;
  }

  #submissionsView .sub-filters-bar {
    grid-template-columns: 1fr;
  }

  #submissionsView .sub-table {
    min-width: 760px;
  }

  #submissionsView .sub-detail-summary,
  #submissionsView .sub-detail-meta,
  #submissionsView .sub-field-grid,
  #submissionsView .sub-edit-field-grid,
  #submissionsView .sub-audit-change {
    grid-template-columns: 1fr;
  }
}

/* ================================================================ */
/* FIELD TOOLS LAUNCHER                                             */
/* ================================================================ */

.ft-department { margin-bottom: 32px; }

.department-header {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.ft-department:first-child .department-header { margin-top: 0; }

.ft-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Active tool card */
.field-tool-card.active {
  background: white;
  border: 1px solid #e0e0e0;
  border-left: 4px solid var(--primary-green, #2d5a3d);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}
.field-tool-card.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* Coming Soon card */
.field-tool-card.coming-soon {
  background: #fafafa;
  border: 1px dashed #d0d0d0;
  border-radius: 12px;
  padding: 24px;
  opacity: 0.75;
  cursor: default;
}

/* Card header */
.ft-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ft-card-icon { font-size: 1.4rem; }
.ft-card-code {
  font-family: 'Outfit', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
  letter-spacing: 0.5px;
}

/* Coming Soon badge */
.badge-coming-soon {
  display: inline-block;
  background: #f59e0b;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: auto;
}

.ft-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--text-primary, #111);
}
.ft-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  line-height: 1.5;
  margin: 0 0 16px 0;
}

/* Active card actions */
.ft-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ft-card-action {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.ft-action-primary {
  background: var(--primary-green, #2d5a3d);
  color: white;
}
.ft-action-primary:hover { background: #224a30; }
.ft-action-secondary {
  background: #f3f4f6;
  color: var(--text-primary, #374151);
}
.ft-action-secondary:hover { background: #e5e7eb; }

/* Coming Soon features */
.ft-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.ft-feature-tag {
  font-size: 0.72rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 6px;
}
.ft-card-target {
  font-size: 0.72rem;
  color: #9ca3af;
  font-style: italic;
}

/* My Work count badge */
.ft-count-badge {
  background: var(--primary-green, #2d5a3d);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Responsive: single column on mobile */
@media (max-width: 768px) {
  .ft-card-grid {
    grid-template-columns: 1fr;
  }
  .field-tool-card { padding: 18px; }
  .ft-card-actions { flex-direction: column; }
  .ft-card-action { width: 100%; justify-content: center; }
}

/* Dark mode */
[data-theme="dark"] .department-header {
  color: #9ca3af;
  border-bottom-color: #374151;
}
[data-theme="dark"] .field-tool-card.active {
  background: var(--card-bg, #1f2937);
  border-color: #374151;
  border-left-color: #4ade80;
}
[data-theme="dark"] .field-tool-card.active:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
[data-theme="dark"] .field-tool-card.coming-soon {
  background: var(--card-bg, #1f2937);
  border-color: #374151;
}
[data-theme="dark"] .ft-card-title { color: #e5e7eb; }
[data-theme="dark"] .ft-card-desc { color: #9ca3af; }
[data-theme="dark"] .ft-card-code { color: #9ca3af; }
[data-theme="dark"] .ft-action-secondary {
  background: #374151;
  color: #e5e7eb;
}
[data-theme="dark"] .ft-action-secondary:hover { background: #4b5563; }
[data-theme="dark"] .ft-feature-tag {
  background: #374151;
  color: #9ca3af;
}
[data-theme="dark"] .ft-card-target { color: #6b7280; }
[data-theme="dark"] .ft-count-badge { background: #4ade80; color: #111; }

/* ================================================================ */
/* ESTIMATES VIEW (scoped under #estimatesView)                     */
/* ================================================================ */

/* Stats Row */
#estimatesView .est-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

#estimatesView .est-stat-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
}

#estimatesView .est-stat-card.est-stat-green { border-left: 3px solid #16a34a; }
#estimatesView .est-stat-card.est-stat-amber { border-left: 3px solid #d97706; }

#estimatesView .est-stat-number {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary, #111);
  line-height: 1.1;
}

#estimatesView .est-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  margin-top: 4px;
}

#estimatesView .est-stat-sub {
  font-size: 0.72rem;
  opacity: 0.7;
}

/* Tabs */
#estimatesView .est-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light, #e5e7eb);
  margin-bottom: 14px;
}

#estimatesView .est-tab {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

#estimatesView .est-tab:hover { color: var(--text-primary, #111); }

#estimatesView .est-tab.active {
  color: var(--primary-green, #2d5a3d);
  border-bottom-color: var(--primary-green, #2d5a3d);
}

/* Filter Bar */
#estimatesView .est-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 8px;
}

#estimatesView .est-filter-group { display: flex; flex-direction: column; gap: 3px; }
#estimatesView .est-filter-group label { font-size: 0.72rem; color: var(--text-muted, #6b7280); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
#estimatesView .est-filter-group select,
#estimatesView .est-filter-group input[type="date"] {
  padding: 6px 10px;
  font-size: 0.82rem;
  border: 1px solid var(--border-light, #d1d5db);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  color: var(--text-primary, #111);
}

#estimatesView .est-filter-actions { display: flex; gap: 6px; align-items: flex-end; }

/* Table */
#estimatesView .est-table-wrap {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}

#estimatesView .est-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

#estimatesView .est-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b7280);
  background: var(--bg-subtle, #f9fafb);
  border-bottom: 1px solid var(--border-light, #e5e7eb);
}

#estimatesView .est-row {
  cursor: pointer;
  transition: background 0.12s;
}

#estimatesView .est-row:hover { background: var(--bg-subtle, #f9fafb); }
#estimatesView .est-row:not(:last-child) td { border-bottom: 1px solid var(--border-light, #f3f4f6); }

#estimatesView .est-row td { padding: 11px 14px; }
#estimatesView .est-cell-name { font-weight: 600; color: var(--text-primary, #111); }
#estimatesView .est-cell-num { color: var(--text-muted, #6b7280); font-size: 0.8rem; }
#estimatesView .est-cell-estimator { color: var(--text-secondary, #4b5563); font-size: 0.85rem; }
#estimatesView .est-cell-date { color: var(--text-secondary, #4b5563); font-size: 0.8rem; white-space: nowrap; }
#estimatesView .est-cell-gallons { font-weight: 600; }
#estimatesView .est-cell-programs { white-space: nowrap; }

/* Status Badges */
#estimatesView .est-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

#estimatesView .est-badge-gray   { background: #f3f4f6; color: #374151; }
#estimatesView .est-badge-blue   { background: #dbeafe; color: #1d4ed8; }
#estimatesView .est-badge-green  { background: #dcfce7; color: #166534; }
#estimatesView .est-badge-slate  { background: #e2e8f0; color: #334155; }
#estimatesView .est-badge-red    { background: #fee2e2; color: #991b1b; }

/* Program Badges */
#estimatesView .est-program-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  margin-right: 3px;
}

#estimatesView .est-no-programs { color: var(--text-muted, #9ca3af); }

/* Loading State */
#estimatesView .est-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--text-muted, #6b7280);
  font-size: 0.85rem;
}

#estimatesView .est-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border-light, #e5e7eb);
  border-top-color: var(--primary-green, #2d5a3d);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Empty State */
#estimatesView .est-empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted, #6b7280);
  font-size: 0.9rem;
}

#estimatesView .est-empty-icon { font-size: 2.4rem; margin-bottom: 10px; }

/* Evaluations Placeholder */
#estimatesView .est-placeholder-card {
  text-align: center;
  padding: 64px 20px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 12px;
  margin-top: 10px;
}

#estimatesView .est-placeholder-icon { font-size: 3rem; margin-bottom: 12px; }
#estimatesView .est-placeholder-card h3 { font-size: 1.1rem; margin: 0 0 6px; color: var(--text-primary, #111); }
#estimatesView .est-placeholder-card p { font-size: 0.88rem; color: var(--text-muted, #6b7280); margin: 0; }

/* Responsive */
@media (max-width: 900px) {
  #estimatesView .est-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  #estimatesView .est-stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  #estimatesView .est-stat-card { padding: 12px 10px; }
  #estimatesView .est-stat-number { font-size: 1.3rem; }

  #estimatesView .est-filter-bar { flex-direction: column; align-items: stretch; }
  #estimatesView .est-filter-group { width: 100%; }
  #estimatesView .est-filter-group select,
  #estimatesView .est-filter-group input[type="date"] { width: 100%; }

  /* Card layout on mobile instead of table */
  #estimatesView .est-table thead { display: none; }
  #estimatesView .est-table,
  #estimatesView .est-table tbody,
  #estimatesView .est-table tr,
  #estimatesView .est-table td { display: block; }

  #estimatesView .est-row {
    padding: 12px 14px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--card-bg, #fff);
  }

  #estimatesView .est-row td {
    padding: 2px 0;
    border: none !important;
  }

  #estimatesView .est-cell-name { font-size: 0.95rem; margin-bottom: 2px; }
  #estimatesView .est-cell-status { margin-top: 6px; }

  #estimatesView .est-cell-num::before { content: '#'; }
  #estimatesView .est-cell-gallons::before { content: 'Gallons: '; font-weight: 400; color: var(--text-muted, #6b7280); }
  #estimatesView .est-cell-estimator::before { content: 'Estimator: '; font-weight: 400; color: var(--text-muted, #6b7280); }
}

/* Dark Mode Overrides */
[data-theme="dark"] #estimatesView .est-badge-gray   { background: #374151; color: #d1d5db; }
[data-theme="dark"] #estimatesView .est-badge-blue   { background: rgba(37,99,235,0.2); color: #93c5fd; }
[data-theme="dark"] #estimatesView .est-badge-green  { background: rgba(22,163,74,0.2); color: #86efac; }
[data-theme="dark"] #estimatesView .est-badge-slate  { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] #estimatesView .est-badge-red    { background: rgba(153,27,27,0.2); color: #fca5a5; }
[data-theme="dark"] #estimatesView .est-program-badge { background: rgba(22,101,52,0.2); color: #86efac; border-color: rgba(22,101,52,0.4); }
[data-theme="dark"] #estimatesView .est-stat-card.est-stat-green { border-left-color: #22c55e; }
[data-theme="dark"] #estimatesView .est-stat-card.est-stat-amber { border-left-color: #f59e0b; }

/* ================================================================ */
/* ESTIMATE DETAIL VIEW                                              */
/* ================================================================ */

#estimatesView {
  position: relative;
  z-index: 0;
  isolation: isolate;
}

#estimatesView .est-detail-header { margin-bottom: 16px; }

#estimatesView .est-back-btn {
  background: none; border: none;
  color: var(--primary-green, #2d5a3d);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; padding: 6px 0; margin-bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: opacity 0.15s;
}
#estimatesView .est-back-btn:hover { opacity: 0.7; }

#estimatesView .est-detail-title {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
#estimatesView .est-detail-title h2 {
  font-size: 1.4rem; font-weight: 700;
  color: var(--text-primary, #111); margin: 0;
}
#estimatesView .est-detail-custnum {
  font-size: 0.85rem; color: var(--text-muted, #6b7280); font-weight: 500;
}
#estimatesView .est-detail-brand {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 8px; border-radius: 4px;
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
}
#estimatesView .est-detail-brand.greenx {
  background: #ecfdf5; color: #065f46; border-color: #a7f3d0;
}

/* Action Bar */
#estimatesView .est-detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px;
  padding: 12px 16px; background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, #e5e7eb); border-radius: 10px;
  position: relative;
  z-index: 0;
}
#estimatesView .est-action-btn {
  padding: 8px 16px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border-light, #d1d5db); border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
  background: var(--card-bg, #fff); color: var(--text-primary, #333);
  min-height: 36px;
  position: relative;
  z-index: 0;
}
#estimatesView .est-action-btn:hover { background: var(--bg-subtle, #f9fafb); }
#estimatesView .est-action-btn.est-btn-blue { background: #2563eb; color: #fff; border-color: #2563eb; }
#estimatesView .est-action-btn.est-btn-blue:hover { background: #1d4ed8; }
#estimatesView .est-action-btn.est-btn-green { background: #16a34a; color: #fff; border-color: #16a34a; }
#estimatesView .est-action-btn.est-btn-green:hover { background: #15803d; }
#estimatesView .est-action-btn.est-btn-slate { background: #475569; color: #fff; border-color: #475569; }
#estimatesView .est-action-btn.est-btn-slate:hover { background: #334155; }
#estimatesView .est-action-btn.est-btn-red-outline { background: transparent; color: #dc2626; border-color: #dc2626; }
#estimatesView .est-action-btn.est-btn-red-outline:hover { background: #fef2f2; }
#estimatesView .est-action-spacer { flex: 1; min-width: 20px; }

/* Two-Column Detail Body */
#estimatesView .est-detail-body {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start;
  position: relative;
  z-index: 0;
}

/* Detail Cards */
#estimatesView .est-detail-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px; padding: 18px;
}
#estimatesView .est-detail-left > .est-detail-card + .est-detail-card,
#estimatesView .est-detail-right > .est-detail-card + .est-detail-card { margin-top: 16px; }

#estimatesView .est-detail-card h3 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted, #6b7280);
  margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}

/* Customer Info Rows */
#estimatesView .est-info-row {
  display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem;
}
#estimatesView .est-info-label { color: var(--text-muted, #6b7280); font-weight: 500; }
#estimatesView .est-info-value {
  color: var(--text-primary, #111); font-weight: 600;
  text-align: right; max-width: 60%; word-break: break-word;
}

/* Inventory Items */
#estimatesView .est-inv-group-title {
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
  color: var(--primary-green, #2d5a3d); margin: 12px 0 6px; letter-spacing: 0.03em;
}
#estimatesView .est-inv-group-title:first-child { margin-top: 0; }
#estimatesView .est-inv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; font-size: 0.84rem;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}
#estimatesView .est-inv-item:last-child { border-bottom: none; }
#estimatesView .est-inv-qty { font-weight: 700; color: var(--primary-green, #2d5a3d); min-width: 28px; }
#estimatesView .est-inv-species { font-weight: 600; color: var(--text-primary, #111); }
#estimatesView .est-inv-meta { font-size: 0.78rem; color: var(--text-muted, #6b7280); }
#estimatesView .est-inv-flags { font-size: 0.82rem; }

/* Programs & Gallons */
#estimatesView .est-prog-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border-light, #f3f4f6);
}
#estimatesView .est-prog-row:last-child { border-bottom: none; }
#estimatesView .est-prog-name {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 0.76rem; font-weight: 700;
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
}
#estimatesView .est-prog-gal { font-weight: 700; font-size: 0.9rem; color: var(--text-primary, #111); }
#estimatesView .est-total-row {
  display: flex; justify-content: space-between;
  padding: 10px 0 0; margin-top: 8px;
  border-top: 2px solid var(--border-light, #e5e7eb);
  font-weight: 700; font-size: 0.95rem; color: var(--text-primary, #111);
}

/* Pricing */
#estimatesView .est-price-row {
  display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem;
}
#estimatesView .est-price-total {
  display: flex; justify-content: space-between;
  padding: 10px 0 0; margin-top: 8px;
  border-top: 2px solid var(--border-light, #e5e7eb);
  font-weight: 700; font-size: 1.1rem; color: var(--primary-green, #2d5a3d);
}

/* Notes */
#estimatesView .est-note-section { margin-bottom: 12px; }
#estimatesView .est-note-section:last-child { margin-bottom: 0; }
#estimatesView .est-note-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted, #6b7280);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px;
}
#estimatesView .est-note-text {
  font-size: 0.85rem; color: var(--text-primary, #111);
  white-space: pre-wrap; line-height: 1.5;
}

/* Audit Trail */
#estimatesView .est-audit-line {
  font-size: 0.82rem; color: var(--text-secondary, #4b5563); padding: 3px 0;
}
#estimatesView .est-no-data {
  font-size: 0.84rem; color: var(--text-muted, #9ca3af); font-style: italic; padding: 8px 0;
}

/* Detail Responsive */
@media (max-width: 900px) {
  #estimatesView .est-detail-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #estimatesView .est-detail-title h2 { font-size: 1.15rem; }
  #estimatesView .est-detail-actions { flex-direction: column; }
  #estimatesView .est-action-btn { width: 100%; text-align: center; }
  #estimatesView .est-action-spacer { display: none; }
}

/* Dark Mode — Detail */
[data-theme="dark"] #estimatesView .est-detail-brand { background: rgba(22,101,52,0.2); color: #86efac; border-color: rgba(22,101,52,0.4); }
[data-theme="dark"] #estimatesView .est-prog-name { background: rgba(22,101,52,0.2); color: #86efac; border-color: rgba(22,101,52,0.4); }
[data-theme="dark"] #estimatesView .est-price-total { color: #86efac; }
[data-theme="dark"] #estimatesView .est-inv-qty { color: #86efac; }
[data-theme="dark"] #estimatesView .est-inv-group-title { color: #86efac; }
[data-theme="dark"] #estimatesView .est-action-btn { background: var(--card-bg, #1f2937); color: var(--text-primary, #e5e7eb); border-color: var(--border-light, #374151); }

/* ================================================================ */
/* ESTIMATES DASHBOARD VIEW (R3)                                     */
/* ================================================================ */

/* Header */
#estimatesDashboardView .ed-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
#estimatesDashboardView .ed-header h1 {
  font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary, #111); margin: 0;
}
#estimatesDashboardView .ed-subtitle {
  font-size: 0.85rem; color: var(--text-muted, #6b7280); margin: 2px 0 0;
}
#estimatesDashboardView .ed-header-right {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
#estimatesDashboardView .ed-select {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-light, #e5e7eb);
  font-family: 'Outfit', sans-serif; font-size: 0.85rem;
  background: var(--card-bg, #fff); color: var(--text-primary, #111);
  cursor: pointer;
}
#estimatesDashboardView .ed-date-input {
  padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border-light, #e5e7eb);
  font-family: 'Outfit', sans-serif; font-size: 0.82rem;
  background: var(--card-bg, #fff); color: var(--text-primary, #111);
}
#estimatesDashboardView #ed-customDates {
  display: flex; gap: 6px; align-items: center;
}
#estimatesDashboardView .ed-print-btn {
  font-size: 0.82rem !important; padding: 5px 12px !important;
}
#estimatesDashboardView .ed-action-btn {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e5e7eb);
  background: var(--card-bg, #fff);
  color: var(--text-primary, #111);
  cursor: pointer;
}
#estimatesDashboardView .ed-action-btn:hover {
  background: var(--hover-bg, #f9fafb);
}

/* Filter Bar */
#estimatesDashboardView .ed-filter-bar {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 20px;
  background: var(--card-bg, #fff); border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); border: 1px solid var(--border-light, #f3f4f6);
}
#estimatesDashboardView .ed-filter-group {
  display: flex; flex-direction: column; gap: 4px;
}
#estimatesDashboardView .ed-filter-group label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted, #6b7280);
  text-transform: uppercase; letter-spacing: 0.04em;
}
#estimatesDashboardView .ed-filter-group select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-light, #e5e7eb);
  font-family: 'Outfit', sans-serif; font-size: 0.85rem;
  background: var(--card-bg, #fff); color: var(--text-primary, #111);
}
#estimatesDashboardView .ed-reset-link {
  font-size: 0.82rem; color: var(--primary-green, #2d5a3d); cursor: pointer;
  text-decoration: underline; padding-bottom: 6px;
}
#estimatesDashboardView .ed-dashboard-state,
#estimatesDashboardView .ed-inline-state {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light, #e5e7eb);
  background: var(--card-bg, #fff);
  color: var(--text-secondary, #475569);
}
#estimatesDashboardView .ed-dashboard-state.hidden,
#estimatesDashboardView .ed-inline-state.hidden {
  display: none;
}
#estimatesDashboardView .ed-dashboard-state.is-loading,
#estimatesDashboardView .ed-inline-state.is-loading {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
#estimatesDashboardView .ed-dashboard-state.is-warning,
#estimatesDashboardView .ed-inline-state.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
#estimatesDashboardView .ed-dashboard-state.is-error,
#estimatesDashboardView .ed-inline-state.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
#estimatesDashboardView .ed-dashboard-state.is-empty,
#estimatesDashboardView .ed-inline-state.is-empty {
  border-color: var(--border-light, #e5e7eb);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-secondary, #475569);
}
#estimatesDashboardView .ed-state-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: inherit;
}
#estimatesDashboardView .ed-state-copy {
  margin-top: 4px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: inherit;
}

/* KPI Cards */
#estimatesDashboardView .ed-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 12px;
}
#estimatesDashboardView .ed-kpi-card {
  background: var(--card-bg, #fff); border-radius: 12px;
  padding: 13px 16px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--border-light, #f3f4f6);
}
#estimatesDashboardView .ed-kpi-value {
  font-size: clamp(1.25rem, 1.8vw, 1.7rem); font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--primary-green, #2d5a3d);
}
#estimatesDashboardView .ed-kpi-label {
  font-size: 0.85rem; color: var(--text-muted, #888);
  margin-top: 4px; font-family: 'Outfit', sans-serif;
}
#estimatesDashboardView .ed-kpi-sub {
  font-size: 0.75rem; color: var(--text-muted, #aaa); margin-top: 2px;
}
#estimatesDashboardView .ed-kpi-bar {
  height: 6px; background: var(--border-light, #e5e7eb); border-radius: 3px;
  margin-top: 8px; overflow: hidden;
}
#estimatesDashboardView .ed-kpi-bar-fill {
  height: 100%; border-radius: 3px; transition: width 0.4s ease;
}

/* Charts */
#estimatesDashboardView .ed-chart-drilldown {
  border-color: rgba(124, 58, 237, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 245, 255, 0.68)),
    radial-gradient(circle at 96% 0%, rgba(124, 58, 237, 0.12), transparent 38%);
}

#estimatesDashboardView .ed-chart-insight-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

#estimatesDashboardView .ed-chart-insight-card {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-left: 4px solid var(--ed-insight-color, #7c3aed);
  border-radius: 16px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.88)),
    radial-gradient(circle at 96% 12%, color-mix(in srgb, var(--ed-insight-color, #7c3aed) 14%, transparent), transparent 36%);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

#estimatesDashboardView .ed-chart-insight-card--status { --ed-insight-color: #2563eb; }
#estimatesDashboardView .ed-chart-insight-card--trend { --ed-insight-color: #d97706; }
#estimatesDashboardView .ed-chart-insight-card--estimator { --ed-insight-color: #16a34a; }

#estimatesDashboardView .ed-chart-insight-card span,
#estimatesDashboardView .ed-chart-insight-card strong,
#estimatesDashboardView .ed-chart-insight-card p,
#estimatesDashboardView .ed-chart-insight-card em {
  display: block;
}

#estimatesDashboardView .ed-chart-insight-card > span {
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#estimatesDashboardView .ed-chart-insight-card > strong {
  margin-top: 6px;
  color: #0f172a;
  font-size: clamp(1rem, 1.35vw, 1.28rem);
  font-weight: 900;
  line-height: 1.08;
}

#estimatesDashboardView .ed-chart-insight-card p {
  margin: 7px 0 0;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.35;
}

#estimatesDashboardView .ed-chart-insight-card > em {
  margin-top: 8px;
  color: #64748b;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 700;
}

#estimatesDashboardView .ed-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

#estimatesDashboardView .ed-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--ed-status-color, #64748b) 26%, #ffffff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ed-status-color, #64748b) 9%, #ffffff);
  color: var(--ed-status-color, #64748b);
  font-size: 0.67rem;
  line-height: 1;
}

#estimatesDashboardView .ed-status-pill strong,
#estimatesDashboardView .ed-status-pill em {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-style: normal;
  line-height: 1;
}

#estimatesDashboardView .ed-rollout-panel {
  display: grid;
  gap: 12px;
}

#estimatesDashboardView .ed-rollout-panel__lead {
  padding: 14px 15px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.78));
}

#estimatesDashboardView .ed-rollout-panel__lead span,
#estimatesDashboardView .ed-rollout-metrics span {
  display: block;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#estimatesDashboardView .ed-rollout-panel__lead strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
}

#estimatesDashboardView .ed-rollout-panel__lead p {
  margin: 6px 0 0;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.4;
}

#estimatesDashboardView .ed-rollout-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#estimatesDashboardView .ed-rollout-metrics > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

#estimatesDashboardView .ed-rollout-metrics strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 900;
}

#estimatesDashboardView .ed-rollout-metrics em {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
}

#estimatesDashboardView .ed-rollout-steps {
  display: grid;
  gap: 8px;
}

#estimatesDashboardView .ed-charts-row {
  display: grid; grid-template-columns: minmax(260px, 0.85fr) minmax(420px, 1.15fr); gap: 12px;
  margin-bottom: 12px;
}
#estimatesDashboardView .ed-chart-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92)),
    radial-gradient(circle at 96% 0%, rgba(124, 58, 237, 0.08), transparent 40%);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.86);
}

#estimatesDashboardView .ed-chart-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #7c3aed;
}

#estimatesDashboardView .ed-chart-donut::before { background: #2563eb; }
#estimatesDashboardView .ed-chart-time::before { background: #d97706; }
#estimatesDashboardView .ed-chart-full::before { background: #16a34a; }

#estimatesDashboardView .ed-chart-card__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#estimatesDashboardView .ed-chart-card__header h3 {
  font-size: 0.98rem;
  font-weight: 850;
  color: #0f172a;
  margin: 0;
  font-family: 'Outfit', sans-serif;
}

#estimatesDashboardView .ed-chart-card__header p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.3;
}

#estimatesDashboardView .ed-chart-card__header > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.09);
  color: #6d28d9;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#estimatesDashboardView .ed-chart-wrap {
  position: relative;
  z-index: 1;
  height: 158px;
  padding: 4px 2px 0;
}
#estimatesDashboardView .ed-chart-wrap-wide {
  height: 118px;
}
#estimatesDashboardView .ed-chart-full {
  margin-bottom: 12px;
}

/* Activity Feed */
#estimatesDashboardView .ed-activity-card {
  background: var(--card-bg, #fff); border-radius: 12px;
  padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--border-light, #f3f4f6);
  margin-bottom: 12px;
}
#estimatesDashboardView .ed-activity-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
#estimatesDashboardView .ed-activity-header h3 {
  font-size: 1rem; font-weight: 600; color: var(--text-primary, #333);
  margin: 0; font-family: 'Outfit', sans-serif;
}
#estimatesDashboardView .ed-activity-count {
  font-size: 0.82rem; color: var(--text-muted, #888);
}
#estimatesDashboardView .ed-table-wrap {
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}
#estimatesDashboardView .ed-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card-bg, #fff);
}
#estimatesDashboardView .ed-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
#estimatesDashboardView .ed-table th {
  text-align: left; padding: 8px 12px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted, #6b7280);
  border-bottom: 2px solid var(--border-light, #e5e7eb);
}
#estimatesDashboardView .ed-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-light, #f3f4f6);
  color: var(--text-primary, #111);
}
#estimatesDashboardView .ed-row:hover {
  background: var(--hover-bg, #f9fafb);
}
#estimatesDashboardView .ed-table-action-cell {
  width: 1%;
  white-space: nowrap;
}
#estimatesDashboardView .ed-table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#estimatesDashboardView .ed-table-action-btn:hover {
  background: #dbeafe;
}
#estimatesDashboardView .ed-table-action-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* R9: Complaint Dashboard Section */
#estimatesDashboardView .ed-complaints-section { margin-top: 16px; }
#estimatesDashboardView .ed-section-header {
  font-family: 'Outfit', sans-serif; font-size: 1.05rem;
  font-weight: 600; color: var(--text-primary, #111);
  margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light, #e5e7eb);
}
#estimatesDashboardView .ed-complaint-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
#estimatesDashboardView .ed-complaint-card {
  background: var(--card-bg, #fff); border-radius: 10px;
  padding: 16px; text-align: center; border: 1px solid var(--border-light, #e5e7eb);
}
#estimatesDashboardView .ed-cc-value {
  font-family: 'Outfit', sans-serif; font-size: 1.8rem; font-weight: 700; line-height: 1.1;
}
#estimatesDashboardView .ed-cc-label {
  font-size: 0.78rem; color: var(--text-muted, #6b7280); margin-top: 4px; font-weight: 500;
}
#estimatesDashboardView .ed-cc-total .ed-cc-value { color: var(--primary-green, #2d5a3d); }
#estimatesDashboardView .ed-cc-high { border-left: 3px solid #ef4444; }
#estimatesDashboardView .ed-cc-high .ed-cc-value { color: #ef4444; }
#estimatesDashboardView .ed-cc-medium { border-left: 3px solid #d97706; }
#estimatesDashboardView .ed-cc-medium .ed-cc-value { color: #d97706; }
#estimatesDashboardView .ed-cc-low { border-left: 3px solid #6b7280; }
#estimatesDashboardView .ed-cc-low .ed-cc-value { color: #6b7280; }
#estimatesDashboardView .ed-complaint-empty {
  background: var(--card-bg, #fff); border-radius: 10px; padding: 20px;
  text-align: center; border: 1px solid var(--border-light, #e5e7eb);
  color: var(--text-muted, #6b7280); font-size: 0.9rem; grid-column: 1 / -1;
}
#estimatesDashboardView .ed-complaint-empty-icon { margin-right: 8px; }
#estimatesDashboardView .ed-complaints-body {
  display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start;
}
#estimatesDashboardView .ed-complaint-subhead {
  font-family: 'Outfit', sans-serif; font-size: 0.82rem; font-weight: 600;
  color: var(--text-primary, #333); text-transform: uppercase;
  letter-spacing: 0.5px; margin: 0 0 10px; padding: 0; border: none;
}
#estimatesDashboardView .ed-complaint-categories {
  background: var(--card-bg, #fff); border-radius: 10px;
  padding: 14px; border: 1px solid var(--border-light, #e5e7eb);
}
#estimatesDashboardView .ed-cat-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.82rem;
}
#estimatesDashboardView .ed-cat-label {
  width: 90px; text-align: right; color: var(--text-muted, #555); flex-shrink: 0; font-weight: 500;
}
#estimatesDashboardView .ed-cat-bar-wrap {
  flex: 1; background: var(--bg-light, #f3f4f6); border-radius: 4px; height: 14px; overflow: hidden;
}
#estimatesDashboardView .ed-cat-bar {
  height: 100%; background: var(--primary-green, #2d5a3d); border-radius: 4px;
  min-width: 4px; transition: width 0.3s ease;
}
#estimatesDashboardView .ed-cat-count {
  width: 24px; text-align: right; font-weight: 600; color: var(--text-primary, #333); font-size: 0.8rem;
}
#estimatesDashboardView .ed-complaint-feed {
  background: var(--card-bg, #fff); border-radius: 10px;
  padding: 14px; border: 1px solid var(--border-light, #e5e7eb); overflow: auto;
  max-height: 360px;
}
#estimatesDashboardView .ed-complaint-table th { font-size: 0.7rem; }
#estimatesDashboardView .ed-complaint-row td { font-size: 0.82rem; padding: 8px 10px; }
#estimatesDashboardView .ed-complaint-customer { font-weight: 600; white-space: nowrap; }
#estimatesDashboardView .ed-complaint-issue {
  color: var(--text-muted, #555); max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
#estimatesDashboardView .ed-complaint-cats { font-size: 0.75rem; color: var(--text-muted, #888); }
#estimatesDashboardView .ed-risk-dot { font-size: 0.9rem; }
#estimatesDashboardView .ed-action-badge {
  display: inline-block; font-size: 0.7rem; padding: 2px 8px;
  border-radius: 10px; font-weight: 600; white-space: nowrap;
}
#estimatesDashboardView .ed-action-escalate-to-leadership { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
#estimatesDashboardView .ed-action-call-customer { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
#estimatesDashboardView .ed-action-schedule-reservice { background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
#estimatesDashboardView .ed-action-offer-discount { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
#estimatesDashboardView .ed-action-monitor { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }
#estimatesDashboardView .ed-complaint-placeholder {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 0.86rem;
}
#estimatesDashboardView .ed-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52);
}
#estimatesDashboardView .ed-detail-modal.hidden { display: none; }
#estimatesDashboardView .ed-detail-modal__panel {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}
#estimatesDashboardView .ed-detail-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
}
#estimatesDashboardView .ed-detail-modal__header h3 {
  margin: 4px 0 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  color: var(--text-primary, #111);
}
#estimatesDashboardView .ed-detail-modal__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-light, #f3f4f6);
  color: var(--text-primary, #111);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
#estimatesDashboardView .ed-detail-modal__close:hover {
  background: var(--hover-bg, #e5e7eb);
}
#estimatesDashboardView .ed-detail-modal__body {
  overflow-y: auto;
  padding: 24px;
}
#estimatesDashboardView .ed-detail-modal__state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted, #6b7280);
  text-align: center;
}
#estimatesDashboardView .ed-detail-modal__spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(45, 90, 61, 0.18);
  border-top-color: var(--primary-green, #2d5a3d);
  animation: ed-detail-spin 0.8s linear infinite;
}
#estimatesDashboardView .ed-detail-summary {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
#estimatesDashboardView .ed-detail-summary__hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
#estimatesDashboardView .ed-detail-summary__eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}
#estimatesDashboardView .ed-detail-summary__hero h4 {
  margin: 6px 0 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  color: var(--text-primary, #111);
}
#estimatesDashboardView .ed-detail-summary__subhead {
  color: var(--text-muted, #6b7280);
}
#estimatesDashboardView .ed-detail-summary__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
#estimatesDashboardView .ed-detail-summary__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
#estimatesDashboardView .ed-detail-summary__metric {
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-light, #f8fafc);
  border: 1px solid var(--border-light, #e5e7eb);
}
#estimatesDashboardView .ed-detail-summary__metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}
#estimatesDashboardView .ed-detail-summary__metric-value {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #111);
}
#estimatesDashboardView .ed-detail-summary__sections {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
#estimatesDashboardView .ed-detail-summary__card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border-light, #e5e7eb);
  background: var(--card-bg, #fff);
}
#estimatesDashboardView .ed-detail-summary__card h5 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #111);
}
#estimatesDashboardView .ed-detail-summary__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#estimatesDashboardView .ed-detail-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}
#estimatesDashboardView .ed-detail-summary__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
#estimatesDashboardView .ed-detail-summary__label {
  color: var(--text-muted, #6b7280);
  font-size: 0.84rem;
}
#estimatesDashboardView .ed-detail-summary__value {
  color: var(--text-primary, #111);
  font-weight: 600;
  text-align: right;
}
#estimatesDashboardView .ed-detail-summary__programs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#estimatesDashboardView .ed-detail-summary__program {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf7ee;
  color: var(--primary-green, #2d5a3d);
  font-size: 0.8rem;
  font-weight: 600;
}
#estimatesDashboardView .ed-detail-summary__notes {
  white-space: pre-wrap;
  color: var(--text-primary, #374151);
  line-height: 1.5;
}

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

/* R9: Estimate Detail — Complaint Analysis Card */
#estimatesView .est-complaint-risk-badge {
  display: inline-block; font-size: 0.75rem; padding: 3px 10px;
  border-radius: 12px; font-weight: 600; font-family: 'Outfit', sans-serif;
}
#estimatesView .est-complaint-sentiment {
  font-style: italic; color: var(--text-muted, #555); margin: 10px 0;
  font-size: 0.88rem; line-height: 1.4; padding: 8px 12px;
  background: var(--bg-light, #f9fafb); border-radius: 8px;
  border-left: 3px solid var(--border-light, #d1d5db);
}
#estimatesView .est-complaint-list { margin: 12px 0; }
#estimatesView .est-complaint-item {
  padding: 8px 0; border-bottom: 1px solid var(--border-light, #f1f5f9);
}
#estimatesView .est-complaint-item:last-child { border-bottom: none; }
#estimatesView .est-complaint-item-text { font-size: 0.88rem; color: var(--text-primary, #333); margin-bottom: 4px; }
#estimatesView .est-complaint-item-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#estimatesView .est-complaint-cat-badge {
  display: inline-block; font-size: 0.7rem; padding: 1px 8px; border-radius: 8px;
  background: #f3f4f6; color: #6b7280; font-weight: 500; text-transform: capitalize;
}
#estimatesView .est-complaint-context { font-size: 0.78rem; color: var(--text-muted, #888); }
#estimatesView .est-complaint-action {
  font-size: 0.85rem; margin: 10px 0 6px; padding: 8px 12px;
  background: #fffbeb; border-radius: 8px; border: 1px solid #fde68a; color: #92400e;
}
#estimatesView .est-complaint-timestamp { font-size: 0.75rem; color: var(--text-muted, #aaa); margin-top: 8px; }
#estimatesView .est-reanalyze-btn { margin-top: 10px; font-size: 0.78rem; padding: 4px 12px; }

/* Responsive */
@media (max-width: 900px) {
  #estimatesDashboardView .ed-kpi-row { grid-template-columns: repeat(2, 1fr); }
  #estimatesDashboardView .ed-chart-insight-grid { grid-template-columns: 1fr; }
  #estimatesDashboardView .ed-charts-row { grid-template-columns: 1fr; }
  #estimatesDashboardView .ed-rollout-metrics { grid-template-columns: 1fr; }
  #estimatesDashboardView .ed-header { flex-direction: column; }
  #estimatesDashboardView .ed-complaint-cards { grid-template-columns: repeat(2, 1fr); }
  #estimatesDashboardView .ed-complaints-body { grid-template-columns: 1fr; }
  #estimatesDashboardView .ed-detail-summary__sections { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #estimatesDashboardView .ed-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #estimatesDashboardView .ed-filter-bar { flex-direction: column; gap: 10px; }
  #estimatesDashboardView .ed-kpi-card { padding: 10px; }
  #estimatesDashboardView .ed-kpi-value { font-size: 1.18rem; }
  #estimatesDashboardView .ed-kpi-label { font-size: 0.72rem; }
  #estimatesDashboardView .ed-kpi-sub { font-size: 0.66rem; }
  #estimatesDashboardView .ed-chart-card { padding: 12px; }
  #estimatesDashboardView .ed-chart-card__header { flex-direction: column; gap: 8px; }
  #estimatesDashboardView .ed-chart-card__header > span { align-self: flex-start; }
  #estimatesDashboardView .ed-chart-wrap { height: 148px; }
  #estimatesDashboardView .ed-chart-wrap-wide { height: 116px; }
  #estimatesDashboardView .ed-table-wrap { max-height: 260px; }
  #estimatesDashboardView .ed-complaint-cards { grid-template-columns: 1fr 1fr; }
  #estimatesDashboardView .ed-detail-modal { padding: 12px; }
  #estimatesDashboardView .ed-detail-modal__panel { max-height: calc(100vh - 24px); }
  #estimatesDashboardView .ed-detail-modal__header,
  #estimatesDashboardView .ed-detail-modal__body { padding: 16px; }
  #estimatesDashboardView .ed-detail-summary__hero { flex-direction: column; }
  #estimatesDashboardView .ed-detail-summary__metrics { grid-template-columns: 1fr; }
  #estimatesDashboardView .ed-detail-summary__actions { justify-content: flex-start; }
  #estimatesDashboardView .ed-detail-summary__row { flex-direction: column; gap: 4px; }
  #estimatesDashboardView .ed-detail-summary__value { text-align: left; }
}

/* Print */
@media print {
  .portal-sidebar, .portal-nav, .mobile-header, .bottom-nav,
  #estimatesDashboardView .ed-filter-bar,
  #estimatesDashboardView .ed-header-right,
  #estimatesDashboardView #ed-loadMore,
  #estimatesDashboardView .ed-detail-modal { display: none !important; }
  #estimatesDashboardView { width: 100% !important; padding: 0 !important; }
  #estimatesDashboardView .ed-kpi-card,
  #estimatesDashboardView .ed-chart-card,
  #estimatesDashboardView .ed-activity-card { box-shadow: none; border: 1px solid #ddd; }
  #estimatesDashboardView canvas { max-width: 100% !important; }
}

/* Dark Mode */
[data-theme="dark"] #estimatesDashboardView .ed-kpi-card,
[data-theme="dark"] #estimatesDashboardView .ed-chart-card,
[data-theme="dark"] #estimatesDashboardView .ed-activity-card,
[data-theme="dark"] #estimatesDashboardView .ed-filter-bar {
  background: var(--card-bg, #1f2937);
  border-color: var(--border-light, #374151);
}
[data-theme="dark"] #estimatesDashboardView .ed-select,
[data-theme="dark"] #estimatesDashboardView .ed-filter-group select,
[data-theme="dark"] #estimatesDashboardView .ed-date-input {
  background: var(--card-bg, #1f2937); color: var(--text-primary, #e5e7eb);
  border-color: var(--border-light, #374151);
}
[data-theme="dark"] #estimatesDashboardView .ed-row:hover {
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] #estimatesDashboardView .ed-complaint-card,
[data-theme="dark"] #estimatesDashboardView .ed-complaint-categories,
[data-theme="dark"] #estimatesDashboardView .ed-complaint-feed,
[data-theme="dark"] #estimatesDashboardView .ed-complaint-empty {
  background: var(--card-bg, #1f2937); border-color: var(--border-light, #374151);
}
[data-theme="dark"] #estimatesDashboardView .ed-detail-modal__panel,
[data-theme="dark"] #estimatesDashboardView .ed-detail-summary__card,
[data-theme="dark"] #estimatesDashboardView .ed-detail-summary__metric {
  background: var(--card-bg, #1f2937);
  border-color: var(--border-light, #374151);
}
[data-theme="dark"] #estimatesDashboardView .ed-detail-modal__close {
  background: #374151;
  color: var(--text-primary, #e5e7eb);
}
[data-theme="dark"] #estimatesDashboardView .ed-detail-summary__program {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}
[data-theme="dark"] #estimatesView .est-complaint-sentiment {
  background: var(--card-bg, #1f2937); border-color: var(--border-light, #374151);
}
[data-theme="dark"] #estimatesView .est-complaint-cat-badge {
  background: #374151; color: #9ca3af;
}
[data-theme="dark"] #estimatesView .est-complaint-action {
  background: #3730241a; border-color: #92400e40; color: #fbbf24;
}

/* VOC Queue */
.voc-queue-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.voc-queue-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.07), transparent 32%),
    linear-gradient(180deg, var(--bg-card, #fff), var(--bg-card-alt, #f8fafc));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.voc-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voc-filter-group--company {
  align-items: flex-end;
}

.voc-toolbar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.voc-filter-tabs {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.voc-filter-tab,
.triage-filter-pill {
  border: 1px solid var(--border-default, #e2e8f0);
  background: var(--bg-card, #fff);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.18s ease;
}

.voc-filter-tab.active,
.triage-filter-pill.active {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.18);
}

.voc-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.voc-summary-card {
  margin-bottom: 0;
}

.voc-queue-list {
  display: grid;
  gap: 16px;
}
.voc-queue-list--has-critical {
  border: 2px solid rgba(220,38,38,0.15);
  border-radius: 12px;
  padding: 8px;
  animation: voc-list-pulse 3s infinite;
}
@keyframes voc-list-pulse {
  0%,100% { border-color: rgba(220,38,38,0.10); }
  50% { border-color: rgba(220,38,38,0.30); }
}
.voc-priority-badge { font-size: 10px; vertical-align: middle; margin-right: 2px; }

.vq-card-quality-row,
.vq-confidence-chip,
.vq-confidence-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vq-card-quality-row {
  margin: 10px 0 4px;
}

.vq-confidence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.vq-confidence-dot.high { background: #22c55e; }
.vq-confidence-dot.med { background: #eab308; }
.vq-confidence-dot.low { background: #94a3b8; }

.vq-severity-badge {
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}

.vq-severity-badge.critical { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.vq-severity-badge.high { background: rgba(249, 115, 22, 0.15); color: #c2410c; }
.vq-severity-badge.medium { background: rgba(234, 179, 8, 0.15); color: #a16207; }
.vq-severity-badge.low { background: rgba(100, 116, 139, 0.15); color: #64748b; }

.vq-no-target {
  font-size: 0.7rem;
  color: #d97706;
  margin-left: 8px;
}

/* Critical hold items */
.voc-queue-item--critical-hold {
  border-left: 4px solid var(--accent-red, #dc2626) !important;
  background: var(--accent-red-light, rgba(220, 38, 38, 0.04));
}

.vq-complaint-border--critical {
  border-left-width: 6px;
  border-left-color: #dc2626 !important;
}

.vq-complaint-border--high {
  border-left-width: 6px;
  border-left-color: #f97316 !important;
}

.vq-complaint-border--medium {
  border-left-width: 6px;
  border-left-color: #eab308 !important;
}

.vq-complaint-border--low {
  border-left-width: 6px;
  border-left-color: #94a3b8 !important;
}

/* Repeat complaint badge */
.voc-repeat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
}

/* Positive Highlights cards */
.voc-highlight-card {
  background: var(--bg-card, #fff);
  border-left: 3px solid #f59e0b;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  margin-bottom: 12px;
}
.voc-highlight-star {
  font-size: 1.2em;
  margin-bottom: 4px;
}
.voc-highlight-employee {
  font-weight: 700;
  font-size: 1.1em;
  color: var(--text-primary, #0f172a);
  margin-bottom: 4px;
}
.voc-highlight-quote {
  font-style: italic;
  color: var(--text-secondary, #475569);
  margin: 8px 0;
  border-left: 2px solid #e5e7eb;
  padding-left: 12px;
}
.voc-highlight-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
}
.voc-highlight-share {
  font-size: 0.75rem;
}

.voc-queue-card {
  border-radius: 20px;
  border: 1px solid var(--border-default, #e2e8f0);
  border-left: 4px solid #94a3b8;
  background: var(--bg-card, #fff);
  padding: 22px 24px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.voc-queue-card--compliment { border-left-color: #16a34a; }
.voc-queue-card--complaint { border-left-color: #dc2626; }
.voc-queue-card--legal_flag { border-left-color: #dc2626; }
.voc-queue-card--safety_flag { border-left-color: #ef4444; }
.voc-queue-card--brand_mention { border-left-color: #2563eb; }
.voc-queue-card--neutral { border-left-color: #94a3b8; }

.voc-queue-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.voc-queue-card--pulse {
  animation: vocPulseBorder 1.8s ease-in-out infinite;
}

@keyframes vocPulseBorder {
  0%, 100% { box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06), 0 0 0 0 rgba(220, 38, 38, 0.14); }
  50% { box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06), 0 0 0 6px rgba(220, 38, 38, 0.06); }
}

.voc-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.voc-card-badges,
.voc-action-row,
.voc-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.voc-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

.voc-company-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-secondary);
}

.voc-company-pill.rlc {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.voc-company-pill.gx {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.voc-card-confidence {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.voc-card-copy {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.voc-context-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.voc-context-line strong {
  color: var(--text-secondary);
  font-weight: 700;
}

.voc-quote-block {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 4px solid #4f46e5;
  border-radius: 14px;
  background: rgba(79, 70, 229, 0.06);
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.65;
}

.voc-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}

.voc-badge--compliment { background: #dcfce7; color: #166534; }
.voc-badge--complaint { background: #fee2e2; color: #b91c1c; }
.voc-badge--legal,
.voc-badge--critical {
  background: #dc2626;
  color: #fff;
}

.voc-badge--safety { background: #fee2e2; color: #b91c1c; }
.voc-badge--brand { background: #dbeafe; color: #1d4ed8; }
.voc-badge--neutral { background: #e2e8f0; color: #475569; }
.voc-badge--high { background: #ffedd5; color: #c2410c; }

.voc-badge--legal {
  animation: vocLegalPulse 1.6s ease-in-out infinite;
}

@keyframes vocLegalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.16); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.06); }
}

.voc-action-row {
  margin-top: 16px;
  gap: 10px;
}

.voc-btn-approve {
  background: transparent;
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.24);
}

.voc-btn-escalate {
  background: transparent;
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.24);
}

.voc-btn-dismiss {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default, #cbd5e1);
}

.voc-action-row .btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: none;
}

.voc-action-row .btn:hover {
  transform: translateY(-1px);
}

.voc-editor-shell {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--bg-card-alt, #f8fafc);
  border: 1px solid var(--border-default, #dbe2ea);
}

.voc-editor-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-secondary);
}

.voc-editor-shell textarea,
.voc-editor-shell select {
  width: 100%;
}

.voc-editor-shell textarea {
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--border-default, #cbd5e1);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-card, #fff);
}

.voc-editor-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.voc-queue-empty {
  padding: 42px 24px;
  text-align: center;
  color: var(--text-muted);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--bg-card, #fff), var(--bg-card-alt, #f8fafc));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.voc-queue-empty-illustration {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.voc-queue-empty h3 {
  color: var(--text-primary);
  margin-bottom: 6px;
}

.voc-queue-empty p {
  max-width: 420px;
  margin: 0 auto;
}

.voc-queue-toolbar .company-toggle-container {
  margin-bottom: 0;
}

.voc-queue-toolbar .company-toggle {
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 999px;
  padding: 4px;
}

.voc-queue-toolbar .company-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.voc-queue-toolbar .company-btn.active {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ch-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ch-header-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-right: 12px;
}

.ch-header-meta .data-freshness,
.ch-inline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-default, #e2e8f0);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.ch-inline-chip strong {
  color: var(--text-primary);
}

.ch-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ch-stat-card {
  background: var(--bg-card, #fff);
}

.ch-filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.ch-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.ch-filter-group--search {
  flex: 1 1 220px;
}

.ch-filter-group--dates {
  flex: 1 1 260px;
}

.ch-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ch-filter-control {
  min-height: 42px;
  border-radius: 999px;
  background: var(--bg-card, #fff);
}

.ch-date-range {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ch-filter-clear {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 14px;
}

.ch-filter-search {
  min-width: 220px;
}

.ch-call-list {
  display: grid;
  gap: 14px;
}

.ch-call-card {
  border: 1px solid var(--border-default, #e2e8f0);
  border-left: 4px solid #94a3b8;
  border-radius: 18px;
  background: var(--bg-card, #fff);
  padding: 18px 20px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ch-call-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.ch-call-card--inbound { border-left-color: var(--accent-green, #16a34a); }
.ch-call-card--outbound { border-left-color: var(--accent-blue, #2563eb); }

.ch-call-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.ch-call-main {
  display: flex;
  gap: 14px;
  min-width: 0;
  flex: 1 1 360px;
}

.ch-call-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f1f5f9);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.ch-call-content {
  min-width: 0;
  flex: 1 1 auto;
}

.ch-call-title-row,
.ch-call-meta-row,
.ch-call-secondary-row,
.ch-inline-actions,
.ch-utility-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ch-call-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ch-duration-badge,
.ch-company-pill,
.ch-recording-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ch-duration-badge {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-secondary);
}

.ch-company-pill.rlc {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.ch-company-pill.gx {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.ch-recording-pill {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
}

.ch-call-meta-row,
.ch-call-secondary-row {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.ch-call-secondary-row strong {
  color: var(--text-secondary);
}

.ch-voc-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.ch-voc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.ch-voc-dot.processed { background: var(--accent-green, #16a34a); }
.ch-voc-dot.pending { background: var(--accent-amber, #d97706); }
.ch-voc-dot.none { background: #94a3b8; }
.ch-voc-dot.error { background: var(--accent-red, #dc2626); }

.ch-inline-actions {
  justify-content: flex-end;
}

.ch-inline-actions .btn {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 14px;
}

.ch-transcript-preview {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-card-alt, #f8fafc);
  color: var(--text-secondary);
  line-height: 1.6;
}

.ch-expand-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-default, #e2e8f0);
}

.ch-transcript-body {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  background: var(--bg-card-alt, #f8fafc);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 14px;
  padding: 14px;
}

.ch-empty-state {
  text-align: center;
  padding: 42px 24px;
  border-radius: 18px;
}

.ch-empty-illustration {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.ch-empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 6px;
}

.ch-empty-state p {
  color: var(--text-muted);
  margin: 0;
}

.ch-pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.ch-pagination-summary {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.ch-pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  .voc-summary-row {
    grid-template-columns: 1fr;
  }

  .ch-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voc-filter-group--company {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .voc-queue-toolbar,
  .voc-queue-card {
    padding: 16px;
  }

  .voc-queue-toolbar {
    align-items: stretch;
  }

  .voc-editor-actions {
    justify-content: stretch;
  }

  .voc-editor-actions .btn,
  .voc-action-row .btn {
    flex: 1 1 100%;
  }

  .ch-filter-group {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .ch-filter-group--search,
  .ch-filter-group--dates {
    flex-basis: 100%;
  }

  .ch-date-range {
    width: 100%;
  }

  .ch-date-range .ch-filter-control {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .ch-filter-clear {
    width: 100%;
  }

  .ch-call-card {
    padding: 16px;
  }

  .ch-call-main {
    flex-basis: 100%;
  }

  .ch-inline-actions {
    justify-content: flex-start;
  }

  .ch-inline-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }
}

/* === Reporting Pages === */
.reporting-card,
.reporting-panel {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  padding: 24px;
  margin-bottom: 16px;
}

.reporting-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.reporting-card-title--error {
  color: #dc2626;
}

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

.reporting-card-subtitle {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.reporting-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reporting-card-body {
  min-width: 0;
}

.reporting-card-body--muted,
.reporting-empty-copy {
  color: #6b7280;
}

.reporting-empty-copy {
  margin: 0;
}

.reporting-empty-copy--success {
  color: #15803d;
  font-weight: 600;
}

.reporting-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}

.reporting-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

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

.reporting-link-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.reporting-link-card:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.reporting-link-card__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.reporting-link-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.reporting-link-card__title {
  font-size: 0.95rem;
  font-weight: 700;
}

.reporting-link-card__copy {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #64748b;
}

/* --- Reporting accent color system --- */
[data-reporting-accent="home"] { --reporting-accent: #16a34a; --reporting-accent-light: rgba(22, 163, 74, 0.1); }
[data-reporting-accent="alert"] { --reporting-accent: #ea580c; --reporting-accent-light: rgba(234, 88, 12, 0.1); }
[data-reporting-accent="notify"] { --reporting-accent: #ca8a04; --reporting-accent-light: rgba(202, 138, 4, 0.1); }
[data-reporting-accent="voice"] { --reporting-accent: #2563eb; --reporting-accent-light: rgba(37, 99, 235, 0.1); }
[data-reporting-accent="fleet"] { --reporting-accent: #d97706; --reporting-accent-light: rgba(217, 119, 6, 0.1); }
[data-reporting-accent="people"] { --reporting-accent: #0891b2; --reporting-accent-light: rgba(8, 145, 178, 0.1); }
[data-reporting-accent="archive"] { --reporting-accent: #9333ea; --reporting-accent-light: rgba(147, 51, 234, 0.1); }
[data-reporting-accent="tools"] { --reporting-accent: #4f46e5; --reporting-accent-light: rgba(79, 70, 229, 0.1); }
[data-reporting-accent="insight"] { --reporting-accent: #7c3aed; --reporting-accent-light: rgba(124, 58, 237, 0.1); }
[data-reporting-accent="neutral"] { --reporting-accent: #64748b; --reporting-accent-light: rgba(100, 116, 139, 0.08); }

#reportingHomeView.reporting-surface,
#estimatesDashboardView.reporting-surface,
#executiveArchiveView.reporting-surface {
  position: relative;
  isolation: isolate;
}

#reportingHomeView.reporting-surface::before,
#estimatesDashboardView.reporting-surface::before,
#executiveArchiveView.reporting-surface::before {
  content: "";
  position: absolute;
  inset: -18px -18px auto -18px;
  height: 360px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.42));
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--reporting-accent, #16a34a) 20%, transparent), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(15, 23, 42, 0.08), transparent 30%),
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.42));
  border-radius: 28px;
}

#reportingHomeView .reporting-section-header--decorated,
#estimatesDashboardView .ed-header,
#executiveArchiveView .page-header {
  padding: 22px 24px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.76)),
    linear-gradient(90deg, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), transparent);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

#reportingHomeView .reporting-content-grid > .reporting-card,
#estimatesDashboardView .ed-command-grid > .reporting-card,
#executiveArchiveView .reporting-archive-intelligence-grid > .reporting-card {
  border-color: rgba(148, 163, 184, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    radial-gradient(circle at top right, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), transparent 44%);
}

#reportingHomeView .reporting-table-wrap,
#estimatesDashboardView .reporting-table-wrap {
  border: 1px solid rgba(226, 232, 240, 0.78);
  border-radius: 16px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.86);
}

#reportingHomeView .reporting-table,
#estimatesDashboardView .reporting-table {
  min-width: 780px;
}

#reportingHomeView .reporting-table th,
#estimatesDashboardView .reporting-table th {
  background: rgba(248, 250, 252, 0.92);
}

.reporting-home-decision-spine {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.reporting-home-decision-step {
  position: relative;
  min-height: 168px;
  padding: 18px 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.88)),
    radial-gradient(circle at 94% 8%, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), transparent 42%);
}

.reporting-home-decision-step::after {
  content: "";
  position: absolute;
  inset: auto -24px -38px auto;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: var(--reporting-accent-light, rgba(22, 163, 74, 0.08));
}

.reporting-home-decision-step span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--reporting-accent, #16a34a);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
}

.reporting-home-decision-step strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 12px;
  color: #0f172a;
  font-size: 0.92rem;
}

.reporting-home-decision-step p {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.45;
}

#estimatesDashboardView .ed-decision-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#estimatesDashboardView .ed-decision-step {
  position: relative;
  min-height: 178px;
  padding: 18px 16px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

#estimatesDashboardView .ed-decision-step::after {
  content: "";
  position: absolute;
  inset: auto -20px -32px auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.14);
  background: color-mix(in srgb, var(--ed-step-color, #64748b) 16%, transparent);
}

#estimatesDashboardView .ed-decision-step span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ed-step-color, #64748b);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

#estimatesDashboardView .ed-decision-step strong {
  display: block;
  margin-top: 14px;
  color: #0f172a;
  font-size: 0.95rem;
}

#estimatesDashboardView .ed-decision-step p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.45;
}

#estimatesDashboardView .ed-decision-step--risk { --ed-step-color: #dc2626; }
#estimatesDashboardView .ed-decision-step--watch { --ed-step-color: #d97706; }
#estimatesDashboardView .ed-decision-step--normal { --ed-step-color: #16a34a; }
#estimatesDashboardView .ed-decision-step--limited { --ed-step-color: #64748b; }

#estimatesDashboardView .ed-activity-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

#estimatesDashboardView .ed-pipeline-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#estimatesDashboardView .ed-pipeline-health-card {
  min-height: 164px;
  padding: 18px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.88)),
    radial-gradient(circle at 92% 10%, rgba(100, 116, 139, 0.1), transparent 42%);
}

#estimatesDashboardView .ed-pipeline-health-card span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#estimatesDashboardView .ed-pipeline-health-card strong {
  display: block;
  margin-top: 12px;
  color: #0f172a;
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  line-height: 1;
}

#estimatesDashboardView .ed-pipeline-health-card p {
  margin: 10px 0 0;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.45;
}

#estimatesDashboardView .ed-pipeline-health-card--normal { border-color: rgba(22, 163, 74, 0.2); background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 244, 0.76)); }
#estimatesDashboardView .ed-pipeline-health-card--watch { border-color: rgba(217, 119, 6, 0.2); background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 235, 0.82)); }
#estimatesDashboardView .ed-pipeline-health-card--risk { border-color: rgba(220, 38, 38, 0.2); background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(254, 242, 242, 0.82)); }
#estimatesDashboardView .ed-pipeline-health-card--limited { border-color: rgba(100, 116, 139, 0.24); background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.9)); }

#estimatesDashboardView .ed-empty-msg {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed rgba(124, 58, 237, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(250, 245, 255, 0.78), rgba(255, 255, 255, 0.86)),
    radial-gradient(circle at 92% 8%, rgba(124, 58, 237, 0.14), transparent 38%);
}

#peoplePerformanceCenterView .people-center-efficiency-panel {
  --people-efficiency-accent: #0891b2;
}

#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-filter-bar,
#peoplePerformanceCenterView .people-center-efficiency-panel .fleet-center-callout {
  border-color: rgba(8, 145, 178, 0.18);
  background:
    linear-gradient(135deg, rgba(236, 254, 255, 0.72), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 94% 8%, rgba(8, 145, 178, 0.16), transparent 34%);
}

#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-card {
  border-color: rgba(8, 145, 178, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.68)),
    radial-gradient(circle at top right, rgba(8, 145, 178, 0.08), transparent 46%);
}

#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-table-wrap {
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 16px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.9);
}

#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-table {
  min-width: 980px;
}

#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(240, 253, 250, 0.96);
}

#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-table td {
  vertical-align: top;
}

.people-center-coaching-panel .reporting-table,
#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-table {
  font-size: 0.82rem;
}

.people-center-coaching-panel .reporting-table th,
#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-table th {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.people-center-coaching-panel .reporting-table td,
#peoplePerformanceCenterView .people-center-efficiency-panel .reporting-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.people-signal-chip {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  max-width: 190px;
  margin: 0 4px 5px 0;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  color: #334155;
  font-size: 0.68rem;
  line-height: 1.22;
  vertical-align: top;
}

.people-signal-chip strong {
  color: inherit;
  font-weight: 850;
}

.people-signal-chip em {
  color: inherit;
  font-style: normal;
  font-weight: 650;
  opacity: 0.82;
}

.people-signal-chip--positive {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(240, 253, 244, 0.94);
  color: #166534;
}

.people-signal-chip--risk {
  border-color: rgba(190, 18, 60, 0.18);
  background: rgba(255, 241, 242, 0.94);
  color: #9f1239;
}

.people-signal-chip--watch {
  border-color: rgba(217, 119, 6, 0.2);
  background: rgba(255, 251, 235, 0.94);
  color: #92400e;
}

.people-signal-chip--context {
  max-width: 172px;
}

.people-center-coaching-panel .reporting-card {
  border-color: rgba(8, 145, 178, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.82)),
    radial-gradient(circle at top right, rgba(8, 145, 178, 0.07), transparent 44%);
}

.people-center-coaching-panel .reporting-content-grid > .reporting-card:nth-child(2n) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 247, 237, 0.62)),
    radial-gradient(circle at top right, rgba(234, 88, 12, 0.08), transparent 44%);
}

.people-efficiency-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.people-efficiency-command-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.people-efficiency-command-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-left: 4px solid #0891b2;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 254, 255, 0.52)),
    radial-gradient(circle at 92% 0%, rgba(8, 145, 178, 0.14), transparent 38%);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.people-efficiency-command-card--positive {
  border-left-color: #16a34a;
  background:
    linear-gradient(180deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.9)),
    radial-gradient(circle at 92% 0%, rgba(22, 163, 74, 0.16), transparent 38%);
}

.people-efficiency-command-card--risk {
  border-left-color: #be123c;
  background:
    linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 255, 255, 0.9)),
    radial-gradient(circle at 92% 0%, rgba(190, 18, 60, 0.14), transparent 38%);
}

.people-efficiency-command-card--guardrail {
  border-left-color: #7c3aed;
}

.people-efficiency-command-card span,
.people-efficiency-command-card strong,
.people-efficiency-command-card em {
  display: block;
}

.people-efficiency-command-card span {
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.people-efficiency-command-card strong {
  margin-top: 5px;
  overflow: hidden;
  color: #0f172a;
  font-size: clamp(0.98rem, 1.3vw, 1.28rem);
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-efficiency-command-card em {
  margin-top: 6px;
  color: #64748b;
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.2;
}

.people-efficiency-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(8, 145, 178, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(236, 254, 255, 0.78), rgba(255, 255, 255, 0.94));
}

.people-efficiency-action-strip strong,
.people-efficiency-action-strip span {
  display: block;
}

.people-efficiency-action-strip strong {
  color: #0f172a;
  font-size: 0.86rem;
}

.people-efficiency-action-strip span {
  margin-top: 3px;
  color: #475569;
  font-size: 0.76rem;
  line-height: 1.28;
}

.people-efficiency-diagnostic-card {
  position: relative;
  min-height: 154px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88)),
    radial-gradient(circle at 90% 12%, color-mix(in srgb, var(--people-efficiency-card-color, #0891b2) 14%, transparent), transparent 38%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.people-efficiency-diagnostic-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.12);
  background: color-mix(in srgb, var(--people-efficiency-card-color, #0891b2) 13%, transparent);
}

.people-efficiency-diagnostic-card span,
.people-efficiency-diagnostic-card strong,
.people-efficiency-diagnostic-card p {
  position: relative;
  z-index: 1;
}

.people-efficiency-diagnostic-card span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-efficiency-diagnostic-card strong {
  display: block;
  margin-top: 10px;
  color: #0f172a;
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  line-height: 1.08;
}

.people-efficiency-diagnostic-card p {
  margin: 10px 0 0;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.45;
}

.people-efficiency-diagnostic-card--threshold { --people-efficiency-card-color: #0891b2; }
.people-efficiency-diagnostic-card--risk { --people-efficiency-card-color: #be123c; }
.people-efficiency-diagnostic-card--guardrail { --people-efficiency-card-color: #0f766e; }

.people-efficiency-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.people-efficiency-flow-step {
  padding: 18px 16px;
  border: 1px solid rgba(8, 145, 178, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 254, 255, 0.58)),
    radial-gradient(circle at top right, rgba(8, 145, 178, 0.1), transparent 42%);
}

.people-efficiency-flow-step span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.12);
  color: #155e75;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-efficiency-flow-step strong {
  display: block;
  margin-top: 12px;
  color: #0f172a;
  font-size: 0.94rem;
}

.people-efficiency-flow-step p {
  margin: 8px 0 0;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.45;
}

#executiveArchiveView .reporting-digest-search-panel {
  position: relative;
  border: 1px solid rgba(147, 51, 234, 0.18);
  background:
    linear-gradient(135deg, rgba(250, 245, 255, 0.92), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 88% 10%, rgba(147, 51, 234, 0.16), transparent 34%);
  box-shadow: 0 16px 40px rgba(88, 28, 135, 0.08);
}

#executiveArchiveView .reporting-digest-card {
  border-color: rgba(147, 51, 234, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 245, 255, 0.72)),
    radial-gradient(circle at top right, rgba(147, 51, 234, 0.1), transparent 46%);
}

.executive-archive-workbench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.executive-archive-workbench__card {
  position: relative;
  min-height: 174px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-left: 4px solid #9333ea;
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(250, 245, 255, 0.84)),
    radial-gradient(circle at 92% 12%, rgba(147, 51, 234, 0.16), transparent 36%);
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(88, 28, 135, 0.07);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.executive-archive-workbench__card:hover {
  transform: translateY(-2px);
  border-color: rgba(147, 51, 234, 0.38);
  box-shadow: 0 18px 38px rgba(88, 28, 135, 0.12);
}

.executive-archive-workbench__card span,
.executive-archive-workbench__card strong,
.executive-archive-workbench__card p,
.executive-archive-workbench__card em {
  position: relative;
  z-index: 1;
  display: block;
}

.executive-archive-workbench__card span,
.executive-archive-usecase span {
  color: #7e22ce;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.executive-archive-workbench__card strong {
  margin-top: 10px;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.1;
}

.executive-archive-workbench__card p {
  margin: 10px 0 0;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.42;
}

.executive-archive-workbench__card em {
  margin-top: 14px;
  color: #581c87;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.executive-archive-usecases {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.executive-archive-usecase {
  min-height: 148px;
  padding: 15px 14px;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.9)),
    radial-gradient(circle at 90% 8%, rgba(168, 85, 247, 0.1), transparent 34%);
}

.executive-archive-usecase strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.16;
}

.executive-archive-usecase p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.38;
}

#executiveArchiveView .reporting-archive-timeline-item {
  padding: 0 0 18px 26px;
}

@media (max-width: 900px) {
  .reporting-home-decision-spine,
  .executive-archive-usecases,
  .executive-archive-workbench,
  #estimatesDashboardView .ed-pipeline-health-grid,
  .people-efficiency-command-grid,
  .people-efficiency-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #estimatesDashboardView .ed-decision-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-efficiency-diagnostic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #reportingHomeView .reporting-section-header--decorated,
  #estimatesDashboardView .ed-header,
  #executiveArchiveView .page-header {
    padding: 16px;
    border-radius: 18px;
  }

  #estimatesDashboardView .ed-decision-map {
    grid-template-columns: 1fr;
  }

  .reporting-home-decision-spine,
  .executive-archive-usecases,
  .executive-archive-workbench,
  #estimatesDashboardView .ed-pipeline-health-grid,
  .people-efficiency-command-grid,
  .people-efficiency-flow {
    grid-template-columns: 1fr;
  }

  .people-efficiency-action-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .people-efficiency-action-strip .fleet-center-callout__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .people-efficiency-command-card {
    padding: 9px;
  }

  .reporting-home-decision-step,
  .executive-archive-workbench__card,
  .executive-archive-usecase,
  #estimatesDashboardView .ed-pipeline-health-card {
    min-height: 0;
  }

  #estimatesDashboardView .ed-decision-step {
    min-height: 0;
  }

  #estimatesDashboardView .reporting-card {
    max-height: 600px;
    overflow: auto;
  }

  #executiveArchiveView .reporting-card {
    max-height: 600px;
    overflow: auto;
  }

  .people-efficiency-diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .people-efficiency-diagnostic-card {
    min-height: 0;
  }
}

/* --- Reporting icon shell (SVG wrapper) --- */
.reporting-icon-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--reporting-accent, currentColor);
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.reporting-icon-shell svg {
  width: 100%;
  height: 100%;
}

.reporting-icon-shell--sm {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  opacity: 1;
}

/* --- Reporting nav items (accent-aware active + hover states) --- */
.reporting-nav-item:hover .reporting-icon-shell {
  opacity: 1;
  transform: scale(1.08);
}

.reporting-nav-item.active {
  background: linear-gradient(135deg, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), rgba(0, 0, 0, 0.02));
  color: var(--reporting-accent, var(--accent-green));
  border-left-color: var(--reporting-accent, var(--accent-green));
}

.reporting-nav-item.active .reporting-icon-shell {
  opacity: 1;
}

.reporting-nav-item:hover {
  background: var(--reporting-accent-light, rgba(0, 0, 0, 0.03));
}

.reporting-nav-item .reporting-icon-shell {
  color: var(--reporting-accent, var(--text-muted));
}

.reporting-nav-item.active .reporting-icon-shell {
  color: var(--reporting-accent, var(--accent-green));
}

/* --- Reporting surface (top-level view container) --- */
.reporting-surface {
  min-height: 0;
  width: 100%;
}

/* --- Reporting center shell (shared center wrapper) --- */
.reporting-center-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Accent border on reporting link cards */
.reporting-link-card[data-reporting-accent] {
  border-left: 3px solid var(--reporting-accent, var(--accent-green));
}

.reporting-link-card[data-reporting-accent] .reporting-icon-shell {
  color: var(--reporting-accent, var(--accent-green));
}

.reporting-filter-group--grow {
  flex: 1 1 240px;
}

.reporting-filter-select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #d1d5db);
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary);
  font: inherit;
}

.reporting-filter-input {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #d1d5db);
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary);
  font: inherit;
}

.reporting-filter-select:focus {
  outline: none;
  border-color: var(--accent-green);
}

.reporting-filter-input:focus {
  outline: none;
  border-color: var(--accent-green);
}

.reporting-filter-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

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

.reporting-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.reporting-section-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.reporting-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.hours-recon-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hours-recon-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hours-recon-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.hours-recon-compact-nav,
.hours-recon-filters-card {
  margin-bottom: 0;
}

.hours-recon-compact-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.hours-recon-topline-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.hours-recon-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.96);
}

.hours-recon-compact-note,
.hours-recon-hero-note {
  max-width: 320px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(245, 243, 255, 0.9), rgba(255, 255, 255, 0.98));
  color: #5b21b6;
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
}

.hours-recon-utilities-wrap {
  margin-top: 4px;
}

.hours-recon-filter-bar {
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.hours-recon-week-group {
  gap: 4px;
}

.hours-recon-week-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.hours-recon-week-chip {
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: #f8fafc;
}

.hours-recon-week-chip strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 15px;
}

.hours-recon-payroll-layout {
  display: grid;
  grid-template-columns: minmax(0, minmax(620px, 1.7fr)) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.hours-recon-main-column,
.hours-recon-side-column {
  min-width: 0;
}

.hours-recon-main-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hours-recon-side-column {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hours-recon-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hours-recon-file-group {
  min-width: 280px;
  flex: 1;
}

.hours-recon-helper-copy {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.hours-recon-exceptions-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.hours-recon-shell[data-help-mode="compact"] {
  gap: 10px;
}

.hours-recon-shell[data-help-mode="compact"] .reporting-card,
.hours-recon-shell[data-help-mode="compact"] .hours-recon-filters-card {
  padding-top: 14px;
  padding-bottom: 14px;
}

.hours-recon-shell[data-help-mode="compact"] .reporting-card-subtitle,
.hours-recon-shell[data-help-mode="compact"] .hours-recon-compact-note,
.hours-recon-shell[data-help-mode="compact"] .hours-recon-hero-note {
  font-size: 11px;
}

.hours-recon-shell[data-help-mode="compact"] .hours-recon-compact-note,
.hours-recon-shell[data-help-mode="compact"] .hours-recon-hero-note {
  padding: 8px 10px;
}

.hours-recon-shell[data-help-mode="compact"] .hours-recon-filter-bar {
  gap: 10px;
}

.hours-recon-shell[data-help-mode="compact"] .hr-review-summary-grid,
.hours-recon-shell[data-help-mode="compact"] .hr-summary-stats,
.hours-recon-shell[data-help-mode="compact"] .hr-review-detail-grid {
  gap: 8px;
}

.hours-recon-shell[data-help-mode="compact"] .hr-review-section p,
.hours-recon-shell[data-help-mode="compact"] .hr-review-timeline-item p,
.hours-recon-shell[data-help-mode="compact"] .hr-payroll-mini-card p,
.hours-recon-shell[data-help-mode="compact"] .hr-payroll-workflow-card-copy {
  font-size: 0.76rem;
}

.hours-recon-shell[data-help-mode="compact"] .hr-help-text,
.hours-recon-shell[data-help-mode="compact"] details.hr-review-section summary + div,
.hours-recon-shell[data-help-mode="compact"] .hr-payroll-guide details,
.hours-recon-shell[data-help-mode="compact"] .hr-payroll-guide summary + * {
  font-size: 0.8rem;
}

.hours-recon-shell[data-help-mode="compact"] .hr-help-text {
  display: none !important;
}

.hours-recon-shell[data-help-mode="compact"] .hr-review-timeline-item,
.hours-recon-shell[data-help-mode="compact"] .hr-review-section,
.hours-recon-shell[data-help-mode="compact"] .hr-payroll-batch-section,
.hours-recon-shell[data-help-mode="compact"] .hr-payroll-item,
.hours-recon-shell[data-help-mode="compact"] .hr-payroll-mini-card {
  padding-top: 10px;
  padding-bottom: 10px;
}

.hr-payroll-batch-card--primary {
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
}

.hr-payroll-run-audit {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.hr-payroll-run-audit-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.hr-payroll-run-audit-head h4 {
  margin: 4px 0 6px 0;
  font-size: 1.05rem;
  color: #0f172a;
}

.hr-payroll-run-audit-head p {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
}

.hr-payroll-run-audit-badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.hr-payroll-run-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.hr-payroll-run-audit-stat {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.9);
}

.hr-payroll-run-audit-stat strong {
  display: block;
  font-size: 1rem;
  color: #0f172a;
}

.hr-payroll-run-audit-stat span {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 0.78rem;
}

.hr-payroll-run-audit-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hr-payroll-run-audit-notes span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: #334155;
  font-size: 0.76rem;
}

.hr-payroll-workspace-grid,
.hr-shadow-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.hr-payroll-workspace-main,
.hr-payroll-workspace-side {
  min-width: 0;
}

.hr-payroll-workspace-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hours-recon-exceptions-sidegrid {
  margin-top: 0;
  margin-bottom: 0;
}

.hours-recon-detail-block {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .hours-recon-payroll-layout,
  .hours-recon-exceptions-grid {
    grid-template-columns: 1fr;
  }

  .hours-recon-compact-topline {
    flex-direction: column;
  }

  .hours-recon-topline-actions,
  .hr-payroll-workspace-grid,
  .hr-shadow-shell {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hr-payroll-run-audit-head {
    flex-direction: column;
  }

  .hours-recon-side-column {
    position: static;
  }
}

@media (max-width: 720px) {
  .hours-recon-tabbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hours-recon-week-controls,
  .hours-recon-inline-actions,
  .hours-recon-topline-actions,
  .hours-recon-mode-switch {
    width: 100%;
  }

  .hours-recon-week-controls > *,
  .hours-recon-inline-actions > *,
  .hours-recon-mode-switch > * {
    flex: 1 1 auto;
  }
}

.reporting-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.reporting-stat-grid--cards {
  margin-bottom: 20px;
}

.reporting-stat-grid--3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reporting-skeleton-card {
  min-height: 80px;
  background: var(--surface-2, #f8fafc);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reporting-skeleton-panel {
  margin-top: 16px;
}

.reporting-skeleton-panel__body {
  padding: 20px;
}

.reporting-stat-card,
.reporting-stat {
  text-align: center;
  padding: 14px 12px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 12px;
}

.reporting-stat-card {
  position: relative;
  text-align: left;
  padding: 18px 20px 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.reporting-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--reporting-accent, #16a34a);
}

.reporting-stat-card-label,
.reporting-stat-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.reporting-stat-card-value,
.reporting-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
  margin-top: 8px;
}

.reporting-stat-card-subvalue {
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.reporting-stat-card-delta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reporting-stat--green { background: #f0fdf4; }
.reporting-stat--green .reporting-stat-value { color: #166534; }
.reporting-stat--red { background: #fef2f2; }
.reporting-stat--red .reporting-stat-value { color: #b91c1c; }
.reporting-stat--yellow { background: #fffbeb; }
.reporting-stat--yellow .reporting-stat-value { color: #b45309; }
.reporting-stat--blue { background: #eff6ff; }
.reporting-stat--blue .reporting-stat-value { color: #1d4ed8; }

.reporting-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.reporting-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 520px;
}

.reporting-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.reporting-th--sortable {
  cursor: pointer;
  height: 44px;
  user-select: none;
}

.reporting-th--sortable:hover {
  background: rgba(var(--border-rgb, 15 23 42), 0.05);
}

.reporting-th--sortable.sort-asc::after {
  content: ' ▲';
  font-size: 0.7em;
  opacity: 0.7;
}

.reporting-th--sortable.sort-desc::after {
  content: ' ▼';
  font-size: 0.7em;
  opacity: 0.7;
}

.reporting-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  background: #fff;
}

.reporting-table tr:last-child td {
  border-bottom: none;
}

.reporting-tr--alt {
  background: rgba(var(--border-rgb, 15 23 42), 0.03);
}

.reporting-table tr:hover td {
  background: #f9fafb;
}

.reporting-table-empty {
  text-align: center;
  padding: 32px;
  color: #6b7280;
}

.reporting-th--center {
  text-align: center !important;
}

.reporting-th--right {
  text-align: right !important;
}

.reporting-cell-center {
  text-align: center;
}

.reporting-cell-right {
  text-align: right;
}

.reporting-cell-strong {
  font-weight: 600;
}

.reporting-cell-muted {
  color: #6b7280;
}

.reporting-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e5e7eb;
  color: #374151;
}

.reporting-pill--green {
  background: #dcfce7;
  color: #166534;
}

.reporting-pill--amber {
  background: #fef3c7;
  color: #b45309;
}

.reporting-pill--blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.reporting-pill--score {
  background: var(--reporting-pill-bg, #f3f4f6);
  color: var(--reporting-pill-color, #374151);
}

.reporting-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.reporting-rank-badge--top-1 { background: #16a34a; color: #fff; }
.reporting-rank-badge--top-2 { background: #dbeafe; color: #1d4ed8; }
.reporting-rank-badge--top-3 { background: #ffedd5; color: #c2410c; }
.reporting-rank-badge--default { background: #e5e7eb; color: #475569; }

.reporting-trend-row {
  display: grid;
  grid-template-columns: minmax(84px, 110px) minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.reporting-trend-label {
  font-weight: 600;
  color: #374151;
}

.reporting-trend-track {
  background: #e5eef8;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  width: 100%;
}

.trend-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-bar {
  height: 10px;
  border-radius: 999px;
  background: #3b82f6;
  min-width: 6px;
}

.trend-bar--red { background: #ef4444; }
.trend-bar--green { background: #10b981; }
.trend-bar--yellow { background: #f59e0b; }
.trend-bar--blue { background: #3b82f6; }

.reporting-trend-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #111827;
}

.reporting-inline-alert {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  margin-bottom: 20px;
}

.reporting-inline-alert--warning {
  background: #fffbeb;
  border-color: #fcd34d;
}

.reporting-inline-alert-title {
  font-weight: 700;
  color: #b45309;
  margin-bottom: 4px;
}

.reporting-inline-alert-copy {
  color: #6b7280;
  font-size: 14px;
}

.reporting-state-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  padding: 24px;
}

.reporting-state-card--empty,
.reporting-state-card--error {
  text-align: left;
}

.reporting-state-eyebrow {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reporting-state-title {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  margin: 10px 0 8px;
}

.reporting-state-copy {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  max-width: 48rem;
}

.reporting-state-card--error {
  border-color: rgba(248, 113, 113, 0.38);
  background: linear-gradient(180deg, #fff7f7, #ffffff);
}

.reporting-severity-badge,
.reporting-scope-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.reporting-severity-badge--normal,
.reporting-scope-chip--normal {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.reporting-severity-badge--watch,
.reporting-scope-chip--watch {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
}

.reporting-severity-badge--risk,
.reporting-scope-chip--risk {
  background: rgba(249, 115, 22, 0.15);
  color: #9a3412;
}

.reporting-severity-badge--critical,
.reporting-scope-chip--critical {
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
}

.reporting-severity-badge--limited,
.reporting-scope-chip--limited {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.reporting-insight-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.36fr);
  gap: 18px;
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-left: 5px solid var(--reporting-hero-accent, #64748b);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.86), transparent 35%),
    linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.reporting-insight-hero--normal { --reporting-hero-accent: #16a34a; }
.reporting-insight-hero--watch { --reporting-hero-accent: #d97706; }
.reporting-insight-hero--risk { --reporting-hero-accent: #ea580c; }
.reporting-insight-hero--critical { --reporting-hero-accent: #dc2626; }
.reporting-insight-hero--limited { --reporting-hero-accent: #64748b; }

.reporting-insight-hero--compact {
  gap: 14px;
  padding: 18px;
}

.reporting-insight-hero--compact .reporting-insight-hero__title {
  margin: 9px 0 6px;
  font-size: clamp(1.12rem, 1.8vw, 1.55rem);
}

.reporting-insight-hero--compact .reporting-insight-hero__summary {
  font-size: 0.92rem;
  line-height: 1.44;
}

.reporting-insight-hero--compact .reporting-insight-hero__facts {
  gap: 8px;
  margin-top: 11px;
}

.reporting-insight-hero--compact .reporting-insight-hero__facts div,
.reporting-insight-hero--compact .reporting-insight-hero__meta-item {
  padding: 9px 10px;
}

.reporting-insight-hero__main,
.reporting-insight-hero__meta {
  min-width: 0;
}

.reporting-insight-hero__eyebrow,
.reporting-insight-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reporting-insight-hero__title {
  margin: 12px 0 8px;
  color: #0f172a;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  line-height: 1.12;
}

.reporting-insight-hero__summary {
  max-width: 68rem;
  margin: 0;
  color: #334155;
  font-size: 0.98rem;
  line-height: 1.55;
}

.reporting-insight-hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.reporting-insight-hero__facts div,
.reporting-insight-hero__meta-item {
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.reporting-insight-hero__facts strong,
.reporting-insight-hero__meta-item span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reporting-insight-hero__facts span,
.reporting-insight-hero__meta-item strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.4;
}

.reporting-insight-hero__meta {
  display: grid;
  gap: 10px;
  align-content: start;
}

.reporting-insight-hero__actions {
  grid-column: 1 / -1;
}

.reporting-priority-queue {
  display: grid;
  gap: 10px;
}

.reporting-priority-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-left: 4px solid var(--reporting-priority-accent, #64748b);
  border-radius: 14px;
  background: #fff;
}

.reporting-priority-item--normal { --reporting-priority-accent: #16a34a; }
.reporting-priority-item--watch { --reporting-priority-accent: #d97706; }
.reporting-priority-item--risk { --reporting-priority-accent: #ea580c; }
.reporting-priority-item--critical { --reporting-priority-accent: #dc2626; }
.reporting-priority-item--limited { --reporting-priority-accent: #64748b; }

.reporting-priority-item__rank {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 800;
}

.reporting-priority-item__topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reporting-priority-item__body p {
  margin: 5px 0 0;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.42;
}

.reporting-priority-item__body > span {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 0.8rem;
}

.reporting-data-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin: 12px 0 18px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
}

.reporting-data-trust-strip__item {
  min-width: 130px;
  flex: 1 1 130px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
}

.reporting-data-trust-strip__item span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reporting-data-trust-strip__item strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1.35;
}

.reporting-card--flush .reporting-card-body {
  padding-top: 0;
}

.reporting-question-router {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.reporting-question-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  width: 100%;
  min-height: 126px;
  padding: 14px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-left: 4px solid var(--reporting-accent, #16a34a);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
    radial-gradient(circle at 100% 0%, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), transparent 34%);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.reporting-question-card:hover {
  border-color: var(--reporting-accent, #16a34a);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.reporting-question-card__icon {
  color: var(--reporting-accent, #16a34a);
}

.reporting-question-card__body {
  min-width: 0;
}

.reporting-question-card__body strong,
.reporting-question-card__body em,
.reporting-question-card__action {
  display: block;
}

.reporting-question-card__body strong {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.22;
}

.reporting-question-card__body em {
  margin-top: 7px;
  color: #64748b;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.4;
}

.reporting-question-card__action {
  grid-column: 2;
  align-self: end;
  margin-top: 10px;
  color: var(--reporting-accent, #16a34a);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reporting-center-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.reporting-center-status-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 264px;
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-top: 5px solid var(--reporting-accent, #16a34a);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at 100% 0%, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), transparent 32%);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.reporting-center-status-card:hover {
  border-color: var(--reporting-accent, #16a34a);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.reporting-center-status-card__top,
.reporting-center-status-card__signal,
.reporting-center-status-card__evidence {
  display: flex;
  gap: 8px;
}

.reporting-center-status-card__top {
  align-items: center;
  justify-content: space-between;
}

.reporting-center-status-card__icon {
  color: var(--reporting-accent, #16a34a);
}

.reporting-center-status-card__title {
  display: block;
  color: #0f172a;
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.15;
}

.reporting-center-status-card__question {
  display: block;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.38;
}

.reporting-center-status-card__signal,
.reporting-center-status-card__evidence {
  flex-direction: column;
  padding: 10px 11px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.reporting-center-status-card__signal strong,
.reporting-center-status-card__evidence strong {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reporting-center-status-card__signal em,
.reporting-center-status-card__evidence em {
  color: #0f172a;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.35;
}

.reporting-center-status-card__cta {
  display: block;
  margin-top: auto;
  color: var(--reporting-accent, #16a34a);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reporting-manager-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.reporting-manager-flow__step {
  position: relative;
  min-width: 0;
  padding: 14px 13px 13px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 15px;
  background: rgba(248, 250, 252, 0.82);
}

.reporting-manager-flow__step span {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border-radius: 999px;
  background: var(--reporting-accent-light, rgba(22, 163, 74, 0.12));
  color: var(--reporting-accent, #16a34a);
  font-size: 0.76rem;
  font-weight: 900;
}

.reporting-manager-flow__step strong {
  display: block;
  color: #0f172a;
  font-size: 0.86rem;
  line-height: 1.24;
}

.reporting-manager-flow__step p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.36;
}

#voiceIntelligenceCenterView,
#fleetOperationsCenterView,
#peoplePerformanceCenterView,
#estimatesDashboardView,
#executiveArchiveView,
#reportingHomeView {
  --reporting-density-card-pad: 18px;
  --reporting-density-card-gap: 12px;
  --reporting-density-grid-gap: 14px;
  --reporting-density-radius: 16px;
}

#voiceIntelligenceCenterView .reporting-card,
#voiceIntelligenceCenterView .reporting-panel,
#fleetOperationsCenterView .reporting-card,
#fleetOperationsCenterView .reporting-panel,
#peoplePerformanceCenterView .reporting-card,
#peoplePerformanceCenterView .reporting-panel,
#estimatesDashboardView .reporting-card,
#estimatesDashboardView .reporting-panel,
#executiveArchiveView .reporting-card,
#executiveArchiveView .reporting-panel,
#reportingHomeView .reporting-card,
#reportingHomeView .reporting-panel {
  border-radius: var(--reporting-density-radius);
  padding: var(--reporting-density-card-pad);
  margin-bottom: 12px;
}

#voiceIntelligenceCenterView .reporting-card-header,
#fleetOperationsCenterView .reporting-card-header,
#peoplePerformanceCenterView .reporting-card-header,
#estimatesDashboardView .reporting-card-header,
#executiveArchiveView .reporting-card-header,
#reportingHomeView .reporting-card-header {
  gap: 12px;
  margin-bottom: 12px;
}

#voiceIntelligenceCenterView .reporting-filter-bar,
#fleetOperationsCenterView .reporting-filter-bar,
#peoplePerformanceCenterView .reporting-filter-bar,
#estimatesDashboardView .reporting-filter-bar,
#executiveArchiveView .reporting-filter-bar,
#reportingHomeView .reporting-filter-bar {
  gap: 10px;
  margin-bottom: 12px;
}

#voiceIntelligenceCenterView .reporting-stat-grid--cards,
#fleetOperationsCenterView .reporting-stat-grid--cards,
#peoplePerformanceCenterView .reporting-stat-grid--cards,
#estimatesDashboardView .reporting-stat-grid--cards,
#executiveArchiveView .reporting-stat-grid--cards,
#reportingHomeView .reporting-stat-grid--cards {
  margin-bottom: 12px;
}

#voiceIntelligenceCenterView .reporting-stat-card,
#fleetOperationsCenterView .reporting-stat-card,
#peoplePerformanceCenterView .reporting-stat-card,
#estimatesDashboardView .reporting-stat-card,
#executiveArchiveView .reporting-stat-card,
#reportingHomeView .reporting-stat-card,
#aiCallsCenterView .reporting-stat-card {
  min-height: 0;
  padding: 14px 16px 12px;
}

#voiceIntelligenceCenterView .reporting-stat-card-value,
#fleetOperationsCenterView .reporting-stat-card-value,
#peoplePerformanceCenterView .reporting-stat-card-value,
#estimatesDashboardView .reporting-stat-card-value,
#executiveArchiveView .reporting-stat-card-value,
#reportingHomeView .reporting-stat-card-value,
#aiCallsCenterView .reporting-stat-card-value {
  font-size: clamp(1.32rem, 1.65vw, 1.85rem);
  margin-top: 6px;
}

#voiceIntelligenceCenterView .reporting-stat-card-subvalue,
#fleetOperationsCenterView .reporting-stat-card-subvalue,
#peoplePerformanceCenterView .reporting-stat-card-subvalue,
#estimatesDashboardView .reporting-stat-card-subvalue,
#executiveArchiveView .reporting-stat-card-subvalue,
#reportingHomeView .reporting-stat-card-subvalue,
#aiCallsCenterView .reporting-stat-card-subvalue {
  margin-top: 6px;
  line-height: 1.32;
}

#voiceIntelligenceCenterView .reporting-content-grid,
#fleetOperationsCenterView .reporting-content-grid,
#peoplePerformanceCenterView .reporting-content-grid,
#estimatesDashboardView .reporting-content-grid,
#executiveArchiveView .reporting-content-grid,
#reportingHomeView .reporting-content-grid {
  gap: var(--reporting-density-grid-gap);
  margin-bottom: 16px;
}

#voiceIntelligenceCenterView .reporting-insight-hero,
#fleetOperationsCenterView .reporting-insight-hero,
#peoplePerformanceCenterView .reporting-insight-hero,
#estimatesDashboardView .reporting-insight-hero,
#executiveArchiveView .reporting-insight-hero,
#reportingHomeView .reporting-insight-hero {
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 16px;
}

#voiceIntelligenceCenterView .reporting-insight-hero__title,
#fleetOperationsCenterView .reporting-insight-hero__title,
#peoplePerformanceCenterView .reporting-insight-hero__title,
#estimatesDashboardView .reporting-insight-hero__title,
#executiveArchiveView .reporting-insight-hero__title,
#reportingHomeView .reporting-insight-hero__title {
  margin: 8px 0 5px;
  font-size: clamp(1.08rem, 1.45vw, 1.55rem);
}

#voiceIntelligenceCenterView .reporting-insight-hero__summary,
#fleetOperationsCenterView .reporting-insight-hero__summary,
#peoplePerformanceCenterView .reporting-insight-hero__summary,
#estimatesDashboardView .reporting-insight-hero__summary,
#executiveArchiveView .reporting-insight-hero__summary,
#reportingHomeView .reporting-insight-hero__summary {
  font-size: 0.9rem;
  line-height: 1.42;
}

#voiceIntelligenceCenterView .reporting-insight-hero__facts,
#fleetOperationsCenterView .reporting-insight-hero__facts,
#peoplePerformanceCenterView .reporting-insight-hero__facts,
#estimatesDashboardView .reporting-insight-hero__facts,
#executiveArchiveView .reporting-insight-hero__facts,
#reportingHomeView .reporting-insight-hero__facts {
  gap: 8px;
  margin-top: 10px;
}

#voiceIntelligenceCenterView .reporting-insight-hero__facts div,
#voiceIntelligenceCenterView .reporting-insight-hero__meta-item,
#fleetOperationsCenterView .reporting-insight-hero__facts div,
#fleetOperationsCenterView .reporting-insight-hero__meta-item,
#peoplePerformanceCenterView .reporting-insight-hero__facts div,
#peoplePerformanceCenterView .reporting-insight-hero__meta-item,
#estimatesDashboardView .reporting-insight-hero__facts div,
#estimatesDashboardView .reporting-insight-hero__meta-item,
#executiveArchiveView .reporting-insight-hero__facts div,
#executiveArchiveView .reporting-insight-hero__meta-item,
#reportingHomeView .reporting-insight-hero__facts div,
#reportingHomeView .reporting-insight-hero__meta-item {
  padding: 9px 10px;
}

#voiceIntelligenceCenterView .reporting-priority-item,
#fleetOperationsCenterView .reporting-priority-item,
#peoplePerformanceCenterView .reporting-priority-item,
#estimatesDashboardView .reporting-priority-item,
#executiveArchiveView .reporting-priority-item,
#reportingHomeView .reporting-priority-item {
  gap: 10px;
  padding: 10px 12px;
}

.reporting-glance-tape {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.82)),
    radial-gradient(circle at 8% 0%, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), transparent 30%);
}

.reporting-glance-cell {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.reporting-glance-cell span,
.reporting-glance-cell em {
  display: block;
}

.reporting-glance-cell span {
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reporting-glance-cell strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reporting-glance-cell em {
  margin-top: 5px;
  color: #64748b;
  font-size: 0.74rem;
  font-style: normal;
  line-height: 1.22;
}

.reporting-glance-cell--risk {
  border-left: 4px solid #ea580c;
}

.reporting-glance-cell--action {
  border-left: 4px solid var(--reporting-accent, #16a34a);
}

.reporting-drilldown {
  margin: 12px 0;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    radial-gradient(circle at top right, var(--reporting-accent-light, rgba(22, 163, 74, 0.1)), transparent 34%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.reporting-drilldown[open] {
  padding-bottom: 10px;
}

.reporting-drilldown > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
}

.reporting-drilldown > summary::-webkit-details-marker {
  display: none;
}

.reporting-drilldown > summary strong {
  display: block;
  font-size: 0.92rem;
}

.reporting-drilldown > summary span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.reporting-drilldown > summary::after {
  content: "Open";
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--reporting-accent-light, rgba(22, 163, 74, 0.1));
  color: var(--reporting-accent, #16a34a);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reporting-drilldown[open] > summary::after {
  content: "Close";
}

.reporting-drilldown__body {
  padding: 0 14px 4px;
}

.reporting-drilldown__body > .reporting-card,
.reporting-drilldown__body > .reporting-content-grid,
.reporting-drilldown__body > .reporting-data-trust-strip {
  margin-bottom: 12px;
}

.fleet-center-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fleet-center-shell__controls,
.fleet-center-shell__status,
.fleet-center-callout,
.fleet-center-callout__actions,
.fleet-center-tab-bar,
.fleet-center-placeholder__actions,
.fleet-overview-actions,
.fleet-overview-bullets,
.fleet-center-embedded-view,
.fleet-center-placeholder__body {
  display: flex;
  gap: 12px;
}

.fleet-center-shell__controls,
.fleet-center-callout,
.fleet-center-placeholder__body,
.fleet-center-embedded-view {
  flex-direction: column;
}

.fleet-center-shell__controls {
  display: grid;
  grid-template-columns: minmax(260px, max-content) minmax(150px, 180px) minmax(260px, 1fr);
  align-items: end;
  gap: 12px;
}

.fleet-center-shell__control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
}

.fleet-center-shell__status {
  flex-wrap: wrap;
  align-items: center;
  align-self: center;
  justify-content: flex-end;
}

.fleet-center-callout {
  padding: 12px 14px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.fleet-center-callout__title,
.fleet-overview-highlight__value {
  color: #0f172a;
  font-weight: 700;
}

.fleet-center-callout__copy,
.fleet-overview-highlight__copy,
.fleet-overview-bullet span,
.fleet-center-placeholder__body p {
  color: #475569;
}

.fleet-center-tab-bar {
  flex-wrap: wrap;
  gap: 8px;
}

.fleet-center-tab {
  min-height: 38px;
  padding: 9px 13px;
}

.fleet-center-tab.is-active {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.fleet-center-overview-grid {
  margin-bottom: 12px;
}

.fleet-overview-command-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.fleet-overview-command-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-left: 4px solid var(--reporting-accent, #16a34a);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    radial-gradient(circle at 90% 0%, rgba(22, 163, 74, 0.12), transparent 38%);
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.fleet-overview-command-card.is-watch {
  border-left-color: #ea580c;
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 90% 0%, rgba(234, 88, 12, 0.16), transparent 38%);
}

.fleet-overview-command-card.is-risk {
  border-left-color: #dc2626;
  background:
    linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 90% 0%, rgba(220, 38, 38, 0.16), transparent 38%);
}

.fleet-overview-command-card span,
.fleet-overview-command-card strong,
.fleet-overview-command-card em {
  display: block;
}

.fleet-overview-command-card span {
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fleet-overview-command-card strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: clamp(1rem, 1.35vw, 1.36rem);
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-overview-command-card em {
  margin-top: 6px;
  color: #64748b;
  font-size: 0.74rem;
  font-style: normal;
  line-height: 1.22;
}

.fleet-overview-command-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

.fleet-overview-highlight {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.fleet-overview-highlight__value {
  font-size: clamp(1.26rem, 1.4vw, 1.55rem);
}

.fleet-overview-highlight__copy,
.fleet-overview-bullet span,
.fleet-center-placeholder__body p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.fleet-overview-highlight__aside {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.fleet-overview-highlight__aside.is-alert {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.fleet-overview-bullets {
  flex-direction: column;
}

.fleet-overview-bullet {
  display: grid;
  gap: 4px;
}

.fleet-center-embedded-view .reporting-card {
  padding: 16px;
}

.fleet-center-embedded-view .reporting-table-wrap {
  max-height: 440px;
  overflow: auto;
}

.fleet-center-embedded-view .reporting-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.fleet-center-embedded-view .reporting-trend-row {
  grid-template-columns: minmax(80px, 104px) minmax(120px, 1fr) auto;
  gap: 10px;
  margin-bottom: 9px;
}

.fleet-center-embedded-view .reporting-list-row {
  padding: 8px 0;
}

.fleet-center-embedded-view .reporting-section-header {
  margin-bottom: 10px;
}

.voice-center-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voice-center-shell__controls {
  display: grid;
  grid-template-columns: minmax(260px, max-content) minmax(150px, 180px) minmax(260px, 1fr);
  align-items: end;
  gap: 12px;
}

.voice-center-shell__control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
}

.voice-center-shell__status,
.voice-center-callout,
.voice-center-callout__actions,
.voice-center-tab-bar {
  display: flex;
  gap: 12px;
}

.voice-center-shell__status {
  flex-wrap: wrap;
  align-self: center;
  justify-content: flex-end;
}

.voice-center-callout {
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.voice-center-callout__title {
  color: #0f172a;
  font-weight: 800;
}

.voice-center-callout__copy {
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.voice-center-callout__actions,
.voice-center-tab-bar {
  flex-wrap: wrap;
  gap: 8px;
}

.voice-center-tab {
  min-height: 38px;
  padding: 9px 13px;
}

.voice-center-tab.is-active {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.fleet-center-embedded-view > .page-header,
.people-center-embedded-view > .page-header {
  display: none;
}

.fleet-center-embedded-view > [id$="Content"],
.people-center-embedded-view > [id$="Content"] {
  width: 100%;
}

.people-center-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.people-center-shell__controls {
  display: grid;
  grid-template-columns: minmax(260px, max-content) minmax(260px, 1fr);
  align-items: end;
  gap: 12px;
}

.people-center-shell__control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
}

.people-center-shell__status {
  flex-wrap: wrap;
  align-items: center;
  align-self: center;
  justify-content: flex-end;
}

.people-center-tab.is-active {
  box-shadow: 0 10px 22px rgba(14, 116, 144, 0.16);
}

.people-center-placeholder__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── AI Calls Center ── */

#aiCallsCenterView .reporting-stat-card,
#aiCallsCenterView .reporting-stat-card-value,
#aiCallsCenterView .reporting-stat-card-subvalue {
  --reporting-accent: #8b5cf6;
}

#aiCallsCenterView .reporting-stat-card {
  border-left-color: var(--reporting-accent);
}

.ai-calls-center-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.ai-calls-center-tab {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-card, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-calls-center-tab:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.3);
}

.ai-calls-center-tab.is-active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(139, 92, 246, 0.16);
}

.ai-calls-company-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-card, #f1f5f9);
  border-radius: 8px;
  padding: 3px;
}

.ai-calls-company-tab {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-calls-company-tab.is-active {
  background: var(--accent, #16a34a);
  color: #fff;
}

.ai-calls-range-bar,
.ai-calls-outcome-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.ai-calls-range-tab,
.ai-calls-outcome-tab {
  padding: 5px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-calls-range-tab.is-active,
.ai-calls-outcome-tab.is-active {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: #7c3aed;
}

.ai-calls-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.ai-calls-chart-card {
  padding: 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: var(--surface-card, #fff);
}

.ai-calls-chart-card h4 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.ai-calls-triage-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  min-height: 500px;
}

.ai-calls-list-panel {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: var(--surface-card, #fff);
  overflow-y: auto;
  max-height: 600px;
}

.ai-calls-detail-panel {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: var(--surface-card, #fff);
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
}

.ai-calls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  cursor: pointer;
  transition: background 0.15s;
}

.ai-calls-row:hover {
  background: rgba(139, 92, 246, 0.04);
}

.ai-calls-row.is-selected {
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid #8b5cf6;
}

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

.ai-calls-outcome-resolved { background: #4ade80; }
.ai-calls-outcome-escalated { background: #eab308; }
.ai-calls-outcome-message_taken { background: #3b82f6; }
.ai-calls-outcome-abandoned { background: #ef4444; }
.ai-calls-outcome-in_progress { background: #a1a1aa; }

.ai-calls-row-main { flex: 1; min-width: 0; }
.ai-calls-row-name { font-weight: 600; font-size: 0.875rem; color: var(--text-primary, #0f172a); }
.ai-calls-row-meta { font-size: 0.75rem; color: var(--text-muted, #64748b); margin-top: 2px; }
.ai-calls-row-time { font-size: 0.75rem; color: var(--text-muted, #64748b); white-space: nowrap; }

.ai-calls-outcome-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #64748b);
}

.ai-calls-outcome-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ai-calls-outcome-badge.ai-calls-outcome-resolved { background: rgba(74, 222, 128, 0.15); color: #16a34a; }
.ai-calls-outcome-badge.ai-calls-outcome-escalated { background: rgba(234, 179, 8, 0.15); color: #a16207; }
.ai-calls-outcome-badge.ai-calls-outcome-message_taken { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.ai-calls-outcome-badge.ai-calls-outcome-abandoned { background: rgba(239, 68, 68, 0.15); color: #dc2626; }

.ai-calls-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ai-calls-detail-header h3 { margin: 0; font-size: 1.1rem; }

.ai-calls-detail-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.ai-calls-detail-summary {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.04);
  margin-bottom: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ai-calls-detail-escalation {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.08);
  border-left: 3px solid #eab308;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #a16207;
}

.ai-calls-detail-actions { margin-bottom: 12px; }

.ai-calls-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 4px 0 0;
  font-size: 0.8rem;
}

.ai-calls-transcript-collapse {
  margin-top: 12px;
}

.ai-calls-transcript-collapse summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary, #0f172a);
  padding: 8px 0;
}

.ai-calls-transcript {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 0;
}

.ai-calls-turn {
  padding: 6px 10px;
  margin: 4px 0;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.ai-calls-turn-agent { background: rgba(139, 92, 246, 0.06); }
.ai-calls-turn-caller { background: rgba(74, 222, 128, 0.06); }

.ai-calls-turn-speaker {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-right: 6px;
}

.ai-calls-detail-sa5 {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.ai-calls-transcript-browser {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.ai-calls-transcript-card {
  padding: 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: var(--surface-card, #fff);
}

.ai-calls-transcript-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-calls-transcript-card p {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 10px;
  line-height: 1.4;
}

.ai-calls-onboarding-bar {
  height: 8px;
  background: var(--border, #e2e8f0);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.ai-calls-onboarding-fill {
  height: 100%;
  background: var(--success, #4ade80);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.ai-calls-onboarding-label {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 10px;
}
.ai-calls-onboarding-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-calls-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.ai-calls-check-icon {
  width: 18px;
  text-align: center;
  color: var(--success, #4ade80);
  font-weight: bold;
}
.ai-calls-check-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-left: auto;
}

.ai-calls-settings-section input[type="tel"] {
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-card, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 0.85rem;
}

.ai-calls-settings-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.ai-calls-settings-section h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.ai-calls-settings-section label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
  margin: 10px 0 4px;
}

.ai-calls-settings-section textarea,
.ai-calls-settings-section select,
.ai-calls-settings-section input[type="number"],
.ai-calls-settings-section input[type="time"] {
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-card, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 0.85rem;
}

.ai-calls-hours-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-calls-hours-row span { color: var(--text-muted, #64748b); font-size: 0.8rem; }

.ai-calls-flag-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  cursor: pointer;
}

.ai-calls-flag-toggle span { font-size: 0.85rem; text-transform: capitalize; }

.ai-calls-usage-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.ai-calls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ai-calls-table th,
.ai-calls-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.ai-calls-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  font-weight: 700;
}

.ai-calls-loading,
.ai-calls-empty,
.ai-calls-error {
  padding: 24px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
}

.ai-calls-error { color: #dc2626; }

.ai-calls-top-callers-section {
  margin-top: 16px;
}

.ai-calls-top-callers-section h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

@media (max-width: 720px) {
  .ai-calls-triage-layout {
    grid-template-columns: 1fr;
  }
  .ai-calls-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .reporting-insight-hero,
  .reporting-priority-item {
    grid-template-columns: 1fr;
  }

  .reporting-insight-hero {
    gap: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border-left-width: 4px;
    border-radius: 14px;
  }

  .reporting-insight-hero--compact {
    gap: 6px;
    padding: 6px 7px;
  }

  .reporting-insight-hero__title {
    margin: 8px 0 6px;
    font-size: 1.18rem;
    line-height: 1.16;
  }

  .reporting-insight-hero--compact .reporting-insight-hero__title {
    margin: 4px 0 3px;
    font-size: 0.98rem;
    line-height: 1.12;
  }

  .reporting-insight-hero__summary {
    font-size: 0.88rem;
    line-height: 1.42;
  }

  .reporting-insight-hero--compact .reporting-insight-hero__summary {
    font-size: 0.76rem;
    line-height: 1.2;
  }

  .reporting-insight-hero__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
  }

  .reporting-insight-hero--compact .reporting-insight-hero__facts {
    gap: 5px;
    margin-top: 7px;
  }

  .reporting-insight-hero__facts div,
  .reporting-insight-hero__meta-item {
    padding: 8px;
    border-radius: 10px;
  }

  .reporting-insight-hero--compact .reporting-insight-hero__facts div,
  .reporting-insight-hero--compact .reporting-insight-hero__meta-item {
    padding: 6px;
  }

  .reporting-insight-hero__facts strong,
  .reporting-insight-hero__meta-item span {
    font-size: 0.62rem;
  }

  .reporting-insight-hero__facts span,
  .reporting-insight-hero__meta-item strong {
    margin-top: 3px;
    font-size: 0.78rem;
    line-height: 1.28;
  }

  .reporting-insight-hero--compact .reporting-insight-hero__facts span,
  .reporting-insight-hero--compact .reporting-insight-hero__meta-item strong {
    font-size: 0.74rem;
    line-height: 1.18;
  }

  .reporting-insight-hero__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .reporting-insight-hero--compact .reporting-insight-hero__meta {
    gap: 5px;
  }

  .reporting-insight-hero__eyebrow,
  .reporting-insight-hero__actions {
    gap: 6px;
  }

  .reporting-insight-hero__actions .btn {
    flex: 1 1 145px;
    justify-content: center;
  }

  #reportingHomeView .reporting-insight-hero,
  #fleetOperationsCenterView .reporting-insight-hero,
  #peoplePerformanceCenterView .reporting-insight-hero,
  #executiveArchiveView .reporting-insight-hero {
    gap: 5px;
    padding: 7px 8px;
  }

  #reportingHomeView .reporting-insight-hero__title,
  #fleetOperationsCenterView .reporting-insight-hero__title,
  #peoplePerformanceCenterView .reporting-insight-hero__title,
  #executiveArchiveView .reporting-insight-hero__title {
    margin: 4px 0 3px;
    font-size: 0.96rem;
    line-height: 1.1;
  }

  #reportingHomeView .reporting-insight-hero__summary,
  #fleetOperationsCenterView .reporting-insight-hero__summary,
  #peoplePerformanceCenterView .reporting-insight-hero__summary,
  #executiveArchiveView .reporting-insight-hero__summary {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.74rem;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  #reportingHomeView .reporting-insight-hero__facts,
  #reportingHomeView .reporting-insight-hero__meta,
  #fleetOperationsCenterView .reporting-insight-hero__facts,
  #fleetOperationsCenterView .reporting-insight-hero__meta,
  #peoplePerformanceCenterView .reporting-insight-hero__facts,
  #peoplePerformanceCenterView .reporting-insight-hero__meta,
  #executiveArchiveView .reporting-insight-hero__facts,
  #executiveArchiveView .reporting-insight-hero__meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 5px;
  }

  #reportingHomeView .reporting-insight-hero__facts div,
  #reportingHomeView .reporting-insight-hero__meta-item,
  #fleetOperationsCenterView .reporting-insight-hero__facts div,
  #fleetOperationsCenterView .reporting-insight-hero__meta-item,
  #peoplePerformanceCenterView .reporting-insight-hero__facts div,
  #peoplePerformanceCenterView .reporting-insight-hero__meta-item,
  #executiveArchiveView .reporting-insight-hero__facts div,
  #executiveArchiveView .reporting-insight-hero__meta-item {
    padding: 5px;
    border-radius: 8px;
  }

  #reportingHomeView .reporting-insight-hero__facts span,
  #reportingHomeView .reporting-insight-hero__meta-item strong,
  #fleetOperationsCenterView .reporting-insight-hero__facts span,
  #fleetOperationsCenterView .reporting-insight-hero__meta-item strong,
  #peoplePerformanceCenterView .reporting-insight-hero__facts span,
  #peoplePerformanceCenterView .reporting-insight-hero__meta-item strong,
  #executiveArchiveView .reporting-insight-hero__facts span,
  #executiveArchiveView .reporting-insight-hero__meta-item strong {
    font-size: 0.68rem;
    line-height: 1.12;
  }

  #reportingHomeView .reporting-insight-hero__actions,
  #fleetOperationsCenterView .reporting-insight-hero__actions,
  #peoplePerformanceCenterView .reporting-insight-hero__actions,
  #executiveArchiveView .reporting-insight-hero__actions {
    gap: 4px;
  }

  #reportingHomeView .reporting-insight-hero__actions .btn,
  #fleetOperationsCenterView .reporting-insight-hero__actions .btn,
  #peoplePerformanceCenterView .reporting-insight-hero__actions .btn,
  #executiveArchiveView .reporting-insight-hero__actions .btn {
    flex: 1 1 120px;
    min-height: 30px;
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .reporting-priority-item .btn {
    width: 100%;
  }

  .reporting-priority-item {
    gap: 9px;
    padding: 11px;
    border-radius: 12px;
  }

  .reporting-priority-item__body p {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .reporting-data-trust-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
    margin: 10px 0 14px;
  }

  .reporting-data-trust-strip__item {
    min-width: 0;
    padding: 7px;
  }

  .reporting-data-trust-strip__item span {
    font-size: 0.6rem;
  }

  .reporting-data-trust-strip__item strong {
    font-size: 0.76rem;
    line-height: 1.24;
  }

  .reporting-question-router,
  .reporting-center-status-grid,
  .reporting-manager-flow {
    grid-template-columns: 1fr;
  }

  .reporting-question-card,
  .reporting-center-status-card {
    min-height: 0;
    padding: 12px;
    border-radius: 13px;
  }

  .reporting-question-card__action {
    grid-column: 1 / -1;
  }

  .reporting-center-status-card__signal,
  .reporting-center-status-card__evidence {
    padding: 8px 9px;
  }

  .reporting-manager-flow__step {
    padding: 11px;
  }

  .reporting-glance-tape {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
  }

  .fleet-overview-command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .fleet-overview-command-card {
    padding: 9px;
    border-radius: 12px;
  }

  .fleet-overview-command-card span {
    font-size: 0.6rem;
  }

  .fleet-overview-command-card strong {
    font-size: 0.92rem;
  }

  .fleet-overview-command-card em {
    font-size: 0.66rem;
    line-height: 1.18;
  }

  .reporting-glance-cell {
    padding: 8px;
  }

  .reporting-glance-cell strong {
    font-size: 0.86rem;
  }

  .reporting-glance-cell em {
    font-size: 0.68rem;
  }

  .reporting-drilldown > summary {
    align-items: flex-start;
    padding: 11px 12px;
  }

  .reporting-drilldown > summary strong {
    font-size: 0.84rem;
  }

  .reporting-drilldown > summary span {
    font-size: 0.7rem;
    line-height: 1.22;
  }

  .reporting-drilldown > summary::after {
    padding: 4px 8px;
    font-size: 0.62rem;
  }

  .reporting-drilldown__body {
    padding: 0 8px 2px;
  }

  .fleet-center-shell__controls,
  .voice-center-shell__controls,
  .people-center-shell__controls,
  .fleet-overview-highlight {
    display: flex;
    flex-direction: column;
  }

  .fleet-center-shell__status,
  .voice-center-shell__status,
  .people-center-shell__status {
    align-self: stretch;
    justify-content: flex-start;
  }

  .fleet-center-tab-bar,
  .voice-center-tab-bar,
  .people-center-tab-bar {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .fleet-center-tab-bar > *,
  .voice-center-tab-bar > *,
  .people-center-tab-bar > * {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .fleet-center-embedded-view .reporting-table-wrap {
    max-height: 360px;
  }

  .people-center-coaching-panel .reporting-content-grid .reporting-card .reporting-card-body,
  .people-center-overview-panel .reporting-content-grid .reporting-card .reporting-card-body,
  .people-center-efficiency-panel .reporting-content-grid .reporting-card .reporting-card-body,
  .fleet-center-overview-panel .reporting-content-grid .reporting-card .reporting-card-body {
    max-height: 520px;
    overflow: auto;
  }

  #reportingHomeView .reporting-card,
  #voiceIntelligenceCenterView .reporting-card,
  #fleetOperationsCenterView .reporting-card,
  #peoplePerformanceCenterView .reporting-card,
  .people-center-coaching-panel .reporting-content-grid .reporting-card,
  .people-center-efficiency-panel .reporting-content-grid .reporting-card,
  .people-center-overview-panel .reporting-content-grid .reporting-card,
  .fleet-center-overview-panel .reporting-content-grid .reporting-card {
    max-height: 600px;
    overflow: auto;
  }
}

.people-center-coaching-panel .reporting-content-grid .reporting-card,
.people-center-efficiency-panel .reporting-content-grid .reporting-card,
.fleet-center-overview-panel .reporting-content-grid .reporting-card,
#voiceIntelligenceCenterView .reporting-card {
  max-height: 600px;
  overflow: auto;
}

.reporting-skeleton {
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.7), rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.7));
  background-size: 200% 100%;
  animation: reporting-skeleton-shimmer 1.2s linear infinite;
}

.reporting-skeleton--title {
  height: 18px;
  width: 32%;
}

.reporting-skeleton--line {
  height: 12px;
  width: 88%;
  margin-top: 14px;
}

.reporting-skeleton--short {
  width: 54%;
}

.reporting-skeleton--chips {
  height: 36px;
  width: 100%;
  margin-top: 18px;
  border-radius: 12px;
}

@keyframes reporting-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.reporting-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(var(--border-rgb, 15 23 42), 0.08);
}

.reporting-list-row:last-child,
.reporting-list-row--last {
  border-bottom: none;
}

.reporting-list-row__label {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.reporting-list-row__value {
  font-weight: 600;
  color: var(--text-primary);
}

.reporting-list-title {
  font-weight: 700;
  color: #111827;
}

.reporting-list-copy {
  font-size: 13px;
  color: #6b7280;
}

.reporting-alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--reporting-alert-bg, #f3f4f6);
  color: var(--reporting-alert-color, #374151);
}

.reporting-alert-value {
  font-weight: 800;
}

.fb-hero-row {
  margin-bottom: 20px;
}

.fb-chart-card.reporting-card,
.fb-breakdown-card.reporting-card,
.fb-leaderboard-card.reporting-card,
.fb-insight-card.reporting-card,
.voc-queue-toolbar.reporting-card {
  padding: 20px 24px;
}

.fb-charts-row,
.fb-breakdown-row,
.fb-leaderboard-row {
  gap: 16px;
}

.fb-chart-wrap {
  position: relative;
  height: 250px;
}

.fb-breakdown-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fb-breakdown-item + .fb-breakdown-item {
  margin-top: 14px;
}

.fb-breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.fb-breakdown-name {
  font-weight: 600;
  font-size: 13px;
}

.fb-breakdown-ratio {
  font-size: 12px;
  color: #6b7280;
}

.fb-breakdown-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
  background: #e5e7eb;
}

.fb-breakdown-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.fb-breakdown-stat--green { color: #15803d; }
.fb-breakdown-stat--red { color: #dc2626; }

.fb-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.fb-table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.fb-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fb-data-table thead {
  background: #f8fafc;
}

.fb-data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.fb-data-table td {
  padding: 10px 12px;
  border-top: none;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.fb-table-row:last-child td {
  border-bottom: none;
}

.fb-table-row:hover {
  background: #f9fafb;
}

.fb-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.fb-type-badge.compliment { background: #dcfce7; color: #166534; }
.fb-type-badge.concern { background: #ffedd5; color: #c2410c; }
.fb-type-badge.complaint { background: #fee2e2; color: #b91c1c; }
.fb-type-badge.neutral { background: #ffedd5; color: #c2410c; }

.fb-mobile-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.fb-mobile-card.compliment { border-left: 4px solid #16a34a; }
.fb-mobile-card.concern,
.fb-mobile-card.neutral { border-left: 4px solid #f59e0b; }
.fb-mobile-card.complaint { border-left: 4px solid #ef4444; }

.fb-detail-type-badge.concern,
.fb-detail-type-badge.neutral {
  background: #ffedd5;
  color: #c2410c;
}

#opsReportingView .or-summary-card,
#opsReportingView .or-chart-card,
#opsReportingView .or-section-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

#opsReportingView .or-summary-card {
  border-radius: 16px;
}

#opsReportingView .or-chart-card,
#opsReportingView .or-section-card {
  border-radius: 16px;
}

#opsReportingView .or-leaderboard-table th {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

#opsReportingView .or-leaderboard-table td {
  border-bottom: 1px solid #f3f4f6;
}

.voc-queue-shell {
  gap: 16px;
}

.voc-queue-toolbar.reporting-card {
  margin-bottom: 0;
  background:
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.07), transparent 32%),
    linear-gradient(180deg, var(--bg-card, #fff), var(--bg-card-alt, #f8fafc));
}

.voc-summary-row {
  margin-bottom: 4px;
}

.voc-summary-card.reporting-stat,
.voc-summary-card.reporting-stat-card {
  margin-bottom: 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.voc-queue-card {
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

@media (max-width: 900px) {
  .fb-breakdown-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .reporting-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .reporting-trend-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fb-charts-row,
  .fb-breakdown-row,
  .fb-leaderboard-row,
  .fb-insights-grid {
    grid-template-columns: 1fr;
  }

  .fb-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .fb-search-input {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .reporting-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reporting-stat-grid--3col {
    grid-template-columns: 1fr;
  }

  .reporting-card,
  .fb-chart-card.reporting-card,
  .fb-breakdown-card.reporting-card,
  .fb-leaderboard-card.reporting-card,
  .fb-insight-card.reporting-card,
  .voc-queue-toolbar.reporting-card {
    padding: 16px;
  }

  .reporting-table {
    min-width: 460px;
  }

  .hours-recon-payroll-layout {
    grid-template-columns: 1fr;
  }

  .hours-recon-side-column {
    position: static;
  }

  .hours-recon-hero-note {
    max-width: none;
    width: 100%;
  }
}

/* ==================== TRIAGE CARDS (Voice Feedback Queue) ==================== */
.triage-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: start;
}

.triage-list-panel,
.triage-detail-panel {
  min-width: 0;
}

.triage-detail-panel {
  position: sticky;
  top: 20px;
  padding: 0;
  overflow: hidden;
}

.triage-stat-card {
  position: relative;
  overflow: hidden;
}

.triage-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--reporting-accent, var(--accent-green, #16a34a));
}

.triage-stat-card--critical { --reporting-accent: var(--accent-red, #dc2626); }
.triage-stat-card--pending { --reporting-accent: var(--accent-amber, #d97706); }
.triage-stat-card--reviewed { --reporting-accent: var(--accent-green, #16a34a); }

.triage-empty-state {
  text-align: center;
  padding: 32px 20px;
  border: 1px dashed var(--border-subtle, #cbd5e1);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-card, #ffffff) 82%, var(--bg-primary, #f8fafc));
}

.triage-empty-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.triage-empty-meta {
  margin-top: 10px;
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
}

.triage-card {
  background: var(--bg-card, #fff);
  border-radius: 16px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  border-left: 4px solid var(--border-subtle, #cbd5e1);
  position: relative;
}
.triage-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.triage-card.is-selected { border-color: var(--accent-green, #16a34a); box-shadow: 0 6px 20px rgba(22,163,74,0.12); }

/* Severity variants */
.triage-card.triage-severity--critical,
.triage-card.triage-critical { border-left-color: #dc2626; background: rgba(220,38,38,0.03); }
.triage-card.triage-severity--high,
.triage-card.triage-high { border-left-color: #f59e0b; }
.triage-card.triage-severity--medium,
.triage-card.triage-normal { border-left-color: #3b82f6; }
.triage-card.triage-severity--low,
.triage-card.triage-low { border-left-color: var(--border-subtle, #cbd5e1); }
.triage-card--pulse { animation: triage-pulse 2s infinite; }
@keyframes triage-pulse { 0%,100% { box-shadow: 0 2px 8px rgba(220,38,38,0.08); } 50% { box-shadow: 0 4px 16px rgba(220,38,38,0.18); } }

.triage-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.triage-card-priority { display: flex; flex-direction: column; gap: 4px; }
.triage-card-priority-line { display: flex; align-items: center; gap: 6px; }

.triage-severity-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.triage-severity-dot.triage-severity--critical,
.triage-severity-dot.triage-critical { background: #dc2626; box-shadow: 0 0 6px rgba(220,38,38,0.5); }
.triage-severity-dot.triage-severity--high,
.triage-severity-dot.triage-high { background: #f59e0b; }
.triage-severity-dot.triage-severity--medium,
.triage-severity-dot.triage-normal { background: #3b82f6; }
.triage-severity-dot.triage-severity--low,
.triage-severity-dot.triage-low { background: #94a3b8; }
.triage-severity-dot--empty { background: #e2e8f0; }

.triage-priority-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.triage-severity--critical .triage-priority-label,
.triage-critical .triage-priority-label { color: #dc2626; }
.triage-severity--high .triage-priority-label,
.triage-high .triage-priority-label { color: #d97706; }
.triage-severity--medium .triage-priority-label,
.triage-normal .triage-priority-label { color: #2563eb; }

.triage-card-status {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: rgba(100,116,139,0.1); color: var(--text-muted, #64748b);
}

.triage-card-company {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; display: inline-block;
}

.triage-card-summary {
  font-size: 0.9rem; font-weight: 500; color: var(--text-primary, #1e293b);
  margin-bottom: 8px; line-height: 1.4;
}

.triage-quote-block {
  background: var(--bg-page, #f8fafc); border-left: 3px solid var(--accent-green, #16a34a);
  padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 8px 0;
  font-style: italic; font-size: 0.85rem; color: var(--text-secondary, #475569);
  line-height: 1.5;
}
.triage-quote-title {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted, #64748b); margin-bottom: 4px; font-style: normal;
}

.triage-context-line {
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.8rem;
  color: var(--text-muted, #64748b); margin: 8px 0;
}

.triage-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin: 8px 0 12px;
}
.triage-age { font-size: 0.78rem; color: var(--text-muted, #64748b); display: flex; align-items: center; gap: 6px; }
.triage-age.triage-age--recent,
.triage-age.triage-age--fresh { color: var(--text-muted); }
.triage-age.triage-age--aging { color: #d97706; }
.triage-age.triage-age--overdue { color: #dc2626; font-weight: 600; }
.triage-overdue-badge {
  font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: rgba(220,38,38,0.1); color: #dc2626; text-transform: uppercase;
}
.triage-card-confidence { font-size: 0.72rem; color: var(--text-muted, #94a3b8); }

/* Action buttons */
.triage-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.triage-btn {
  font-size: 0.78rem; font-weight: 600; padding: 6px 14px;
  border-radius: 8px; border: 1.5px solid transparent; cursor: pointer;
  background: transparent; transition: all 0.15s;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.triage-btn-approve { color: #16a34a; border-color: #16a34a; }
.triage-btn-approve:hover { background: rgba(22,163,74,0.08); }
.triage-btn-escalate { color: #d97706; border-color: #d97706; }
.triage-btn-escalate:hover { background: rgba(217,119,6,0.08); }
.triage-btn-dismiss { color: #64748b; border-color: #cbd5e1; font-weight: 500; }
.triage-btn-dismiss:hover { background: rgba(100,116,139,0.06); }

/* Detail panel */
.triage-detail { padding: 20px; }
.triage-detail--placeholder { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.triage-detail-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.triage-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.triage-detail-header h3 {
  margin: 6px 0 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.triage-detail-kicker,
.triage-section-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.triage-detail-badges,
.triage-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.triage-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.triage-detail-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border-subtle, #e2e8f0) 88%, transparent);
  background: color-mix(in srgb, var(--bg-card, #ffffff) 84%, var(--bg-primary, #f8fafc));
}

.triage-editor-shell {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle, #dbe2ea);
  background: var(--bg-card, #ffffff);
  position: relative;
  z-index: 1;
}

.triage-editor-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
}

.triage-editor-input,
.triage-editor-shell textarea,
.triage-editor-shell select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-default, #cbd5e1);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  font: inherit;
}

.triage-editor-shell textarea {
  min-height: 104px;
  resize: vertical;
}

.triage-editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.triage-transcript {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 0.94rem;
  color: var(--text-secondary, #475569);
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-card, #ffffff) 78%, var(--bg-primary, #f8fafc));
  border: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 88%, transparent);
  max-height: 320px;
  overflow: auto;
}

.triage-analysis-list,
.triage-history-list {
  display: grid;
  gap: 10px;
}

.triage-keyword {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 6px 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-blue, #2563eb) 10%, var(--bg-card, #ffffff));
  color: var(--accent-blue, #2563eb);
  font-size: 0.78rem;
  font-weight: 700;
}

.triage-muted {
  color: var(--text-muted, #64748b);
  font-style: italic;
}

.triage-history-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.triage-history-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--accent-green, #16a34a);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-green, #16a34a) 12%, transparent);
}

.triage-history-label {
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.triage-history-meta {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}

.triage-history-note {
  margin-top: 4px;
  color: var(--text-secondary, #475569);
  line-height: 1.55;
}

.triage-audio-player {
  width: 100%;
}

/* Stats bar */
.triage-stats-bar,
.voc-queue-stats {
  font-size: 0.82rem; color: var(--text-muted, #64748b);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 8px 0; margin-bottom: 8px;
}
.voc-queue-stats span { white-space: nowrap; }

/* Dark mode */
[data-theme="dark"] .triage-card,
[data-theme="dark"] .triage-detail-panel,
[data-theme="dark"] .triage-detail-section,
[data-theme="dark"] .triage-editor-shell,
[data-theme="dark"] .triage-empty-state { background: var(--bg-card); border-color: var(--border-subtle); }
[data-theme="dark"] .triage-quote-block,
[data-theme="dark"] .triage-transcript { background: rgba(30,41,59,0.5); }
[data-theme="dark"] .triage-card.triage-severity--critical,
[data-theme="dark"] .triage-card.triage-critical { background: rgba(220,38,38,0.06); }
[data-theme="dark"] .triage-btn-approve { color: #4ade80; border-color: #4ade80; }
[data-theme="dark"] .triage-btn-escalate { color: #fbbf24; border-color: #fbbf24; }
[data-theme="dark"] .triage-keyword {
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
}
[data-theme="dark"] .triage-history-dot {
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12);
}

/* Mobile adjustments */
@media (max-width: 1100px) {
  .triage-layout,
  .triage-detail-grid {
    grid-template-columns: 1fr;
  }

  .triage-detail-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .triage-action-row { flex-direction: column; }
  .triage-btn { width: 100%; text-align: center; }
  .triage-card-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
  .triage-context-line { flex-direction: column; gap: 4px; }
  .triage-detail-header,
  .triage-detail-badges,
  .triage-editor-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.reporting-stat-card--green { --reporting-accent: var(--accent-green); }
.reporting-stat-card--red { --reporting-accent: var(--accent-red); }
.reporting-stat-card--blue { --reporting-accent: var(--accent-blue); }
.reporting-stat-card--amber { --reporting-accent: var(--accent-amber); }
.reporting-stat-card--teal { --reporting-accent: var(--accent-cyan); }
.reporting-stat-card--purple { --reporting-accent: var(--accent-purple); }

.reporting-state-message,
.reporting-inline-empty {
  text-align: center;
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.reporting-state-message {
  padding: 40px;
}

.reporting-loading-text {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.reporting-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reporting-breadcrumb-sep {
  opacity: 0.5;
}

.reporting-breadcrumb-item--active {
  color: var(--text-primary);
  font-weight: 500;
}

.reporting-mb-12 {
  margin-bottom: 12px;
}

.reporting-page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 4px 0 0;
}

.td-clickable {
  cursor: pointer;
}

.td-summary-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.td-summary-meta--small {
  font-size: 0.65rem;
}

.or-label-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.ed-breadcrumb-link {
  cursor: pointer;
  color: var(--primary-green, #2d5a3d);
}

.ed-load-more {
  text-align: center;
  padding: 12px;
}

.reporting-state-message--error,
.reporting-modal-message--error,
.reporting-color-red {
  color: var(--accent-red);
}

.reporting-color-green { color: var(--accent-green); }
.reporting-color-blue { color: var(--accent-blue); }
.reporting-color-amber { color: var(--accent-amber); }
.reporting-color-purple { color: var(--accent-purple); }

.reporting-inline-empty--success {
  color: var(--accent-green-dark);
}

.reporting-empty-card {
  text-align: center;
  padding: 60px 40px;
}

.reporting-empty-card-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.reporting-empty-card-title {
  margin: 0 0 8px;
  color: var(--text-primary);
}

.reporting-empty-card-copy {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

.reporting-digest-card {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  border: 1px solid rgba(226, 232, 240, 0.78);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.reporting-digest-card--button {
  width: 100%;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.reporting-digest-card--button:hover {
  border-color: rgba(148, 163, 184, 0.36);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.reporting-digest-card:hover {
  border-color: rgba(148, 163, 184, 0.36);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.reporting-digest-card-body {
  padding: 20px;
}

.reporting-digest-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.reporting-digest-card-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.reporting-digest-card-meta,
.reporting-digest-card-stat,
.reporting-company-tag {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.reporting-company-tag {
  font-size: 0.7rem;
}

.reporting-archive-scope-note {
  margin: -8px 0 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.reporting-digest-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.reporting-digest-card-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-blue);
  font-size: 0.76rem;
  font-weight: 600;
}

.reporting-digest-archive-alert {
  padding: 16px 18px;
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 16px;
  background: rgba(217, 119, 6, 0.08);
  color: var(--text-primary);
}

.reporting-digest-archive-alert__title {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.reporting-digest-archive-alert__copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.reporting-digest-card-summary {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reporting-digest-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.reporting-digest-card-stat-positive {
  color: var(--accent-green-dark);
}

.reporting-digest-card-stat-negative {
  color: var(--accent-red);
}

.reporting-modal-loading {
  text-align: center;
  padding: 40px;
}

.reporting-spinner-centered {
  margin: 0 auto;
}

.reporting-digest-iframe {
  width: 100%;
  border: none;
  min-height: 600px;
}

.reporting-modal-message {
  padding: 24px;
  color: var(--text-muted);
}

.reporting-digest-modal__status {
  margin: 0;
  padding: 0 24px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.reporting-digest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reporting-digest-search-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 14px;
  margin: 14px 0;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
}

.reporting-filter-input {
  width: 100%;
  min-width: min(100%, 320px);
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 0.9rem;
}

.reporting-digest-result-summary {
  margin: -4px 0 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.reporting-digest-results {
  display: grid;
  gap: 12px;
}

.reporting-archive-intelligence-grid {
  margin: 14px 0;
}

.reporting-archive-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 14px;
}

.reporting-archive-timeline-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: rgba(148, 163, 184, 0.34);
}

.reporting-archive-timeline-item--last::before {
  display: none;
}

.reporting-archive-timeline-dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 3px solid #dbeafe;
  border-radius: 999px;
  background: #2563eb;
}

.reporting-archive-timeline-item strong,
.reporting-archive-timeline-item span,
.reporting-archive-timeline-item small {
  display: block;
}

.reporting-archive-timeline-item strong {
  color: #0f172a;
  font-size: 0.9rem;
}

.reporting-archive-timeline-item span {
  margin-top: 3px;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.4;
}

.reporting-archive-timeline-item small {
  margin-top: 5px;
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.35;
}

.reporting-view-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
}

.reporting-view-toggle__btn {
  background: none;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.15s;
}

.reporting-view-toggle__btn.active,
.reporting-view-toggle__btn:hover {
  background: var(--primary-green, #2d5a3d);
  color: white;
  border-color: transparent;
}

.reporting-stat-card--amber .reporting-stat-card-value { color: var(--accent-amber, #d97706); }
.reporting-stat-card--green .reporting-stat-card-value { color: var(--accent-green, #059669); }
.reporting-stat-card--blue .reporting-stat-card-value { color: var(--accent-blue, #2563eb); }

.review-metric-value--green {
  color: var(--accent-green);
}

.review-acknowledge-field {
  margin: 12px 0;
}

.review-acknowledge-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.review-acknowledge-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card, #ffffff);
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
}

.review-acknowledged-banner {
  padding: 12px 16px;
  margin-top: 16px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-green);
  font-weight: 500;
}

/* Digest Preview Modal */
.reporting-digest-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.reporting-digest-modal.hidden { display: none; }

.reporting-digest-modal__inner {
  max-width: 700px;
  margin: 20px auto;
  background: var(--surface, white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.reporting-digest-modal__header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reporting-digest-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.reporting-digest-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  line-height: 1;
}

.reporting-digest-modal__close:hover { color: var(--text-primary); }

.reporting-digest-modal__body { padding: 0; }

.reporting-digest-modal__frame {
  width: 100%;
  border: none;
  min-height: 400px;
}

.truck-load-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 1fr);
  gap: 18px;
  align-items: start;
}

.truck-load-board-column,
.truck-load-detail-column {
  min-width: 0;
}

.truck-load-detail-column {
  position: sticky;
  top: 88px;
}

.truck-load-toolbar-card {
  margin-bottom: 20px;
}

.truck-load-filter-bar {
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 0;
}

.truck-load-filter-bar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.truck-load-refresh-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.truck-load-cockpit-card {
  margin-bottom: 18px;
}

.truck-load-cockpit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.truck-load-hero-grid,
.truck-load-breakdown-grid,
.truck-load-benchmark-list {
  display: grid;
  gap: 12px;
}

.truck-load-hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.truck-load-hero-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.truck-load-breakdown-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}

.truck-load-breakdown-card {
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 14px 16px;
}

.truck-load-breakdown-card > strong,
.truck-load-benchmark-item > strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.truck-load-breakdown-card__label {
  display: block;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.truck-load-benchmark-item {
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  padding-top: 12px;
}

.truck-load-benchmark-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.truck-load-benchmark-item span,
.truck-load-benchmark-item small,
.truck-load-secondary-copy {
  color: var(--text-muted);
}

.truck-load-benchmark-item span {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.truck-load-benchmark-item small {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
}

.truck-load-secondary-copy {
  font-size: 0.84rem;
  line-height: 1.45;
}

.truck-load-company-group + .truck-load-company-group {
  margin-top: 18px;
}

.truck-load-group-header {
  margin-bottom: 10px;
}

.truck-load-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.truck-load-row-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.truck-load-card {
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.97));
  padding: 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.truck-load-row {
  padding: 14px 16px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
  cursor: pointer;
}

.truck-load-row__top,
.truck-load-row__bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.truck-load-row__bottom {
  margin-top: 12px;
}

.truck-load-row__identity {
  min-width: 0;
}

.truck-load-row__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.truck-load-row__subtitle {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.truck-load-row__badges,
.truck-load-row__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.truck-load-row__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.truck-load-row__notes {
  min-width: 0;
}

.truck-load-board-metric {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}

.truck-load-board-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-bottom: 4px;
}

.truck-load-board-metric strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.truck-load-board-metric--amber {
  border-color: rgba(217, 119, 6, 0.22);
}

.truck-load-board-metric--blue {
  border-color: rgba(37, 99, 235, 0.2);
}

.truck-load-card--selected {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.12);
}

.truck-load-row:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.truck-load-card__header,
.truck-load-history-item__top,
.truck-load-modal__intro,
.truck-load-editor-field__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.truck-load-card__header h3 {
  margin: 8px 0 4px;
  font-size: 1.1rem;
}

.truck-load-card__eyebrow,
.truck-load-modal__eyebrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.truck-load-card__subhead,
.truck-load-modal__copy,
.truck-load-card-copy,
.truck-load-history-item__meta,
.truck-load-provenance-card__meta,
.truck-load-editor-field__hint,
.truck-load-editor-rules {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.truck-load-card__actions,
.truck-load-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.truck-load-card-badges,
.truck-load-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.truck-load-freshness-card,
.truck-load-rule-card,
.truck-load-queue-item,
.truck-load-queue-banner {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.truck-load-freshness-card {
  margin-top: 14px;
  padding: 12px 14px;
}

.truck-load-card__section .truck-load-freshness-card {
  margin-top: 0;
}

.truck-load-freshness-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.truck-load-confirmation-note {
  margin-top: 8px;
  color: #166534;
  font-size: 0.84rem;
  line-height: 1.45;
}

.truck-load-freshness-card--green,
.truck-load-queue-banner--green { border-color: rgba(34, 197, 94, 0.24); }
.truck-load-freshness-card--blue,
.truck-load-rule-card--blue { border-color: rgba(37, 99, 235, 0.24); }
.truck-load-freshness-card--amber,
.truck-load-rule-card--amber,
.truck-load-queue-banner--amber { border-color: rgba(217, 119, 6, 0.3); }
.truck-load-freshness-card--slate,
.truck-load-rule-card--slate { border-color: rgba(100, 116, 139, 0.24); }

.truck-load-card__section + .truck-load-card__section {
  margin-top: 16px;
}

.truck-load-card__section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 10px;
}

.truck-load-line-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.truck-load-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.truck-load-line__label,
.truck-load-history-item__title,
.truck-load-empty-state__title,
.truck-load-provenance-card__value {
  font-weight: 700;
  color: var(--text-primary);
}

.truck-load-line__meta,
.truck-load-provenance-card__label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.truck-load-line__value {
  font-weight: 700;
  color: #0f172a;
  text-align: right;
}

.truck-load-metric-grid,
.truck-load-standard-grid,
.truck-load-provenance-grid,
.truck-load-editor-grid {
  display: grid;
  gap: 10px;
}

.truck-load-rule-grid,
.truck-load-queue-list {
  display: grid;
  gap: 12px;
}

.truck-load-rule-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.truck-load-metric-grid,
.truck-load-standard-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 12px;
}

.truck-load-provenance-grid,
.truck-load-editor-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.truck-load-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.truck-load-metric-chip,
.truck-load-standard-tile,
.truck-load-provenance-card {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.truck-load-metric-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.truck-load-metric-chip span,
.truck-load-standard-tile span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.truck-load-metric-chip strong,
.truck-load-standard-tile strong {
  color: var(--text-primary);
  font-size: 1rem;
}

.truck-load-trend-card {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.truck-load-trend-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.truck-load-trend-card__header strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.truck-load-trend-card__header span,
.truck-load-trend-row__label,
.truck-load-trend-point__day {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.truck-load-trend-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.truck-load-trend-row + .truck-load-trend-row {
  margin-top: 10px;
}

.truck-load-trend-strip,
.truck-load-trend-water {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16px, 1fr));
  gap: 6px;
  align-items: end;
}

.truck-load-trend-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.truck-load-trend-point__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.truck-load-trend-point__dot--green { background: #22c55e; }
.truck-load-trend-point__dot--blue { background: #3b82f6; }
.truck-load-trend-point__dot--amber { background: #f59e0b; }
.truck-load-trend-point__dot--slate { background: #94a3b8; }

.truck-load-trend-bar-wrap {
  min-height: 48px;
  display: flex;
  align-items: end;
}

.truck-load-trend-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 999px 999px 4px 4px;
  display: inline-block;
}

.truck-load-trend-bar--blue { background: rgba(37, 99, 235, 0.82); }
.truck-load-trend-bar--amber { background: rgba(217, 119, 6, 0.82); }
.truck-load-trend-bar--slate { background: rgba(148, 163, 184, 0.7); }

.truck-load-metric-chip--green { border-color: rgba(34, 197, 94, 0.28); }
.truck-load-metric-chip--blue { border-color: rgba(37, 99, 235, 0.25); }
.truck-load-metric-chip--amber { border-color: rgba(217, 119, 6, 0.28); }
.truck-load-metric-chip--slate { border-color: rgba(148, 163, 184, 0.34); }

.truck-load-detail-card {
  overflow: hidden;
}

.truck-load-inspector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.truck-load-inspector-tab {
  border: 1px solid rgba(203, 213, 225, 0.95);
  background: #f8fafc;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.truck-load-inspector-tab--active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

.truck-load-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
}

.truck-load-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.truck-load-inspector-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.truck-load-inspector-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

.truck-load-context-banner {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.55), rgba(248, 250, 252, 0.95));
  padding: 14px 16px;
  margin-bottom: 12px;
}

.truck-load-context-banner--quiet {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.95), rgba(248, 250, 252, 0.95));
}

.truck-load-context-banner__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.truck-load-history-item + .truck-load-history-item {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.truck-load-queue-banner,
.truck-load-queue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.truck-load-queue-banner__title,
.truck-load-queue-item__title {
  font-weight: 700;
  color: var(--text-primary);
}

.truck-load-queue-item__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.truck-load-empty-state {
  padding: 28px 18px;
  text-align: center;
}

.truck-load-empty-state__copy,
.truck-load-inline-empty,
.truck-load-modal__state {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.truck-load-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.truck-load-pill--green { background: #dcfce7; color: #166534; }
.truck-load-pill--blue { background: #dbeafe; color: #1d4ed8; }
.truck-load-pill--amber { background: #fef3c7; color: #b45309; }
.truck-load-pill--slate { background: #e2e8f0; color: #475569; }

.truck-load-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.55);
  padding: 24px;
  overflow-y: auto;
}

.truck-load-modal.hidden {
  display: none;
}

.truck-load-modal__panel {
  max-width: 880px;
  margin: 16px auto;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.truck-load-modal__header,
.truck-load-modal__body {
  padding: 22px 24px;
}

.truck-load-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.truck-load-modal__header h3 {
  margin: 8px 0 0;
}

.truck-load-modal__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.truck-load-edit-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.truck-load-editor-field,
.truck-load-editor-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.truck-load-editor-field {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.92);
}

.truck-load-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1120px) {
  .truck-load-layout {
    grid-template-columns: 1fr;
  }

  .truck-load-cockpit-grid {
    grid-template-columns: 1fr;
  }

  .truck-load-detail-column {
    position: static;
  }
}

@media (max-width: 720px) {
  .truck-load-card,
  .truck-load-modal__header,
  .truck-load-modal__body {
    padding: 16px;
  }

  .truck-load-inspector-tabs,
  .truck-load-detail-stack {
    padding-left: 16px;
    padding-right: 16px;
  }

  .truck-load-card__header,
  .truck-load-history-item__top,
  .truck-load-modal__intro,
  .truck-load-editor-field__top,
  .truck-load-row__top,
  .truck-load-row__bottom {
    flex-direction: column;
  }

  .truck-load-card__actions,
  .truck-load-detail-actions,
  .truck-load-modal__footer,
  .truck-load-queue-item__actions,
  .truck-load-row__actions {
    width: 100%;
  }

  .truck-load-card__actions > *,
  .truck-load-detail-actions > *,
  .truck-load-modal__footer > *,
  .truck-load-queue-item__actions > *,
  .truck-load-row__actions > * {
    flex: 1 1 auto;
  }

  .truck-load-queue-banner,
  .truck-load-queue-item {
    flex-direction: column;
  }

  .truck-load-trend-stats,
  .truck-load-row__metrics,
  .truck-load-inspector-summary-grid,
  .truck-load-inspector-split {
    grid-template-columns: 1fr;
  }

  .truck-load-modal {
    padding: 12px;
  }
}

.manager-avatar--1 { background: var(--accent-blue); }
.manager-avatar--2 { background: var(--accent-cyan); }
.manager-avatar--3 { background: var(--accent-emerald); }
.manager-avatar--4 { background: var(--accent-purple); }
.manager-avatar--5 { background: var(--accent-amber); }

.manager-bar-fill--low { background: var(--accent-green); }
.manager-bar-fill--mid { background: var(--accent-amber); }
.manager-bar-fill--high { background: var(--accent-red); }

.voc-page {
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--voc-accent, var(--accent-green)) 12%, transparent), transparent 28%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent-blue, #2563eb) 10%, transparent), transparent 24%),
    linear-gradient(180deg, var(--bg-primary, #f8fafc), color-mix(in srgb, var(--bg-card, #ffffff) 36%, var(--bg-primary, #f8fafc)));
  color: var(--text-primary);
  font-family: Outfit, sans-serif;
}

.voc-shell {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.voc-shell--modal {
  padding-top: 18px;
}

.voc-page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.voc-page-header--compact {
  margin-bottom: 16px;
}

.voc-title-wrap h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.voc-title-wrap p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.voc-controls,
.voc-chip-row,
.voc-flex-between-start {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.voc-flex-between-start {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.voc-select,
.voc-button,
.voc-filter-input {
  border: 1px solid var(--border-default, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  border-radius: 999px;
  padding: 11px 14px;
  font: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.voc-button {
  cursor: pointer;
  font-weight: 600;
}

.voc-button.subtle {
  background: transparent;
  box-shadow: none;
}

.voc-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.voc-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-card, #ffffff) 84%, var(--bg-primary, #f8fafc));
  border: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 90%, transparent);
  margin-bottom: 18px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  box-sizing: border-box;
}
.voc-tabs::-webkit-scrollbar { display: none; }

.voc-tab-button {
  border: 0;
  background: transparent;
  color: var(--text-muted, #64748b);
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.voc-tab-button.active {
  color: var(--text-primary, #0f172a);
  background: var(--bg-card, #ffffff);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.voc-grid {
  display: grid;
  gap: 16px;
}

.voc-grid--tight {
  gap: 12px;
}

.voc-grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.voc-grid.stats .voc-card {
  position: relative;
  overflow: hidden;
}

.voc-grid.stats .voc-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--voc-accent, var(--accent-green, #16a34a));
}

.voc-grid.stats .voc-card:nth-child(1) { --voc-accent: var(--accent-green, #16a34a); }
.voc-grid.stats .voc-card:nth-child(2) { --voc-accent: var(--accent-blue, #2563eb); }
.voc-grid.stats .voc-card:nth-child(3) { --voc-accent: var(--accent-amber, #d97706); }
.voc-grid.stats .voc-card:nth-child(4) { --voc-accent: var(--accent-red, #dc2626); }

.voc-grid.stats .voc-card.severity-good::before { background: var(--accent-green, #16a34a); }
.voc-grid.stats .voc-card.severity-good { border-color: color-mix(in srgb, var(--accent-green, #16a34a) 25%, transparent); }

.voc-grid.stats .voc-card.severity-warn::before { background: var(--accent-amber, #d97706); }
.voc-grid.stats .voc-card.severity-warn { border-color: color-mix(in srgb, var(--accent-amber, #d97706) 25%, transparent); }

.voc-grid.stats .voc-card.severity-critical::before { background: var(--accent-red, #dc2626); }
.voc-grid.stats .voc-card.severity-critical { border-color: color-mix(in srgb, var(--accent-red, #dc2626) 30%, transparent); background: color-mix(in srgb, var(--accent-red, #dc2626) 4%, var(--bg-card, #ffffff)); }

.voc-grid.stats .voc-card.severity-empty::before { background: var(--slate-300, #cbd5e1); }
.voc-grid.stats .voc-card.severity-empty { opacity: 0.6; border-color: var(--border-default, #e2e8f0); }

.voc-empty-positive {
  padding: 16px 20px;
  color: var(--accent-green, #16a34a);
  font-size: 14px;
  line-height: 1.5;
}

.voc-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 20px;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--slate-600, #475569) 8%, transparent);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.voc-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.voc-card--stack {
  margin-bottom: 16px;
}

.voc-card-header {
  padding: 18px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.voc-card-title {
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  font-weight: 700;
}

.voc-card-body {
  padding: 0 20px 20px;
}

.voc-card-body--top-pad {
  padding-top: 20px;
}

.voc-section-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
  margin: 24px 0 12px;
  padding-left: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default, #e2e8f0);
  position: relative;
}

.voc-section-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #3b82f6, #8b5cf6);
}

.voc-section-header--first {
  margin-top: 0;
}

.voc-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  margin-bottom: 6px;
}

.voc-section-header h2,
.voc-section-header p,
.voc-executive-strip h3,
.voc-executive-strip p,
.voc-list-item h4,
.voc-list-item p,
.voc-inline-panel p {
  margin: 0;
}

.voc-section-header h2 {
  font-size: 1.12rem;
}

.voc-section-header p,
.voc-chart-subtitle,
.voc-muted {
  color: var(--text-muted, #64748b);
}

.voc-stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 8px;
}

.voc-kpi-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.voc-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.voc-delta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.voc-delta-chip.positive {
  background: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 12%, var(--bg-card, #ffffff));
  color: var(--voc-accent-dark, var(--accent-green-dark, #15803d));
  border-color: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 22%, transparent);
}

.voc-delta-chip.negative {
  background: color-mix(in srgb, var(--accent-red, #dc2626) 12%, var(--bg-card, #ffffff));
  color: var(--accent-red, #dc2626);
  border-color: color-mix(in srgb, var(--accent-red, #dc2626) 22%, transparent);
}

.voc-delta-chip.neutral {
  background: color-mix(in srgb, var(--slate-300, #cbd5e1) 22%, var(--bg-card, #ffffff));
  color: var(--text-muted, #64748b);
  border-color: color-mix(in srgb, var(--slate-400, #94a3b8) 30%, transparent);
}

.voc-kpi-benchmark {
  font-size: 0.9rem;
  color: var(--text-secondary, #475569);
  min-height: 22px;
}

.voc-kpi-mini-chart {
  display: flex;
  align-items: end;
  gap: 4px;
  min-height: 48px;
}

.voc-kpi-mini-bar {
  flex: 1 1 0;
  min-width: 8px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-blue, #2563eb) 82%, white), color-mix(in srgb, var(--voc-accent, var(--accent-green)) 60%, transparent));
  opacity: 0.9;
}

.voc-kpi-mini-empty {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.voc-kpi-pipeline-bar {
  height: 4px;
  background: color-mix(in srgb, var(--slate-300, #cbd5e1) 32%, transparent);
  border-radius: 999px;
  overflow: hidden;
}

.voc-kpi-pipeline-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-blue, #2563eb), color-mix(in srgb, var(--voc-accent, var(--accent-green)) 65%, white));
  border-radius: inherit;
  transition: width 0.8s ease;
}

.voc-kpi-pipeline-label {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.voc-kpi-card.severity-good,
.voc-grid.stats .voc-card.severity-good {
  background: color-mix(in srgb, var(--accent-green, #16a34a) 8%, var(--bg-card, #ffffff));
  border-color: color-mix(in srgb, var(--accent-green, #16a34a) 25%, transparent);
}

.voc-kpi-card.severity-warn,
.voc-grid.stats .voc-card.severity-warn {
  background: color-mix(in srgb, var(--accent-amber, #d97706) 8%, var(--bg-card, #ffffff));
  border-color: color-mix(in srgb, var(--accent-amber, #d97706) 25%, transparent);
}

.voc-kpi-card.severity-critical,
.voc-grid.stats .voc-card.severity-critical {
  background: color-mix(in srgb, var(--accent-red, #dc2626) 8%, var(--bg-card, #ffffff));
  border-color: color-mix(in srgb, var(--accent-red, #dc2626) 25%, transparent);
  animation: voc-kpi-pulse 2s ease-in-out infinite;
}

@keyframes voc-kpi-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-red, #dc2626) 20%, transparent); }
  50% { box-shadow: 0 0 12px 4px color-mix(in srgb, var(--accent-red, #dc2626) 15%, transparent); }
}

.voc-kpi-card.severity-empty,
.voc-grid.stats .voc-card.severity-empty {
  background: color-mix(in srgb, var(--slate-300, #cbd5e1) 10%, var(--bg-card, #ffffff));
  border-color: color-mix(in srgb, var(--slate-400, #94a3b8) 20%, transparent);
}

.voc-executive-strip {
  background: linear-gradient(135deg, color-mix(in srgb, var(--voc-accent, var(--accent-green)) 9%, var(--bg-card, #ffffff)), color-mix(in srgb, var(--accent-blue, #2563eb) 6%, var(--bg-card, #ffffff)));
  border: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 84%, transparent);
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--slate-600, #475569) 8%, transparent);
}

.voc-executive-strip p {
  margin-top: 6px;
}

.voc-executive-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.voc-executive-list li {
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-card, #ffffff) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 86%, transparent);
  line-height: 1.55;
}

.voc-pill,
.voc-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 10%, var(--bg-card, #ffffff));
  color: var(--voc-accent-dark, var(--accent-green-dark, #15803d));
  border: 1px solid color-mix(in srgb, var(--voc-accent, var(--accent-green)) 25%, transparent);
}

.voc-topic-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.voc-preset-chip {
  cursor: pointer;
}

.voc-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.voc-split-grid,
.voc-detail-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.voc-split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voc-detail-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.voc-list,
.voc-leaderboard-list,
.voc-topic-summary,
.voc-call-list,
.voc-calls-panel,
.voc-inline-list,
.voc-journey {
  display: grid;
  gap: 10px;
}

.voc-list-item,
.voc-mini-stat,
.voc-topic-row,
.voc-leaderboard-item,
.voc-inline-panel,
.voc-call-card {
  border: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 88%, transparent);
  background: color-mix(in srgb, var(--bg-card, #ffffff) 84%, var(--bg-primary, #f8fafc)));
  border-radius: 14px;
}

.voc-list-item,
.voc-inline-panel {
  padding: 14px;
}

.voc-list-item.attention {
  border-left: 4px solid var(--accent-red, #dc2626);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-red, #dc2626) 6%, var(--bg-card, #ffffff)), color-mix(in srgb, var(--bg-card, #ffffff) 84%, var(--bg-primary, #f8fafc))));
}

.voc-list-item.attention.sentiment-negative {
  border-left: 3px solid #ef4444;
  padding-left: 13px;
}

.voc-list-item.attention.sentiment-positive {
  border-left: 3px solid #22c55e;
  padding-left: 13px;
}

.voc-list-item.attention.sentiment-neutral {
  border-left: 3px solid #eab308;
  padding-left: 13px;
}

.voc-section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.voc-back-link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--accent-blue, #2563eb);
  cursor: pointer;
  margin-bottom: 14px;
}

.voc-mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.voc-mini-stat strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.voc-topic-card {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.voc-topic-card:hover,
.voc-call-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 35%, var(--border-default, #e2e8f0));
}

.voc-leaderboard-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
}

.voc-rank-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  background: color-mix(in srgb, var(--slate-200, #e2e8f0) 68%, var(--bg-card, #ffffff));
  color: var(--text-primary, #0f172a);
}

.voc-rank-badge.gold { background: color-mix(in srgb, var(--yellow-100, #fef3c7) 88%, var(--bg-card, #ffffff)); color: var(--accent-amber, #d97706); }
.voc-rank-badge.silver { background: color-mix(in srgb, var(--slate-200, #e2e8f0) 88%, var(--bg-card, #ffffff)); color: var(--slate-600, #475569); }
.voc-rank-badge.bronze { background: color-mix(in srgb, var(--orange-100, #ffedd5) 88%, var(--bg-card, #ffffff)); color: var(--orange-500, #f97316); }

.voc-leaderboard-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.voc-leaderboard-name {
  font-weight: 700;
}

.voc-link {
  color: inherit;
  text-decoration: none;
}

.voc-link:hover,
.voc-link:focus-visible {
  color: var(--voc-accent, var(--accent-green, #16a34a));
  outline: none;
}

.voc-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
}

.voc-score-pill.strong {
  background: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 14%, var(--bg-card, #ffffff));
  color: var(--voc-accent-dark, var(--accent-green-dark, #15803d));
  border-color: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 20%, transparent);
}

.voc-score-pill.mid {
  background: color-mix(in srgb, var(--accent-amber, #d97706) 14%, var(--bg-card, #ffffff));
  color: var(--accent-amber, #d97706);
  border-color: color-mix(in srgb, var(--accent-amber, #d97706) 20%, transparent);
}

.voc-score-pill.weak {
  background: color-mix(in srgb, var(--accent-red, #dc2626) 14%, var(--bg-card, #ffffff));
  color: var(--accent-red, #dc2626);
  border-color: color-mix(in srgb, var(--accent-red, #dc2626) 20%, transparent);
}

.voc-topic-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
}

.voc-topic-row strong {
  display: block;
  margin-bottom: 4px;
}

.voc-topic-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.voc-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.46);
  z-index: 50;
}

.voc-modal.open {
  display: flex;
}

.voc-modal-panel {
  width: min(1220px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--bg-primary, #f8fafc);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

.voc-modal-header {
  position: sticky;
  top: 0;
  padding: 18px 22px;
  background: color-mix(in srgb, var(--bg-card, #ffffff) 84%, var(--bg-primary, #f8fafc));
  border-bottom: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 85%, transparent);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  z-index: 1;
}

.voc-modal-title {
  margin: 4px 0 0;
}

.voc-journey-point {
  display: grid;
  grid-template-columns: 80px 80px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 85%, transparent);
}

.voc-transcript,
.voc-transcript-modal-body {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.95rem;
}

.voc-transcript {
  background: color-mix(in srgb, var(--bg-card, #ffffff) 55%, var(--bg-primary, #f8fafc));
  border: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 88%, transparent);
  border-radius: 16px;
  padding: 16px;
  max-height: 360px;
  overflow: auto;
}

.voc-annotation {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--accent-blue, #2563eb) 10%, var(--bg-card, #ffffff));
  color: var(--accent-blue, #2563eb);
}

.voc-customer-context {
  background: color-mix(in srgb, var(--bg-card, #ffffff) 78%, var(--bg-primary, #f8fafc));
  border: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 90%, transparent);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
}

.voc-customer-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.voc-customer-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--accent-blue, #2563eb) 10%, var(--bg-card, #ffffff));
  border: 1px solid color-mix(in srgb, var(--accent-blue, #2563eb) 16%, transparent);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-secondary, #334155);
}

.voc-cancel-flag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 999px;
  font-size: 0.78rem;
  color: #b91c1c;
}

.voc-customer-programs {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 8px;
}

.voc-filter-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.voc-filter-bar > div {
  min-width: 0;
}

.voc-filter-bar .voc-filter-input,
.voc-filter-bar .voc-select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.voc-filter-search {
  grid-column: span 2;
}

.voc-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.voc-pipeline-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  font-size: 0.8rem;
}

.voc-pipeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  animation: voc-pulse-dot 1.5s ease infinite;
}

@keyframes voc-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.voc-call-card {
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.voc-call-card.expanded {
  border-color: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 34%, var(--border-default, #e2e8f0));
}

.voc-call-summary {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 18px;
  cursor: pointer;
  display: grid;
  gap: 12px;
}

.voc-call-summary-top,
.voc-call-summary-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.voc-call-main {
  display: flex;
  gap: 14px;
  min-width: 0;
  align-items: flex-start;
  flex: 1;
}

.voc-call-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent-blue, #2563eb) 12%, var(--bg-card, #ffffff));
  color: var(--accent-blue, #2563eb);
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.voc-call-card.outbound .voc-call-icon {
  background: color-mix(in srgb, var(--accent-amber, #d97706) 12%, var(--bg-card, #ffffff));
  color: var(--accent-amber, #d97706);
}

.voc-call-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 6px;
}

.voc-call-headline,
.voc-call-meta,
.voc-call-secondary,
.voc-inline-chip-row,
.voc-pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.voc-call-name {
  font-size: 1.02rem;
  font-weight: 700;
}

.voc-badge.company {
  background: color-mix(in srgb, var(--accent-blue, #2563eb) 10%, var(--bg-card, #ffffff));
  color: var(--accent-blue, #2563eb);
  border-color: color-mix(in srgb, var(--accent-blue, #2563eb) 18%, transparent);
}

.voc-badge.duration {
  background: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 10%, var(--bg-card, #ffffff));
  color: var(--voc-accent, var(--accent-green));
  border-color: color-mix(in srgb, var(--voc-accent, var(--accent-green)) 18%, transparent);
}

.voc-voc-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.voc-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
}

.voc-status-dot.processed { background: #16a34a; color: #16a34a; }
.voc-status-dot.pending { background: #d97706; color: #d97706; }
.voc-status-dot.error { background: #dc2626; color: #dc2626; }
.voc-status-dot.none { background: #64748b; color: #64748b; }

.voc-call-meta,
.voc-call-secondary,
.voc-call-preview {
  font-size: 0.9rem;
}

.voc-call-meta,
.voc-call-secondary {
  color: var(--text-muted, #64748b);
}

.voc-call-preview {
  color: var(--text-secondary, #475569);
  line-height: 1.6;
}

.voc-call-expand {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
  border-top: 1px solid color-mix(in srgb, var(--border-default, #e2e8f0) 85%, transparent);
  background: color-mix(in srgb, var(--bg-card, #ffffff) 78%, var(--bg-primary, #f8fafc));
}

.voc-actions-pad-top {
  padding-top: 16px;
}

.voc-call-expand-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  padding-top: 16px;
}

.voc-inline-panel h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #64748b);
}

.voc-inline-panel audio {
  width: 100%;
}

.voc-empty-state {
  text-align: center;
  padding: 32px 18px;
  color: var(--text-muted, #64748b);
}

.voc-transcript-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.voc-transcript-modal-panel {
  background: var(--bg-card, #fff);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 18px;
  padding: 24px;
  max-width: 760px;
  width: 100%;
  max-height: 84vh;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

.voc-transcript-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.voc-transcript-modal-title {
  margin: 0;
  color: var(--text-primary, #0f172a);
}

.voc-transcript-modal-meta {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin-top: 4px;
}

.voc-transcript-modal-close {
  background: none;
  border: none;
  color: var(--text-muted, #64748b);
  font-size: 22px;
  cursor: pointer;
}

.voc-transcript-modal-body {
  color: var(--text-secondary, #475569);
}

.voc-stack-top-xxs { margin-top: 4px !important; }
.voc-stack-top-xs { margin-top: 6px !important; }
.voc-stack-top-sm { margin-top: 10px !important; }
.voc-stack-top-md { margin-top: 12px !important; }

.voc-embedded-page--portal {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: transparent;
  height: calc(100vh - 170px);
}

.voc-ag-theme {
  --voc-accent: #ea580c;
  --voc-accent-light: #fff7ed;
  --voc-accent-dark: #c2410c;
}

.voc-ag-theme .voc-executive-strip {
  background: linear-gradient(135deg, color-mix(in srgb, var(--voc-accent) 14%, var(--bg-card, #ffffff)), color-mix(in srgb, #fb923c 10%, var(--bg-card, #ffffff)));
}

.voc-ag-theme .voc-pill,
.voc-ag-theme .voc-preset-chip {
  background: color-mix(in srgb, var(--voc-accent) 12%, var(--bg-card, #ffffff));
  color: var(--voc-accent-dark);
  border-color: color-mix(in srgb, var(--voc-accent) 24%, transparent);
}

.voc-ag-theme .voc-grid.stats .voc-card:nth-child(1),
.voc-ag-theme .voc-grid.stats .voc-card:nth-child(2),
.voc-ag-theme .voc-grid.stats .voc-card:nth-child(3),
.voc-ag-theme .voc-grid.stats .voc-card:nth-child(4) {
  --voc-accent: #ea580c;
}

.voc-ag-theme .voc-card-title,
.voc-ag-theme .voc-section-label {
  color: #9a3412;
}

/* === VOC Elite UI: KPI severity === */
.voc-grid.stats .voc-card { transition: background 0.4s ease, box-shadow 0.4s ease; }
.voc-grid.stats .voc-card.severity-good {
  background: linear-gradient(135deg, rgba(34,197,94,0.08) 0%, rgba(34,197,94,0.03) 100%);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.2);
}
.voc-grid.stats .voc-card.severity-warn {
  background: linear-gradient(135deg, rgba(234,179,8,0.12) 0%, rgba(234,179,8,0.04) 100%);
  box-shadow: 0 0 0 1px rgba(234,179,8,0.25);
}
.voc-grid.stats .voc-card.severity-critical {
  background: linear-gradient(135deg, rgba(239,68,68,0.14) 0%, rgba(239,68,68,0.05) 100%);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.3);
  animation: voc-pulse-red 2s ease infinite;
}
.voc-grid.stats .voc-card.severity-empty {
  background: linear-gradient(135deg, rgba(100,116,139,0.1) 0%, transparent 100%);
  box-shadow: 0 0 0 1px rgba(100,116,139,0.2);
}
@keyframes voc-pulse-red {
  0%, 100% { box-shadow: 0 0 0 1px rgba(239,68,68,0.3); }
  50% { box-shadow: 0 0 0 3px rgba(239,68,68,0.2), 0 0 20px rgba(239,68,68,0.1); }
}

/* === VOC Elite UI: Positive empty states === */
.voc-empty-positive {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 10px;
  color: #16a34a;
  font-size: 0.875rem;
  font-weight: 500;
}
.voc-ag-theme .voc-empty-positive {
  background: rgba(234,88,12,0.06);
  border-color: rgba(234,88,12,0.2);
  color: #ea580c;
}

/* === VOC Elite UI: CSR Growth Board === */
.csr-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(100,116,139,0.1);
}
.csr-mini-radar {
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}
.csr-mini-radar:hover {
  opacity: 1;
  transform: scale(1.1);
}
.csr-info {
  flex: 1;
  min-width: 0;
}
.csr-growth-ring {
  flex-shrink: 0;
}

/* === VOC Elite UI: Topic coaching notes === */
.voc-topic-coaching-notes {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.voc-topic-coaching-note {
  font-size: 0.82rem;
  color: var(--text-secondary, #475569);
  line-height: 1.4;
}

/* === VOC Elite UI: CFI Gauge === */
.voc-cfi-section {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: rgba(15,23,42,0.6);
  border-radius: 16px;
  border: 1px solid rgba(100,116,139,0.15);
}
.voc-cfi-gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.voc-cfi-label-top {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}
.voc-ag-theme .voc-cfi-section {
  background: rgba(124,45,18,0.08);
  border-color: rgba(234,88,12,0.15);
}

/* === VOC Elite UI: Alarm strip === */
.voc-alarm-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 260px;
  max-height: 160px;
  overflow: hidden;
}

.voc-cfi-drivers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  flex: 1 1 420px;
  align-self: center;
}

.voc-cfi-driver {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
}

.voc-cfi-driver-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.voc-cfi-driver-value {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.voc-cfi-driver-detail {
  font-size: 0.75rem;
  color: #94a3b8;
}
.voc-alarm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  font-size: 0.8rem;
  transition: opacity 0.5s;
}
.voc-alarm-new { animation: voc-slide-in 0.3s ease; }
@keyframes voc-slide-in {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.voc-alarm-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: voc-pulse-dot 1.5s ease infinite;
}
@keyframes voc-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === VOC Elite UI: Coaching task button === */
.voc-coaching-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.voc-coaching-alert-content {
  flex: 1;
  min-width: 0;
}
.voc-create-task-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* === VOC Masterwork: Section descriptions === */
.voc-section-desc {
  font-size: 0.8rem;
  color: var(--slate-400, #94a3b8);
  margin: -8px 0 16px 0;
  font-style: italic;
  line-height: 1.5;
}

/* === VOC Masterwork: Period label === */
.voc-period-label {
  font-size: 0.78rem;
  color: var(--slate-400, #94a3b8);
  font-style: italic;
  white-space: nowrap;
}

/* === VOC Masterwork: Topic expand/collapse === */
.voc-topic-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s ease;
  padding: 0;
}
.voc-topic-detail.expanded {
  max-height: 400px;
  padding: 12px 0;
}
.voc-topic-detail .voc-excerpt {
  font-size: 0.82rem;
  color: var(--slate-400, #94a3b8);
  padding: 6px 0;
  border-bottom: 1px solid rgba(100,116,139,0.08);
  line-height: 1.5;
}
.voc-topic-detail .voc-topic-action {
  font-size: 0.82rem;
  color: var(--text-secondary, #475569);
  padding: 8px 0 4px;
  font-weight: 500;
}
.voc-topic-detail .voc-topic-stats-line {
  font-size: 0.78rem;
  color: var(--slate-400, #94a3b8);
  margin-top: 8px;
}
.voc-topic-row { cursor: pointer; }
.voc-topic-row:hover { background: rgba(100,116,139,0.04); }

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

.voc-topic-insight {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.4;
}

.voc-topic-insight.warn { color: #fbbf24; }
.voc-topic-insight.rising { color: #34d399; }

/* === VOC Masterwork: Trend indicators === */
.voc-trend { font-size: 1rem; font-weight: 700; margin-left: 4px; }
.voc-trend.up { color: #ef4444; }
.voc-trend.down { color: #22c55e; }
.voc-trend.flat { color: #94a3b8; }
.voc-trend.new { color: #f59e0b; font-size: 0.75rem; }
.voc-trend.good-up { color: #22c55e; }

/* === VOC Masterwork: Sentiment journey timeline === */
.voc-sentiment-journey { margin: 12px 0; }
.voc-journey-track {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
}
.voc-journey-segment {
  height: 100%;
  transition: opacity 0.2s;
  border-radius: 2px;
}
.voc-journey-segment:hover { opacity: 1 !important; }
.voc-journey-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* === VOC Masterwork: CSR inline expand === */
.voc-csr-detail-expand {
  padding: 12px 0 8px 76px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s ease;
}
.voc-csr-detail-expand.expanded {
  max-height: 500px;
  padding: 12px 0 8px 76px;
}
.voc-dim-grid { display: flex; flex-direction: column; gap: 6px; }
.voc-dim-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.voc-dim-label {
  font-size: 0.78rem;
  color: var(--slate-400, #94a3b8);
  width: 80px;
  flex-shrink: 0;
}
.voc-dim-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(100,116,139,0.12);
  border-radius: 3px;
  overflow: hidden;
}
.voc-dim-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.voc-dim-score {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  width: 32px;
  text-align: right;
}
.voc-coaching-focus {
  font-size: 0.82rem;
  color: var(--text-secondary, #475569);
  margin-top: 10px;
  padding: 6px 0;
}

.voc-csr-insight {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
}

.voc-csr-insight.warn { color: #fbbf24; }
.voc-csr-stats-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--slate-400, #94a3b8);
}
.voc-csr-stats-row .voc-filter-link {
  color: var(--accent-blue, #2563eb);
  text-decoration: none;
  cursor: pointer;
}
.voc-csr-stats-row .voc-filter-link:hover { text-decoration: underline; }
.csr-leaderboard-row { cursor: pointer; }
.csr-leaderboard-row:hover { background: rgba(100,116,139,0.04); }

/* === VOC Masterwork: AG theme overrides for new elements === */
.voc-ag-theme .voc-trend.up { color: #ea580c; }
.voc-ag-theme .voc-trend.good-up { color: #ea580c; }
.voc-ag-theme .voc-dim-bar { background-color: #ea580c; }
.voc-ag-theme .voc-csr-stats-row .voc-filter-link { color: #ea580c; }

.voc-sentiment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 6px;
  width: fit-content;
}
.voc-sentiment-badge.positive { background: rgba(34,197,94,0.15); color: #86efac; }
.voc-sentiment-badge.mixed { background: rgba(234,179,8,0.15); color: #fde68a; }
.voc-sentiment-badge.risk { background: rgba(239,68,68,0.15); color: #fca5a5; }

.voc-team-health-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.voc-team-health-value {
  font-weight: 700;
  font-size: 1rem;
}

.voc-team-health-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 8px 0 12px;
}

.voc-team-health-note {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 16px;
}

.voc-team-health-list {
  display: grid;
  gap: 10px;
}

.voc-leaderboard-summary-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.voc-lsr-rank {
  font-size: 0.78rem;
  font-weight: 800;
  color: #cbd5e1;
}

.voc-lsr-name {
  font-weight: 700;
  min-width: 0;
}

.voc-lsr-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
}

.voc-lsr-calls {
  grid-column: 2 / -1;
  font-size: 0.75rem;
  color: #64748b;
}

.ag-data-freshness {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 12px;
}

.ag-summary-row {
  margin-bottom: 16px;
}

.ag-error-banner {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #c2410c;
  align-items: center;
  gap: 10px;
}

.ag-error-banner-action {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid #c2410c;
  border-radius: 999px;
  background: transparent;
  color: #c2410c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.ag-filter-bar {
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ag-filter-search {
  min-width: 240px;
}

.ag-state-block {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.ag-state-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.ag-empty-state-card {
  margin-bottom: 0;
}

.ag-empty-state-body {
  text-align: center;
  padding: 40px;
}

.ag-empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.ag-empty-state-title {
  margin: 0 0 8px;
}

.ag-empty-state-copy,
.ag-pagination-summary {
  color: var(--text-muted);
  margin: 0;
}

.ag-pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ag-pagination-summary {
  font-size: 12px;
}

.ag-pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ag-analytics-card {
  margin-bottom: 16px;
  background:
    radial-gradient(circle at top right, rgba(234, 88, 12, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff, #fffaf5);
}

.ag-analytics-stat-grid {
  margin-bottom: 18px;
}

.ag-analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ag-analytics-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ag-topic-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-shell {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.voc-guide-page {
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-blue, #2563eb) 10%, transparent), transparent 26%),
    linear-gradient(180deg, var(--bg-primary, #f8fafc), color-mix(in srgb, var(--bg-card, #ffffff) 42%, var(--bg-primary, #f8fafc)));
  color: var(--text-primary, #0f172a);
  font-family: Outfit, sans-serif;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 32%),
    linear-gradient(180deg, #fcfdff, #f8fafc);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}

.guide-eyebrow,
.guide-search-label,
.guide-section-label,
.guide-panel-label,
.guide-sidebar-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.guide-hero h1 {
  margin: 10px 0 0;
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

.guide-hero-summary {
  margin: 14px 0 0;
  max-width: 640px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.guide-hero-copy {
  min-width: 0;
}

.guide-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 22px;
}

.guide-hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.guide-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
}

.guide-hero-panel,
.guide-sidebar-card,
.guide-mini-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.guide-hero-panel {
  padding: 22px;
}

.guide-hero-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.guide-mobile-controls {
  display: none;
  gap: 12px;
  margin-top: 16px;
}

.guide-search-shell {
  display: grid;
  gap: 6px;
  flex: 1;
}

.guide-search {
  display: grid;
  gap: 6px;
  min-width: min(100%, 320px);
  flex: 1 1 280px;
}

.guide-search-input,
.guide-nav-toggle {
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  background: var(--bg-card);
}

.guide-nav-toggle {
  display: none;
  font-weight: 700;
}

.guide-nav-panel {
  position: sticky;
  top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.guide-nav-panel h2 {
  margin: 0;
  font-size: 0.95rem;
}

.guide-nav-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.guide-nav-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.guide-nav-list a:hover,
.guide-nav-list a:focus-visible {
  background: #f8fafc;
  color: var(--text-primary);
  outline: none;
}

.guide-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.guide-sidebar {
  position: relative;
}

.guide-sidebar-card {
  position: sticky;
  top: 20px;
  padding: 20px;
}

.guide-sidebar-head p {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.guide-nav {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.guide-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.guide-nav a:hover {
  background: #f8fafc;
  color: var(--text-primary);
}

.guide-link-hidden {
  display: none !important;
}

.guide-content {
  display: grid;
  gap: 20px;
}

.guide-section {
  background: var(--bg-card);
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.guide-section-hidden {
  display: none;
}

.guide-section-header {
  display: grid;
  gap: 6px;
}

.guide-section-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.guide-section-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.guide-section h2 {
  margin: 8px 0 0;
  font-size: 1.45rem;
}

.guide-section-link {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}

.guide-section-summary {
  margin: 14px 0 0;
  max-width: 58rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.guide-card-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.guide-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text-primary);
}

.guide-mini-card {
  padding: 18px;
}

.guide-mini-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.guide-mini-card p,
.guide-mini-card ul,
.guide-mini-card ol {
  margin: 0;
}

.guide-mini-card ul,
.guide-mini-card ol,
.guide-hero-list,
.guide-number-list,
.guide-section ul {
  line-height: 1.7;
}

.guide-number-list {
  margin: 0;
  padding-left: 18px;
}

.guide-two-column-list {
  columns: 2;
  column-gap: 24px;
}

.guide-two-column-list li {
  break-inside: avoid;
  margin-bottom: 8px;
}

.guide-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.guide-flow-step {
  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: color-mix(in srgb, var(--bg-card, #ffffff) 90%, var(--bg-primary, #f8fafc));
  text-align: center;
  font-weight: 700;
  color: var(--text-secondary, #475569);
}

.guide-section ul {
  margin: 0;
  padding-left: 18px;
}

.guide-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 18px;
}

.guide-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.guide-table tbody tr:nth-child(odd) td {
  background: rgba(248, 250, 252, 0.7);
}

.guide-table td {
  padding: 12px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
  vertical-align: top;
}

.guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.guide-tip,
.guide-warning,
.guide-key-concept {
  margin-top: 16px;
  border-radius: 20px;
  border: 1px solid;
  padding: 18px 18px 18px 56px;
  position: relative;
}

.guide-tip::before,
.guide-warning::before,
.guide-key-concept::before {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.guide-tip {
  background: color-mix(in srgb, var(--accent-green) 10%, var(--bg-card, #fff));
  border-color: color-mix(in srgb, var(--accent-green) 28%, transparent);
}

.guide-tip::before {
  content: "i";
  color: #166534;
  background: rgba(34, 197, 94, 0.16);
}

.guide-warning {
  background: color-mix(in srgb, var(--accent-amber) 10%, var(--bg-card, #fff));
  border-color: color-mix(in srgb, var(--accent-amber) 30%, transparent);
}

.guide-warning::before {
  content: "!";
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
}

.guide-key-concept {
  background: color-mix(in srgb, var(--accent-blue) 10%, var(--bg-card, #fff));
  border-color: color-mix(in srgb, var(--accent-blue) 28%, transparent);
}

.guide-key-concept::before {
  content: "•";
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.16);
}

.guide-tip strong,
.guide-warning strong,
.guide-key-concept strong {
  display: block;
  margin-bottom: 6px;
}

.guide-tip p,
.guide-warning p,
.guide-key-concept p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

.guide-faq-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.guide-faq-item {
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.guide-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-primary);
}

.guide-faq-item p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

.guide-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 4px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.guide-no-results .guide-footer::before {
  content: "No matching sections found.";
  color: #c2410c;
  font-weight: 700;
}

[data-theme="dark"] .guide-hero,
[data-theme="dark"] .guide-nav-panel,
[data-theme="dark"] .guide-card,
[data-theme="dark"] .guide-section,
[data-theme="dark"] .guide-faq-item {
  background: var(--bg-card, #0f172a);
  border-color: var(--border-subtle, #334155);
}

[data-theme="dark"] .guide-nav-list a:hover,
[data-theme="dark"] .guide-nav-list a:focus-visible {
  background: rgba(30, 41, 59, 0.72);
}

[data-theme="dark"] .guide-meta-pill,
[data-theme="dark"] .guide-flow-step {
  background: rgba(15, 23, 42, 0.72);
  border-color: var(--border-subtle, #334155);
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .guide-table {
  border-color: var(--border-subtle, #334155);
}

[data-theme="dark"] .guide-table thead th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-secondary, #cbd5e1);
  border-bottom-color: var(--border-subtle, #334155);
}

[data-theme="dark"] .guide-table tbody tr:nth-child(odd) td {
  background: rgba(30, 41, 59, 0.5);
}

[data-theme="dark"] .guide-table td {
  border-bottom-color: var(--border-subtle, #334155);
}

@media (max-width: 1200px) {
  .voc-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .guide-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .guide-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .voc-grid.stats,
  .voc-mini-stats,
  .voc-main-grid,
  .voc-split-grid,
  .voc-detail-grid,
  .voc-call-expand-grid,
  .guide-card-grid,
  .guide-hero,
  .ag-analytics-layout {
    grid-template-columns: 1fr;
  }

  .guide-mobile-controls {
    display: flex;
  }

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .guide-nav-panel {
    display: none;
    position: static;
    margin-top: 12px;
  }

  .guide-nav-panel.guide-nav-panel-open {
    display: block;
  }

  .voc-cfi-drivers {
    grid-template-columns: 1fr;
  }

  .voc-leaderboard-summary-row {
    grid-template-columns: 1fr;
  }

  .voc-lsr-calls {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .voc-shell,
  .guide-shell {
    padding: 16px;
  }

  .voc-executive-list,
  .guide-card-grid {
    grid-template-columns: 1fr;
  }

  .voc-leaderboard-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .voc-journey-point,
  .voc-filter-bar {
    grid-template-columns: 1fr;
  }

  .voc-filter-search {
    grid-column: span 1;
  }

  .voc-call-summary,
  .voc-call-expand,
  .guide-hero,
  .guide-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .guide-mobile-controls,
  .guide-footer {
    flex-direction: column;
  }

  .guide-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-search {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .guide-two-column-list,
  .guide-flow {
    columns: 1;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ag-filter-bar,
  .ag-pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .ag-filter-search {
    min-width: 0;
  }
}
.reporting-width-0 { width: 0%; }
.reporting-width-1 { width: 1%; }
.reporting-width-2 { width: 2%; }
.reporting-width-3 { width: 3%; }
.reporting-width-4 { width: 4%; }
.reporting-width-5 { width: 5%; }
.reporting-width-6 { width: 6%; }
.reporting-width-7 { width: 7%; }
.reporting-width-8 { width: 8%; }
.reporting-width-9 { width: 9%; }
.reporting-width-10 { width: 10%; }
.reporting-width-11 { width: 11%; }
.reporting-width-12 { width: 12%; }
.reporting-width-13 { width: 13%; }
.reporting-width-14 { width: 14%; }
.reporting-width-15 { width: 15%; }
.reporting-width-16 { width: 16%; }
.reporting-width-17 { width: 17%; }
.reporting-width-18 { width: 18%; }
.reporting-width-19 { width: 19%; }
.reporting-width-20 { width: 20%; }
.reporting-width-21 { width: 21%; }
.reporting-width-22 { width: 22%; }
.reporting-width-23 { width: 23%; }
.reporting-width-24 { width: 24%; }
.reporting-width-25 { width: 25%; }
.reporting-width-26 { width: 26%; }
.reporting-width-27 { width: 27%; }
.reporting-width-28 { width: 28%; }
.reporting-width-29 { width: 29%; }
.reporting-width-30 { width: 30%; }
.reporting-width-31 { width: 31%; }
.reporting-width-32 { width: 32%; }
.reporting-width-33 { width: 33%; }
.reporting-width-34 { width: 34%; }
.reporting-width-35 { width: 35%; }
.reporting-width-36 { width: 36%; }
.reporting-width-37 { width: 37%; }
.reporting-width-38 { width: 38%; }
.reporting-width-39 { width: 39%; }
.reporting-width-40 { width: 40%; }
.reporting-width-41 { width: 41%; }
.reporting-width-42 { width: 42%; }
.reporting-width-43 { width: 43%; }
.reporting-width-44 { width: 44%; }
.reporting-width-45 { width: 45%; }
.reporting-width-46 { width: 46%; }
.reporting-width-47 { width: 47%; }
.reporting-width-48 { width: 48%; }
.reporting-width-49 { width: 49%; }
.reporting-width-50 { width: 50%; }
.reporting-width-51 { width: 51%; }
.reporting-width-52 { width: 52%; }
.reporting-width-53 { width: 53%; }
.reporting-width-54 { width: 54%; }
.reporting-width-55 { width: 55%; }
.reporting-width-56 { width: 56%; }
.reporting-width-57 { width: 57%; }
.reporting-width-58 { width: 58%; }
.reporting-width-59 { width: 59%; }
.reporting-width-60 { width: 60%; }
.reporting-width-61 { width: 61%; }
.reporting-width-62 { width: 62%; }
.reporting-width-63 { width: 63%; }
.reporting-width-64 { width: 64%; }
.reporting-width-65 { width: 65%; }
.reporting-width-66 { width: 66%; }
.reporting-width-67 { width: 67%; }
.reporting-width-68 { width: 68%; }
.reporting-width-69 { width: 69%; }
.reporting-width-70 { width: 70%; }
.reporting-width-71 { width: 71%; }
.reporting-width-72 { width: 72%; }
.reporting-width-73 { width: 73%; }
.reporting-width-74 { width: 74%; }
.reporting-width-75 { width: 75%; }
.reporting-width-76 { width: 76%; }
.reporting-width-77 { width: 77%; }
.reporting-width-78 { width: 78%; }
.reporting-width-79 { width: 79%; }
.reporting-width-80 { width: 80%; }
.reporting-width-81 { width: 81%; }
.reporting-width-82 { width: 82%; }
.reporting-width-83 { width: 83%; }
.reporting-width-84 { width: 84%; }
.reporting-width-85 { width: 85%; }
.reporting-width-86 { width: 86%; }
.reporting-width-87 { width: 87%; }
.reporting-width-88 { width: 88%; }
.reporting-width-89 { width: 89%; }
.reporting-width-90 { width: 90%; }
.reporting-width-91 { width: 91%; }
.reporting-width-92 { width: 92%; }
.reporting-width-93 { width: 93%; }
.reporting-width-94 { width: 94%; }
.reporting-width-95 { width: 95%; }
.reporting-width-96 { width: 96%; }
.reporting-width-97 { width: 97%; }
.reporting-width-98 { width: 98%; }
.reporting-width-99 { width: 99%; }
.reporting-width-100 { width: 100%; }

/* Customer Context — VOC call enrichment */
.voc-customer-context {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
}
.voc-customer-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.voc-customer-chip {
  padding: 2px 9px;
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  font-size: 0.75rem;
  color: #cbd5e1;
}
.voc-cancel-flag {
  padding: 2px 9px;
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 20px;
  font-size: 0.75rem;
  color: #fca5a5;
}
.voc-customer-programs { font-size: 0.75rem; color: #94a3b8; margin-top: 4px; }

/* =============================================
   VOC MASTERWORK — Premium UI Polish
   ============================================= */

/* CFI Drivers Panel */
.voc-cfi-section-inner { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.voc-cfi-drivers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.voc-cfi-driver {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
}
.voc-cfi-driver-label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.voc-cfi-driver-value { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.voc-cfi-driver-detail { font-size: 0.73rem; color: #94a3b8; line-height: 1.4; }

/* KPI Pipeline Mini-Bar */
.voc-kpi-pipeline-bar { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.voc-kpi-pipeline-fill { height: 100%; background: #3b82f6; border-radius: 2px; transition: width 0.8s ease; }
.voc-kpi-pipeline-label { font-size: 0.68rem; color: #64748b; margin-top: 4px; }

/* Sentiment Badge on KPI cards */
.voc-sentiment-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; margin-top: 6px;
}
.voc-sentiment-badge.positive { background: rgba(34,197,94,0.15); color: #86efac; }
.voc-sentiment-badge.mixed    { background: rgba(234,179,8,0.15);  color: #fde68a; }
.voc-sentiment-badge.risk     { background: rgba(239,68,68,0.15);  color: #fca5a5; }

/* Attention Call Sentiment Borders */
.voc-list-item.attention { transition: border-left 0.2s ease; }
.voc-list-item.attention.sentiment-negative { border-left: 3px solid #ef4444 !important; padding-left: 13px; }
.voc-list-item.attention.sentiment-positive { border-left: 3px solid #22c55e !important; padding-left: 13px; }
.voc-list-item.attention.sentiment-neutral  { border-left: 3px solid #eab308 !important; padding-left: 13px; }

/* CSR Insight Line */
.voc-csr-insight { font-size: 0.73rem; color: #94a3b8; margin-top: 5px; padding: 4px 8px; background: rgba(255,255,255,0.03); border-radius: 4px; line-height: 1.4; }
.voc-csr-insight.warn { color: #fbbf24; }
.voc-csr-insight.positive { color: #86efac; }

/* Topic Insight */
.voc-topic-insight { font-size: 0.76rem; color: #94a3b8; margin-top: 3px; line-height: 1.4; }
.voc-topic-insight.warn   { color: #fbbf24; }
.voc-topic-insight.rising { color: #34d399; }
.voc-topic-insight.falling { color: #f87171; }

/* Team Health / Leaderboard Summary */
.voc-team-health-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.voc-leaderboard-summary-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
}
.voc-leaderboard-summary-row:last-child { border-bottom: none; }
.voc-lsr-rank { color: #64748b; font-weight: 600; font-size: 0.75rem; }
.voc-lsr-name { color: #e2e8f0; font-weight: 500; }
.voc-lsr-meta { color: #94a3b8; font-size: 0.75rem; }
.voc-lsr-gap { font-size: 0.7rem; color: #fbbf24; grid-column: 2 / 4; margin-top: -4px; }

/* Section Header Accent */
.voc-section-header { position: relative; padding-left: 16px; }
.voc-section-header::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, #3b82f6 0%, #8b5cf6 100%);
}

/* Card Hover Lift */
.voc-card { transition: box-shadow 0.2s ease, transform 0.15s ease; }
.voc-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.4); transform: translateY(-1px); }

/* KPI Card Sub-detail */
.voc-kpi-sub { font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }
.voc-kpi-top-skill { font-size: 0.72rem; color: #86efac; margin-top: 2px; }
.voc-kpi-low-skill { font-size: 0.72rem; color: #fbbf24; margin-top: 1px; }

/* Topic bar sentiment dot */
.voc-topic-sentiment-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; flex-shrink: 0; }

/* KPI Severity states */
.voc-card.kpi-at-risk .voc-stat-value { color: #f87171; }
.voc-card.kpi-positive .voc-stat-value { color: #86efac; }
.voc-card.kpi-warning .voc-stat-value { color: #fde68a; }

/* Volume Analytics Section */
.voc-volume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.voc-card--wide {
  grid-column: 1 / -1;
}

.voc-volume-insight {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 10px;
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}

.voc-card-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.voc-controls--inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voc-select--sm {
  padding: 4px 8px;
  font-size: 0.8rem;
}

@media (max-width: 1024px) {
  .voc-volume-grid {
    grid-template-columns: 1fr;
  }
}

/* The three-column reporting-center headers need more room than a portrait
   tablet has after Portal padding. Keep this final override after the center
   component definitions so it also wins at the exact 768px boundary. */
@media (max-width: 900px) {
  .fleet-center-shell__controls,
  .voice-center-shell__controls,
  .people-center-shell__controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .fleet-center-shell__control-group,
  .voice-center-shell__control-group,
  .people-center-shell__control-group,
  .fleet-center-shell__controls select,
  .voice-center-shell__controls select,
  .people-center-shell__controls select,
  .fleet-center-shell__controls .company-toggle-container,
  .voice-center-shell__controls .company-toggle-container,
  .people-center-shell__controls .company-toggle-container {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .fleet-center-shell__status,
  .voice-center-shell__status,
  .people-center-shell__status {
    align-self: stretch;
    justify-content: flex-start;
    width: 100%;
  }
}

/* Final mobile/tablet interaction geometry. Keep this after every Portal
   reporting module, which intentionally uses denser desktop controls. */
@media (max-width: 1180px) {
  a.card,
  .breadcrumb a,
  .form-group small a,
  #drainageRiskView a[href],
  .company-btn,
  .admin-tab-btn,
  .inv-tab-btn,
  .voc-filter-tab,
  .triage-filter-pill,
  .voice-center-tab,
  .fleet-center-tab,
  .people-center-tab,
  .multi-select-trigger,
  .ch-filter-control,
  .ch-filter-clear,
  #estimatesDashboardView .ed-select,
  #estimatesDashboardView .ed-date-input,
  #estimatesDashboardView .ed-action-btn,
  #ed-filterEstimator,
  #ed-filterStatus,
  #ed-filterBrand,
  #taskSearchInput,
  .br-search-input,
  .td-search-input,
  .td-tab-btn,
  .td-attention-actions button,
  .touch-checkbox-label,
  [id^="fleetCenterTab-"],
  [id^="peopleCenterTab-"],
  [id^="estCenterTab-"],
  [id^="truckLoadTab-"],
  #drainageRiskView .drm-view-toggle button,
  #drainageRiskView .collapse-header,
  #drainageRiskView input[type="range"] {
    min-height: 44px !important;
  }

  .view-btn,
  .td-view-btn,
  .td-route-edit-btn,
  .td-collapse-btn,
  .br-info-btn {
    min-width: 44px;
    min-height: 44px !important;
  }

  #drainageRiskView input[type="range"] { touch-action: pan-y; }

  .breadcrumb a,
  .form-group small a {
    display: inline-flex;
    min-width: 44px;
    align-items: center;
  }
}
