/* ========================================================
   PROJECT FOOD SAVE - MODERN DESIGN SYSTEM & STYLES
   ======================================================== */

:root {
  --primary: #107a48;
  --primary-hover: #0c6139;
  --primary-light: #e8f5ed;
  --primary-glow: rgba(16, 122, 72, 0.15);

  --secondary: #0f172a;
  --secondary-light: #1e293b;

  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-red: #dc2626;
  --accent-red-light: #fee2e2;
  --accent-blue: #2563eb;
  --accent-blue-light: #eff6ff;

  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center; /* Strictly centers all top-level document blocks */
}

/* ========================================================
   HEADER & NAVIGATION
   ======================================================== */
.app-header {
  width: 100%;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.header-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  box-sizing: border-box;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #107a48 0%, #059669 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.brand-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: -0.02em;
}

.brand-tagline {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-tabs {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  padding: 0.3rem;
  border-radius: var(--radius-full);
}

.nav-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-dark);
  background: rgba(255,255,255,0.7);
}

.nav-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.nav-btn.highlight-driver.active {
  background: var(--primary);
  color: #ffffff;
}

.nav-btn.highlight-admin.active {
  background: var(--secondary);
  color: #ffffff;
}

.header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
}

/* Header action buttons - matching top curved pill theme */
.btn-header-action {
  border-radius: var(--radius-full) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  padding: 0.5rem 1.15rem !important;
  height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  border-width: 1.5px !important;
  transition: all var(--transition-fast) !important;
  letter-spacing: -0.01em;
}

.btn-header-action:hover {
  transform: translateY(-1px);
}

#auth-unlogged {
  display: flex;
  align-items: center;
}

/* Hamburger Sandwich Menu Button - rounded soft curve matching theme */
.hamburger-menu-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
  margin-left: 0.2rem;
  flex-shrink: 0;
}

.hamburger-menu-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.hamburger-bar {
  width: 18px;
  height: 2px;
  background-color: var(--text-dark);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* Hamburger Dropdown / Flyout - modern curved card */
.hamburger-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownFadeIn 0.18s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hamburger-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.hamburger-menu-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hamburger-close-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.hamburger-close-btn:hover {
  background: var(--border-subtle);
  color: var(--text-dark);
}

.hamburger-dropdown-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hamburger-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.hamburger-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-menu-action,
.btn-square-action {
  width: 100%;
  border-radius: var(--radius-full) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  padding: 0.65rem 1.15rem !important;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-menu-action:hover,
.btn-square-action:hover {
  transform: translateY(-1px);
}

.hamburger-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hamburger-nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Ensure hamburger dropdown is bounded on mobile */
@media (max-width: 480px) {
  .hamburger-dropdown {
    width: calc(100vw - 2rem);
    right: -0.5rem;
  }
}

.live-pulse-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* ========================================================
   NETWORK STATS STRIP
   ======================================================== */
.stats-strip {
  width: 100%;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-sizing: border-box;
}

.stats-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
  box-sizing: border-box;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #34d399;
}

.stat-label {
  font-size: 0.8rem;
  color: #cbd5e1;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
}

/* ========================================================
   MAIN CONTENT & TAB VIEWS
   ======================================================== */
.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tab-view {
  display: none;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  animation: fadeIn 0.25s ease forwards;
}

.tab-view.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

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

/* ========================================================
   VIEW 1: MISSION & ABOUT
   ======================================================== */
.hero-section {
  text-align: center;
  max-width: 900px;
  margin: 1.5rem auto 3.5rem;
}

.hero-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, #107a48 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Model Flow Cards */
.model-section {
  margin-top: 4rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--secondary);
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

.flow-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.flow-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.flow-step {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--border-strong);
}

.flow-icon {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.flow-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.6rem;
}

.flow-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.flow-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-dark);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* Comparison Matrix */
.comparison-section {
  margin-top: 4.5rem;
}

.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.matrix-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.matrix-box.traditional {
  border-top: 4px solid var(--accent-red);
}

.matrix-box.project-food-safe {
  border-top: 4px solid var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
}

.matrix-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.matrix-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.matrix-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.matrix-box li {
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  padding-left: 1.5rem;
}

.matrix-box.traditional li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-red);
  font-weight: bold;
}

.matrix-box.project-food-safe li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* ========================================================
   VIEW 2: FOOD SHELVES DIRECTORY
   ======================================================== */
.view-header {
  width: 100%;
  max-width: 860px;
  margin: 0.5rem auto 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  box-sizing: border-box;
}

.view-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 720px;
  margin: 0 auto;
}

.view-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.filter-pills {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 auto 2.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.45rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-dark);
}

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

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
  justify-content: center;
}

.shelf-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow var(--transition-normal);
}

.shelf-card:hover {
  box-shadow: var(--shadow-md);
}

.shelf-card.is-off-limits {
  border-left: 5px solid var(--accent-red);
  background: #fffafa;
}

.shelf-card.is-open {
  border-left: 5px solid var(--primary);
}

.shelf-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.shelf-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--secondary);
}

.shelf-status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.shelf-status-tag.open {
  background: var(--primary-light);
  color: var(--primary);
}

.shelf-status-tag.paused {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

.shelf-address {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.shelf-pause-alert {
  background: var(--accent-red-light);
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.shelf-pause-alert strong {
  display: block;
  margin-bottom: 0.2rem;
}

.shelf-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: var(--bg-subtle);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}

.spec-item strong {
  display: block;
  color: var(--text-dark);
  margin-bottom: 0.15rem;
}

.spec-item span {
  color: var(--text-muted);
}

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

.inbound-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-amber);
}

/* ========================================================
   VIEW 3: "I AM A DRIVER" PORTAL
   ======================================================== */
.driver-portal-wrapper {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
}

.driver-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  max-width: 580px;
  margin: 2rem auto;
}

.driver-badge-icon {
  width: 72px;
  height: 72px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}

.driver-heading {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.driver-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.55;
}

.demo-driver-picker {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-strong);
  text-align: left;
}

.demo-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.6rem;
}

.demo-pills {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.demo-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.demo-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.pill-badge {
  font-size: 0.72rem;
  background: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-weight: 600;
}

/* Driver Verified Dashboard Header */
.verified-driver-header {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.driver-profile-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.driver-avatar {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
}

.driver-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.driver-name-row h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
}

.badge-verified {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.driver-meta-row {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-sep {
  margin: 0 0.35rem;
  color: var(--border-strong);
}

/* Active Run Banner */
.active-run-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.active-run-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 0.85rem;
}

.run-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.live-dot-indicator {
  width: 10px;
  height: 10px;
  background: #34d399;
  border-radius: 50%;
  animation: pulse-ring 1.8s infinite;
}

.active-run-header h4 {
  font-size: 1.15rem;
  font-weight: 700;
}

.badge-transit {
  background: rgba(52, 211, 153, 0.2);
  color: #34d399;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.active-run-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.run-detail-cell {
  background: rgba(255,255,255,0.06);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
}

.cell-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.cell-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.cell-val.highlight {
  color: #6ee7b7;
}

.cell-val.eta-countdown {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #fbbf24;
}

.badge-cold {
  color: #93c5fd;
}

.run-actions-bar {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Log New Delivery Form Card */
.delivery-dispatch-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.header-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.form-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--secondary);
}

.form-card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.step-num {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Delivery Type Selector Cards */
.delivery-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.delivery-type-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  background: var(--bg-card);
}

.delivery-type-card input[type="radio"] {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.delivery-type-card:hover {
  border-color: var(--primary);
}

.delivery-type-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

.type-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.type-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.type-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.origin-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.preset-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
}

.preset-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.shelf-alert-box {
  margin-top: 0.75rem;
  background: var(--accent-red-light);
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.45;
}

.eta-control-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.eta-slider {
  flex: 1;
  accent-color: var(--primary);
}

.eta-bubble {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--secondary);
  white-space: nowrap;
}

.eta-bubble strong {
  font-size: 1.1rem;
  color: var(--primary);
}

.form-submit-row {
  margin-top: 1.5rem;
  text-align: right;
}

/* ========================================================
   VIEW 4: FOOD SHELF DIRECTOR & MEMBER PORTAL
   ======================================================== */
.director-portal-wrapper {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
}

.director-shelf-switcher {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.director-shelf-switcher label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.director-control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.director-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.shelf-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.shelf-large-icon {
  font-size: 3rem;
  background: var(--bg-subtle);
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.shelf-identity h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
}

.shelf-identity p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.15rem 0 0.5rem;
}

.storage-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.storage-tags .tag {
  background: var(--bg-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* The Big Intake Toggle Switch */
.intake-toggle-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}

.toggle-status-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.status-indicator-dot.paused {
  background: var(--accent-red);
}

.status-indicator-text.paused {
  color: var(--accent-red);
}

.switch {
  position: relative;
  display: inline-block;
  width: 68px;
  height: 36px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 28px;
  width: 28px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(32px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Pause Drawer */
.pause-config-drawer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  animation: slideDown 0.25s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.drawer-inner {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
}

.alert-icon {
  font-size: 1.75rem;
}

.drawer-content h4 {
  color: #991b1b;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.drawer-content p {
  color: #7f1d1d;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.drawer-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Director 2-Column Grid */
.director-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.col-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.col-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
}

.inbound-item {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.inbound-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.inbound-driver {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--secondary);
}

.inbound-eta {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-amber);
  font-size: 0.95rem;
}

.inbound-payload {
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 0.3rem;
}

.inbound-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.completed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

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

.authorized-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.75rem;
}

.auth-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.company-tag-list, .driver-tag-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-partner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-driver {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

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

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

.tm-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--secondary);
}

.tm-role {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.tm-contact {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ========================================================
   VIEW 5: ADMIN PORTAL
   ======================================================== */
.admin-login-box {
  max-width: 460px;
  margin: 3rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.admin-shield-icon {
  width: 64px;
  height: 64px;
  background: var(--secondary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
}

.admin-login-box h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.admin-login-box p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.admin-demo-box {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-demo-box code {
  background: var(--bg-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--secondary);
  font-weight: 600;
}

/* Admin Workspace */
.admin-workspace {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.admin-subnav {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  flex-wrap: wrap;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-tab-btn:hover {
  color: var(--text-dark);
}

.admin-tab-btn.active {
  background: var(--bg-card);
  color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.admin-subtab {
  display: none;
}

.admin-subtab.active {
  display: block;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-section-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--secondary);
}

.admin-section-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Data Tables */
.table-responsive {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-dark);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: #fafbfc;
}

/* Status Badges */
.badge-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-status.active {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-status.on_route {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

.badge-status.suspended {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

/* Live Dispatch Map */
.map-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.dispatch-map {
  width: 100%;
  height: 540px;
  border-radius: var(--radius-md);
  z-index: 1;
}

.map-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ========================================================
   MODALS & OVERLAYS
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

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

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

/* ========================================================
   FORM CONTROLS & UTILITIES
   ======================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-4 { flex: 4; }
.col-5 { flex: 5; }
.col-6 { flex: 6; }
.col-7 { flex: 7; }
.col-8 { flex: 8; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control-lg {
  padding: 0.85rem 1.15rem;
  font-size: 1rem;
}

.form-control-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 2.8rem;
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.input-with-unit {
  position: relative;
}

.unit-suffix {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dark);
}

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

.btn-warning {
  background: #f59e0b;
  color: #ffffff;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-success {
  background: #059669;
  color: #ffffff;
}

.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: var(--accent-red);
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toast {
  background: var(--secondary);
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.25s ease;
  max-width: 380px;
}

.toast.success { border-left: 4px solid #34d399; }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast.info { border-left: 4px solid var(--accent-blue); }

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

.hidden {
  display: none !important;
}

.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1.25rem; }
.text-sm { font-size: 0.82rem; }
.text-muted { color: var(--text-muted); }

/* ========================================================
   FOOTER
   ======================================================== */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--secondary);
  margin-right: 0.75rem;
}

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
@media (max-width: 992px) {
  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .nav-tabs {
    display: none;
  }
  .matrix-grid, .director-grid, .form-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .director-card-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .intake-toggle-container {
    align-items: flex-start;
  }
}

/* ========================================================
   UNIFIED AUTH, IMPERSONATION & PRIMARY CONTACT STYLES
   ======================================================== */

.user-session-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-info-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.user-pill-details {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.user-pill-details strong {
  font-size: 0.82rem;
  color: var(--secondary);
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.highlight-role {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  font-weight: 700;
}

/* Impersonation Simulation Bar */
.impersonation-alert {
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
}

.imp-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Bottom CTA Banner */
.bottom-cta-banner {
  margin-top: 5rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-icon {
  font-size: 3.5rem;
}

.cta-text {
  flex: 1;
  min-width: 280px;
}

.cta-text h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.cta-text p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Primary Public Contact Tags */
.primary-contact-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.primary-contact-box strong {
  color: #166534;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.primary-contact-box .contact-meta {
  color: #15803d;
  font-size: 0.78rem;
}

.btn-star {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-star.is-primary {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
  cursor: default;
}

.btn-star:hover:not(.is-primary) {
  background: #fde68a;
}

.modal-sm {
  max-width: 420px;
}

.mb-3 { margin-bottom: 1rem; }

.admin-impersonate-tool {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.imp-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ========================================================
   CREDENTIAL DISPLAY, REVEAL BUTTON & TRASH CAN STYLES
   ======================================================== */

.cred-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 170px;
}

.cred-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cred-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  min-width: 34px;
}

.cred-row code {
  background: #edf2f7;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--secondary);
}

.masked-pass {
  letter-spacing: 0.12em;
  font-weight: 600;
  min-width: 54px;
  display: inline-block;
  user-select: none;
}

.masked-pass.revealed {
  letter-spacing: normal;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1 !important;
  user-select: text;
}

.btn-reveal, .btn-copy {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-reveal:hover, .btn-copy:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-trash {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-trash:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.25);
}

/* Modal Confirm Deletion */
.modal-confirm {
  max-width: 460px;
}

.confirm-warning-box {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.confirm-message {
  font-size: 0.95rem;
  color: #991b1b;
  font-weight: 600;
  line-height: 1.5;
}

.text-danger {
  color: var(--accent-red);
}

/* ========================================================
   LOCATIONS & MAP VIEW STYLES
   ======================================================== */
.locations-container {
  display: grid;
  grid-template-columns: minmax(min(100%, 340px), 390px) 1fr;
  gap: 1.75rem;
  min-height: 650px;
  width: 100%;
  max-width: 1280px;
  margin: 1rem auto 0;
  box-sizing: border-box;
}

@media (max-width: 1050px) {
  .locations-container {
    grid-template-columns: 1fr;
    max-width: 820px;
    margin: 1rem auto 0;
  }
}

.locations-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 720px;
  box-shadow: var(--shadow-sm);
}

.locations-search-box input {
  font-size: 0.9rem;
}

.locations-search-status {
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 0.45rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-muted, #64748b);
}

.locations-filter-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.locations-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.25rem;
}

.loc-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.loc-card:hover {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.loc-card.is-selected {
  border-color: var(--primary);
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
}

.loc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.loc-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
}

.loc-card-address {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.loc-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.loc-card-btn {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  color: var(--primary);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.loc-card-btn:hover {
  text-decoration: underline;
}

.locations-map-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-height: 500px;
}

.public-locations-map {
  flex: 1;
  width: 100%;
  min-height: 580px;
}

/* ========================================================
   ADMIN SITE SETTINGS & OVERRIDES
   ======================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.settings-card-header h4 {
  font-size: 1.1rem;
  color: var(--secondary);
  font-weight: 700;
}

.setting-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-subgroup-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.setting-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
}

.setting-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.override-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.cta-buttons-dual {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.rescue-story-section {
  border: 1px dashed var(--border-strong);
}


