/* ── Sait Recycling ── Clean, modern logistics UI ─────────────────── */

:root {
  --bg: #f8fafc;
  --bg-gradient: #f8fafc;
  --sidebar-bg: #0b1120;
  --sidebar-bg-solid: #0b1120;
  --sidebar-ink: #94a3b8;
  --sidebar-active: #38bdf8;
  --sidebar-hover-bg: rgba(56, 189, 248, 0.08);
  --sidebar-active-bg: rgba(56, 189, 248, 0.12);
  --sidebar-border: rgba(148, 163, 184, 0.1);
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #94a3b8;
  --border: #e2e8f0;
  --surface: #ffffff;
  --bg-hover: #f1f5f9;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --card-shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.10);
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-gradient: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  --green: #6366f1;
  --green-light: #eef2ff;
  --green-dark: #4338ca;
  --green-gradient: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  --amber: #f59e0b;
  --amber-light: #fffbeb;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --red: #ef4444;
  --red-light: #fef2f2;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --sidebar-width: 250px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Page transitions ────────────────────────────────────────────── */
.login-shell {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.login-leaving .login-shell {
  opacity: 0;
  transform: scale(0.97);
}

.login-leaving #dotted-surface {
  transition: opacity 0.5s ease;
  opacity: 0;
}

.content-body > * { animation: fadeInUp 0.3s ease both; }
.content-body > *:nth-child(2) { animation-delay: 0.05s; }
.content-body > *:nth-child(3) { animation-delay: 0.1s; }
.content-body > *:nth-child(4) { animation-delay: 0.15s; }

/* ── Live indicator ──────────────────────────────────────────────── */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  background: var(--green-light);
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.3s ease;
}

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

.live-indicator.pulse {
  background: #dcfce7;
  border-color: var(--green);
  animation: glow 0.6s ease-out;
}

.header-spacer { flex: 1; }

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

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 14px;
  position: relative;
  z-index: 1;
}

/* ── Lamp effect ─────────────────────────────────────────────────── */
.lamp {
  position: relative;
  width: 100%;
  height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 2px;
}

.lamp-glow {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center bottom, rgba(56, 189, 248, 0.35) 0%, rgba(56, 189, 248, 0.1) 40%, transparent 70%);
  filter: blur(10px);
  animation: lamp-spread 1s 0.3s ease-out forwards;
}

.lamp-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #22d3ee, #38bdf8, transparent);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5), 0 0 20px rgba(56, 189, 248, 0.2);
  animation: lamp-line-grow 0.8s 0.3s ease-out forwards;
}

@keyframes lamp-spread {
  to { width: 200px; height: 40px; }
}

@keyframes lamp-line-grow {
  to { width: 140px; }
}

.sidebar-footer {
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: 148px;
  height: auto;
  display: block;
  filter: brightness(1.3);
}

.brand-text {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #e2e8f0;
}

.brand-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  animation: brand-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes brand-pop {
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  font-size: 32px;
  color: #fff;
  margin-bottom: 8px;
}


.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
}

.nav-spacer {
  height: 10px;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.msg-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Notification bell icon ─────────────────────────────────────── */
.notif-bell-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-bell {
  transform-origin: 20px 4px;
}

.notif-bell-wrap.ringing .notif-bell {
  animation: bell-ring 0.6s ease-out;
}

.notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
}

.notif-bell-wrap.has-notif .notif-dot {
  transform: scale(1);
  opacity: 1;
}

@keyframes bell-ring {
  0%   { transform: rotate(0deg); }
  10%  { transform: rotate(10deg); }
  20%  { transform: rotate(-10deg); }
  30%  { transform: rotate(8deg); }
  40%  { transform: rotate(-8deg); }
  50%  { transform: rotate(4deg); }
  60%  { transform: rotate(-3deg); }
  70%  { transform: rotate(1deg); }
  100% { transform: rotate(0deg); }
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item:hover::before { opacity: 1; }

.nav-item.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item.active::before { opacity: 1; }

.nav-item.active .nav-icon {
  color: #38bdf8;
}

.nav-icon {
  flex-shrink: 0;
  opacity: 0.5;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-item:hover .nav-icon {
  opacity: 1;
}

/* ── Sidebar Footer ─────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
}

.user-name {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: var(--sidebar-ink);
  font-size: 11px;
  text-transform: capitalize;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.sidebar-footer-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ── Dark mode toggle ──────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.theme-toggle:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-active);
}

.theme-toggle-icon {
  font-size: 15px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg) scale(1.1);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* ── Main Content ───────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 32px;
  min-height: 100vh;
}

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

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

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

.record-count {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

/* ── Dashboard Stat Cards ───────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-blue { background: var(--accent-light); color: var(--accent); }
.stat-icon-green { background: var(--green-light); color: var(--green-dark); }
.stat-icon-purple { background: var(--purple-light); color: var(--purple); }
.stat-icon-amber { background: var(--amber-light); color: var(--amber); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ── Empty State ────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-muted);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
  max-width: 320px;
}

/* ── Data Table ─────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

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

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.data-table th.text-right,
.data-table td.text-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-secondary);
}

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

.data-table tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.035);
}

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

.cell-primary {
  font-weight: 600;
  color: var(--ink);
}

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-amber { background: var(--amber-light); color: #92400e; }
.badge-blue { background: var(--accent-light); color: #1d4ed8; }
.badge-red { background: var(--red-light); color: #b91c1c; }

.has-tooltip {
  position: relative;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.has-tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%) translateX(4px);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  max-width: 280px;
  min-width: 120px;
  white-space: normal;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  line-height: 1.5;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.has-tooltip .tooltip-text::before {
  content: "Reason: ";
  font-weight: 700;
  opacity: 0.7;
}

.has-tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--ink);
}

.has-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Search Bar ─────────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card-bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ── Driver Cards ───────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

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

.driver-card:hover {
  box-shadow: var(--card-shadow-lg);
}

.driver-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.driver-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.driver-email {
  font-size: 13px;
  color: var(--ink-muted);
}

.driver-status {
  margin-left: auto;
}

/* ── Login Page ─────────────────────────────────────────────────────── */
#dotted-surface {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
#dotted-surface canvas {
  display: block;
  width: 100%;
  height: 100%;
}

body:has(#dotted-surface) {
  background: #000;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
  background: transparent;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.login-card .login-subtitle { color: rgba(255,255,255,0.45); }
.login-card .field-label { color: rgba(255,255,255,0.75); font-weight: 500; }
.login-card .field-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}
.login-card .field-input::placeholder { color: rgba(255,255,255,0.25); }
.login-card .field-input:focus {
  border-color: rgba(99,102,241,0.7);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
  background: rgba(255,255,255,0.08);
}
.login-card .form-error { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fca5a5; }

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

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  margin-bottom: 16px;
}

.login-logo {
  width: 180px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  filter: brightness(1.15);
}

.login-header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--ink-muted);
}
.sparkles-wrap {
  position: relative;
  width: 100%;
  height: 64px;
  margin: 2px 0 6px;
  overflow: hidden;
}
.sparkles-gradient-line {
  position: absolute;
  top: 0;
  height: 2px;
  pointer-events: none;
}
.line-1 {
  left: 10%;
  width: 60%;
  background: linear-gradient(to right, transparent, #6366f1, transparent);
  filter: blur(1px);
}
.line-2 {
  left: 10%;
  width: 60%;
  height: 1px;
  background: linear-gradient(to right, transparent, #6366f1, transparent);
  filter: none;
}
.line-3 {
  left: 35%;
  width: 30%;
  height: 4px;
  background: linear-gradient(to right, transparent, #0ea5e9, transparent);
  filter: blur(2px);
}
.line-4 {
  left: 35%;
  width: 30%;
  height: 1px;
  background: linear-gradient(to right, transparent, #0ea5e9, transparent);
}
#sparkles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#sparkles-canvas canvas {
  width: 100% !important;
  height: 100% !important;
}
.sparkles-mask {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 30%, rgba(0,0,0,0.52) 80%);
  pointer-events: none;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field-input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input::placeholder {
  color: var(--ink-muted);
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--red-light);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
}

.login-form .btn-primary {
  margin-top: 4px;
  padding: 12px;
}

/* ── Error Page ─────────────────────────────────────────────────────── */
.error-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.error-card {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.error-code {
  font-size: 64px;
  font-weight: 800;
  color: var(--ink-muted);
  letter-spacing: -0.04em;
}

.error-message {
  font-size: 15px;
  color: var(--ink-secondary);
  margin: 8px 0 24px;
}

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

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: toast-in 0.25s ease;
  min-width: 260px;
}

.toast.is-success { border-left: 3px solid var(--green); }
.toast.is-error { border-left: 3px solid var(--red); }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: all 0.3s ease; }

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

/* ── Status Toggle Button ───────────────────────────────────────────── */
.status-toggle {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.status-toggle:hover { opacity: 0.8; }
.status-toggle:disabled { opacity: 0.5; cursor: not-allowed; }

.status-active {
  background: var(--green-light);
  color: var(--green-dark);
}

.status-inactive {
  background: var(--red-light);
  color: #b91c1c;
}

/* ── Delete Button ──────────────────────────────────────────────────── */
.delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--transition);
}

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

.delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modal-in 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card-wide { max-width: 640px; }

/* ── Shop pricing grid ─────────────────────────────────────────────── */
.pricing-section {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pricing-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.pricing-section-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

/* ── Portal credentials section (Edit Client modal) ────────────────── */
.portal-section {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.portal-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.portal-row .field { flex: 1 1 200px; min-width: 0; }
.portal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.portal-revealed {
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.portal-revealed-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #166534;
}
.portal-revealed-value {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #166534;
}
.portal-swatches {
  display: flex;
  gap: 4px;
  align-items: center;
}
.portal-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: inline-block;
}
input.color-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}
.client-quick-access-btn {
  margin-right: 4px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.pricing-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pricing-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
}

.pricing-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 0 8px;
  transition: border-color 0.15s;
}

.pricing-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pricing-prefix, .pricing-suffix {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
}

.pricing-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 6px;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  width: 100%;
  min-width: 0;
}

/* Clickable shop rows */
.shop-row { cursor: pointer; transition: background 0.1s; }
.shop-row:hover { background: var(--bg); }

/* ── Client groups (shops page) ─────────────────────────────────────── */
.clients-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.client-card:hover { box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08); }
.client-card.open { border-color: var(--accent); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12); }

.client-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.client-header:hover { background: var(--bg); }

.client-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.client-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.client-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.client-logo-fallback {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.client-info { min-width: 0; }

.client-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.client-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 2px;
}

.client-toggle-icon {
  color: var(--ink-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.client-header-right {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.client-edit-btn {
  color: var(--ink-muted);
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.client-header:hover .client-edit-btn { opacity: 1; color: var(--ink); }
.modal-actions.modal-actions-split { justify-content: space-between; }
.modal-actions-group { display: flex; gap: 10px; }

.client-card.open .client-toggle-icon { transform: rotate(180deg); }

.client-shops {
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.client-shops .data-table { background: transparent; }

.client-shops-empty {
  padding: 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

.client-card-unassigned .client-logo-fallback { color: var(--ink-muted); }

.shop-avg-weight {
  font-weight: 700;
  color: var(--green-dark);
}
.shop-avg-count {
  font-size: 11px;
  color: var(--ink-muted);
}
.sparkline-cell {
  padding: 4px 8px;
  vertical-align: middle;
}
.sparkline-svg polyline {
  stroke: var(--accent);
}
html[data-theme="dark"] .sparkline-svg polyline {
  stroke: #66bb6a;
}
.shop-actions-cell {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Weight history modal */
.weights-history-stats {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.weight-stat {
  flex: 1;
  text-align: center;
}
.weight-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.weight-stat-val {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.weights-history-list { padding: 0 20px 20px; max-height: 60vh; overflow-y: auto; }
.weight-edit-input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
  font-family: inherit;
}
.weight-edit-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Round builder: per-stop weights section ──────────────────────── */
.builder-weights-section {
  grid-column: 1 / -1;
  margin-top: 16px;
}

.builder-total-cost {
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
}

.builder-weights-hint {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 4px 0 16px;
}

.builder-weights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stop-weight-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  overflow: hidden;
}

.stop-weight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.stop-weight-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.stop-weight-shop {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.stop-weight-cost {
  font-size: 15px;
  font-weight: 800;
  color: var(--green-dark, #15803d);
}

.stop-weight-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.stop-weight-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stop-weight-field.no-price { opacity: 0.55; }

.stop-weight-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
}

.stop-weight-rate {
  font-size: 10px;
  font-weight: 600;
  color: var(--green-dark, #15803d);
  text-transform: none;
  letter-spacing: 0;
}

.stop-weight-field input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  outline: none;
  width: 100%;
}

.stop-weight-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--ink);
}

.modal-form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.modal-actions-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
}

.modal-wide {
  max-width: 560px;
}

.modal-text {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ── Danger outline button ──────────────────────────────────────────── */
.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}

.btn-danger-outline:hover {
  background: var(--red-light);
}

/* ── Clickable cell ─────────────────────────────────────────────────── */
.clickable-cell {
  cursor: pointer;
}

.clickable-cell:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Text utilities ─────────────────────────────────────────────────── */
.text-danger { color: var(--red); font-weight: 600; }
.text-warning { color: var(--amber); font-weight: 600; }

/* ── Dashboard Live ─────────────────────────────────────────────────── */
.section-title-danger {
  color: var(--red);
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}

.alert-danger {
  background: var(--red-light);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.alert-danger svg { flex-shrink: 0; margin-top: 1px; }

.alert-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-text strong { font-size: 14px; }
.alert-text span { opacity: 0.8; }

.live-rounds-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

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

.live-round-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.live-round-driver {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.live-round-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.live-round-bar {
  flex: 1;
  display: flex;
  gap: 2px;
  height: 6px;
  min-width: 60px;
}

.live-round-seg {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--border);
  transition: background 0.3s;
}

.live-round-seg.live-seg-full { background: var(--green); }
.live-round-seg.live-seg-partial { background: var(--amber); }
.live-round-seg.live-seg-failed { background: var(--red); }
.live-round-seg.live-seg-pending { background: #cbd5e1; }

.live-round-status {
  white-space: nowrap;
}

/* ── Vehicle checklist history ──────────────────────────────────────── */
.vehicle-history-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.vehicle-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.vehicle-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

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

.vehicle-history-date {
  font-weight: 600;
  color: var(--ink);
  min-width: 90px;
}

.vehicle-history-driver {
  flex: 1;
  color: var(--ink-secondary);
  font-weight: 500;
}

/* ── Proof photo link ──────────────────────────────────────────────── */
.proof-photo-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  cursor: pointer;
  transition: color 0.15s;
}

.proof-photo-link:hover { color: var(--accent-dark); }

.proof-photo-count {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Reports dashboard ─────────────────────────────────────────────── */
/* AI brief — sits above the date controls. Hover popover stays clear
 * of the rest of the page until clicked. The wrap forms its own
 * stacking context (z-index: 100) so the absolutely-positioned
 * popover wins over the date-control row painted later in the DOM. */
.reports-brief-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
  z-index: 100;
  isolation: isolate;
}
.reports-brief-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.reports-brief-btn svg { display: block; }
.reports-brief-period {
  margin-left: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.reports-brief-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 540px;
  z-index: 1000;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  /* Respect the hidden attribute — display: flex below would
   * otherwise leave the (invisible) popover in the layout and block
   * clicks on the date controls beneath it. */
}
.reports-brief-popover[hidden] { display: none; }
.reports-brief-popover {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.reports-brief-popover.is-open { opacity: 1; transform: translateY(0); }
.reports-brief-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.reports-brief-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.reports-brief-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.reports-brief-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}
.reports-brief-spinner {
  text-align: center;
  padding: 28px 12px;
  color: var(--ink-muted);
  font-size: 13px;
}
.reports-brief-spinner small { color: var(--ink-muted); font-size: 11px; opacity: 0.7; }
.reports-brief-error { padding: 16px; color: #b91c1c; font-size: 13px; }
.reports-brief-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border);
}
.reports-brief-refresh {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink-muted);
  padding: 4px 10px;
  cursor: pointer;
}
.reports-brief-refresh:hover { color: var(--accent); border-color: var(--accent); }
.reports-brief-model {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  font-family: ui-monospace, monospace;
  opacity: 0.7;
}

.reports-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.reports-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink-secondary);
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.reports-range {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.reports-range-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reports-range-label span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.reports-range-label .field-input {
  padding: 8px 12px;
  font-size: 13px;
}

.reports-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.reports-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 180px;
}

.reports-filter span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.reports-filter .field-input {
  padding: 8px 12px;
  font-size: 13px;
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}

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

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}

.kpi-blue::before { background: #3b82f6; }
.kpi-purple::before { background: #8b5cf6; }
.kpi-amber::before { background: #f59e0b; }
.kpi-green::before { background: #22c55e; }
.kpi-red::before { background: #ef4444; }
.kpi-dark::before { background: #0f172a; }

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-blue .kpi-icon { background: #eff6ff; color: #3b82f6; }
.kpi-purple .kpi-icon { background: #f5f3ff; color: #8b5cf6; }
.kpi-amber .kpi-icon { background: #fffbeb; color: #f59e0b; }
.kpi-green .kpi-icon { background: #f0fdf4; color: #22c55e; }
.kpi-red .kpi-icon { background: #fef2f2; color: #ef4444; }
.kpi-dark .kpi-icon { background: #f1f5f9; color: #0f172a; }

.kpi-body { flex: 1; min-width: 0; }

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}

.kpi-sub {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Reports rows */
.reports-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 1024px) {
  .reports-row { grid-template-columns: 1fr; }
}

.reports-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}

.reports-card .reports-table-wrap {
  margin: 0 -22px -20px;
  border-top: 1px solid var(--border);
}

.reports-card .data-table th:first-child,
.reports-card .data-table td:first-child {
  padding-left: 22px;
}

.reports-card .data-table th:last-child,
.reports-card .data-table td:last-child {
  padding-right: 22px;
}

.reports-card .data-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.reports-card .data-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.reports-card-wide { /* used inside reports-row */ }

.chart-box {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-box-sm { height: 220px; }

.chart-box canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* Vanilla SVG dual-line daily-trend chart — matches the charity
 * portal's tonnage trend look. Kg series is blue with a soft area
 * fill; £ revenue series is green line-only. Latest point on each
 * series gets a pulsing ring (SVG <animate>). */
.rep-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  font-family: inherit;
}
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink-muted);
  font-size: 13px;
}
.rep-chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.rep-chart-axis {
  fill: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
}
.rep-chart-axis-l { fill: #3b82f6; }
.rep-chart-axis-r { fill: #16a34a; }
.rep-chart-line.is-kg   { stroke: #3b82f6; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.rep-chart-line.is-cost { stroke: #16a34a; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.rep-chart-pt.is-kg circle:not(.rep-chart-ping)   { fill: var(--card-bg); stroke: #3b82f6; stroke-width: 2.5; transition: r 0.15s; }
.rep-chart-pt.is-cost circle:not(.rep-chart-ping) { fill: var(--card-bg); stroke: #16a34a; stroke-width: 2.5; transition: r 0.15s; }
.rep-chart-pt.is-latest.is-kg circle:not(.rep-chart-ping)   { fill: #3b82f6; }
.rep-chart-pt.is-latest.is-cost circle:not(.rep-chart-ping) { fill: #16a34a; }
.rep-chart-pt:hover circle:not(.rep-chart-ping) { r: 5.5; }
.rep-chart-ping.is-kg   { stroke: #3b82f6; stroke-width: 1.5; pointer-events: none; }
.rep-chart-ping.is-cost { stroke: #16a34a; stroke-width: 1.5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .rep-chart-ping { display: none; }
}

/* ── Chart hover crosshair + tooltip (shared) ────────────────────
 * Used by both /reports and /client (via SaitChart.setupHover).
 * Crosshair is a dashed vertical line that snaps to the nearest
 * data index. Tooltip is an absolutely-positioned card with the
 * label + each series' value, floating above the topmost point. */
.sait-chart-crosshair {
  stroke: var(--ink-muted, #64748b);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.55;
  pointer-events: none;
}
.sait-chart-active {
  pointer-events: none;
}
.sait-chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  display: none;
  min-width: 130px;
  padding: 10px 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14), 0 1px 2px rgba(15, 23, 42, 0.06);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink, #0f172a);
  font-variant-numeric: tabular-nums;
}
.sait-chart-tooltip-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted, #64748b);
  margin-bottom: 6px;
}
.sait-chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.sait-chart-tooltip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.sait-chart-tooltip-name {
  color: var(--ink-muted, #64748b);
  flex: 1;
  font-weight: 500;
}
.sait-chart-tooltip-val {
  font-weight: 700;
  color: var(--ink, #0f172a);
}

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

.reports-card-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.muted-hint {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

.legend-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 500;
}

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

.legend-dot-blue { background: #3b82f6; }
.legend-dot-green { background: #22c55e; }

.reports-table-wrap { overflow-x: auto; }

.text-right { text-align: right; }

/* ── Account 2FA ──────────────────────────────────────────────────── */
.account-2fa-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.account-2fa-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--card-shadow);
}

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

.account-2fa-header h2 {
  font-size: 20px;
  font-weight: 800;
}

.account-2fa-text {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-bottom: 18px;
  line-height: 1.5;
}

.account-2fa-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.account-2fa-form .field-input {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.1em;
  font-size: 18px;
  text-align: center;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.setup-step {
  display: flex;
  gap: 16px;
}

.setup-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.setup-step-body { flex: 1; min-width: 0; }

.setup-step-body h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.setup-step-body p {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.qr-wrap {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}

.qr-wrap img {
  display: block;
  width: 200px;
  height: 200px;
}

.setup-step details {
  font-size: 13px;
}

.setup-step summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  user-select: none;
}

.secret-code {
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--ink);
}

.login-back {
  display: block;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-top: 12px;
  text-decoration: none;
}

.login-back:hover { color: #38bdf8; }

/* ── Van Checks page ─────────────────────────────────────────────── */
.van-checks-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 20px;
}
.van-checks-filters .filter-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.van-checks-filters .field-input { min-width: 130px; }

.van-checks-table-wrap { overflow-x: auto; padding: 0; }
.van-checks-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.van-checks-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.van-checks-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.van-checks-table tr:hover td { background: var(--bg-hover); }
.row-has-fail td { background: #fef2f2; }
.row-has-fail:hover td { background: #fee2e2; }

.badge-pass { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #f0fdf4; color: #15803d; }
.badge-fail { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #fef2f2; color: #b91c1c; }
.badge-warn { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #fffbeb; color: #92400e; }

.defect-text { max-width: 250px; font-size: 12px; color: var(--ink-secondary); }

.van-checks-detail-title { font-size: 15px; font-weight: 700; margin: 24px 0 12px; }

.van-check-detail { margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg); }
.van-check-detail summary { padding: 12px 16px; cursor: pointer; font-size: 14px; list-style: none; }
.van-check-detail summary::-webkit-details-marker { display: none; }
.van-check-detail summary::before { content: '▸ '; color: var(--ink-muted); }
.van-check-detail[open] summary::before { content: '▾ '; }
.van-check-detail .detail-meta { color: var(--ink-muted); font-weight: 400; font-size: 13px; }

.detail-body { padding: 0 16px 16px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th { text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--border); }
.detail-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-transform: capitalize; }

.detail-defect-status { margin-top: 12px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.detail-defect-status.status-pass { background: #f0fdf4; color: #15803d; }
.detail-defect-status.status-fail { background: #fef2f2; color: #b91c1c; }

.btn-delete-check {
  border: none; background: none; color: var(--ink-muted); font-size: 18px; font-weight: 700;
  cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.btn-delete-check:hover { background: #fef2f2; color: #b91c1c; }

/* ── Feature Requests ─────────────────────────────────────────────── */
.fr-form-row { display: flex; gap: 12px; }
.fr-form-row .field { flex: 1; }
.fr-form-row .field:last-child { max-width: 140px; }

.fr-card { margin-bottom: 12px; }
.fr-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fr-card-left { display: flex; align-items: center; gap: 10px; }
.fr-title { font-size: 15px; }
.fr-desc { font-size: 13px; color: var(--ink-secondary); margin-bottom: 8px; }
.fr-meta { font-size: 12px; color: var(--ink-muted); display: flex; gap: 6px; }

.fr-priority { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.fr-pri-low { background: #f1f5f9; color: #64748b; }
.fr-pri-normal { background: #eff6ff; color: #2563eb; }
.fr-pri-high { background: #fef2f2; color: #dc2626; }

.fr-status { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: #f1f5f9; color: #64748b; }
.fr-pending .fr-status { background: #fffbeb; color: #92400e; }
.fr-reviewing .fr-status { background: #eff6ff; color: #2563eb; }
.fr-planned .fr-status { background: #f0fdf4; color: #15803d; }
.fr-done .fr-status { background: #f0fdf4; color: #15803d; }
.fr-declined .fr-status { background: #fef2f2; color: #b91c1c; }
.fr-done { opacity: 0.6; }
.fr-declined { opacity: 0.5; }

.fr-admin { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.fr-admin-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.fr-status-select { width: 130px; }
.fr-notes-input { flex: 1; }
.fr-notes { font-size: 13px; color: var(--ink-secondary); }

.section-title-sm { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

/* ── Users management page ────────────────────────────────────────── */
.users-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.users-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
}

.users-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.users-online-icon {
  background: var(--green-light);
}

.users-online-icon .live-dot {
  width: 12px;
  height: 12px;
}

.users-total-icon {
  background: var(--accent-light);
  color: var(--accent);
}

.users-summary-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.users-summary-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}

.users-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.users-table { background: transparent; margin: 0; }

.users-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.user-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  animation: pulse-dot 1.6s ease-in-out infinite;
  vertical-align: middle;
}

.role-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-admin { background: #fef3c7; color: #92400e; }
.role-manager { background: #dbeafe; color: #1d4ed8; }

.modal-text {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.modal-text strong { color: var(--ink); }

/* ── Photo lightbox ───────────────────────────────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.photo-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox-img { display: block; }
.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
}
.photo-lightbox-nav:hover { background: rgba(0, 0, 0, 0.8); }
.photo-lightbox-prev { left: -64px; }
.photo-lightbox-next { right: -64px; }
.photo-lightbox-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .photo-lightbox-prev { left: 8px; }
  .photo-lightbox-next { right: 8px; }
}

/* ── Map page layout ───────────────────────────────────────────────── */
.map-page-wrap {
  display: flex;
  gap: 0;
  height: calc(100vh - 120px);
}

.map-page-wrap .map-fullpage {
  flex: 1;
  height: 100%;
}

.map-legend {
  width: 240px;
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.map-legend-header h3 {
  font-size: 14px;
  font-weight: 700;
}

.map-legend-toggle {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.map-legend-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}

.map-legend-item:hover { background: var(--bg); }
.map-legend-item.focused { background: #eff6ff; }
.map-legend-item.dimmed { opacity: 0.35; }

.map-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.map-legend-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.map-legend-sub {
  font-size: 11px;
  color: var(--ink-muted);
}

.map-legend-eye {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.map-legend-item.hidden-route .map-legend-eye { color: var(--border); }
.map-legend-item.hidden-route .map-legend-label { text-decoration: line-through; opacity: 0.4; }
.map-legend-item.hidden-route .map-legend-color { opacity: 0.3; }

.map-legend-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.map-key-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.map-key-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── Map tabs (Clients / Bins) ──────────────────────────────────── */
.map-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
}
.map-tab {
  padding: 8px 18px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted, #64748b);
  cursor: pointer;
  transition: 0.15s;
}
.map-tab[data-active="true"] {
  background: var(--ink, #0f172a);
  color: #fff;
}
.map-tab:not([data-active="true"]):hover { color: var(--ink, #0f172a); }
.map-view[hidden] { display: none; }

/* Bins legend / edit panel */
.bins-add-btn {
  background: var(--accent, #3b82f6);
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.bins-add-btn:hover { filter: brightness(1.05); }

.bins-summary {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bins-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--ink-muted, #64748b);
}
.bins-summary-row strong {
  color: var(--ink, #0f172a);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.bins-summary-error {
  color: #b91c1c;
  font-size: 12px;
  text-align: center;
}

.bins-edit-panel {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}
.bins-edit-panel[hidden] { display: none; }
.bins-edit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.bins-edit-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bins-panel-close {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-muted, #64748b);
}
.bins-panel-close:hover { color: var(--ink, #0f172a); }

.bins-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bins-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bins-field span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--ink-muted, #64748b);
}
.bins-field input,
.bins-field select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--ink, #0f172a);
}
.bins-field input:focus,
.bins-field select:focus { outline: none; border-color: var(--accent, #3b82f6); }
.bins-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bins-form-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.bins-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.bins-form-actions-right { display: flex; gap: 6px; }

/* ── Fullpage Map ───────────────────────────────────────────────────── */
.map-fullpage {
  height: calc(100vh - 120px);
}

/* ── Rounds page (revamped) ───────────────────────────────────────── */
.rounds-layout { display: block; }

/* Weather pill in date nav */
.weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-left: auto;
}
.weather-icon { display: inline-flex; align-items: center; }
.weather-icon svg { width: 24px; height: 24px; }
.weather-temps { font-weight: 700; color: var(--ink); }
.weather-label { color: var(--ink-muted); }
.weather-precip { color: #3b82f6; }
.weather-loading { font-size: 12px; color: var(--ink-muted); }

/* ── Animated weather icons ─────────────────────────────────────── */
.wi { overflow: visible; }

/* Sun — slow spin on rays */
.wi-rays { animation: wi-spin 12s linear infinite; transform-origin: 20px 20px; }
@keyframes wi-spin { to { transform: rotate(360deg); } }

/* Cloud — gentle horizontal drift */
.wi-cloud-drift { animation: wi-drift 4s ease-in-out infinite; }
@keyframes wi-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

/* Sun behind cloud — smaller sun also pulses */
.wi-small-sun { animation: wi-pulse 3s ease-in-out infinite; }
.wi-rays-sm { animation: wi-spin 10s linear infinite; transform-origin: 16px 14px; }
@keyframes wi-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* Rain drops — fall loop */
.wi-rain-drops { animation: wi-fall 0.8s linear infinite; }
@keyframes wi-fall { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(5px); opacity: 0; } }

/* Snowflakes — gentle drift down */
.wi-snowflakes { animation: wi-snow-fall 2s ease-in-out infinite; }
@keyframes wi-snow-fall { 0%, 100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(3px) translateX(2px); } }

/* Fog — fade lines */
.wi-fog-lines line:nth-child(1) { animation: wi-fog 3s ease-in-out infinite; }
.wi-fog-lines line:nth-child(2) { animation: wi-fog 3s ease-in-out 0.5s infinite; }
.wi-fog-lines line:nth-child(3) { animation: wi-fog 3s ease-in-out 1s infinite; }
@keyframes wi-fog { 0%, 100% { opacity: 0.5; transform: translateX(0); } 50% { opacity: 1; transform: translateX(3px); } }

/* Lightning bolt — flash */
.wi-bolt { animation: wi-flash 2s ease-in-out infinite; }
@keyframes wi-flash { 0%, 40%, 60%, 100% { opacity: 1; } 50% { opacity: 0.2; } 55% { opacity: 1; } }

/* Conflicts banner */
.conflicts-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  margin-bottom: 16px;
}
.conflicts-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b91c1c;
  font-size: 14px;
}
.conflicts-list {
  list-style: none;
  padding-left: 26px;
  font-size: 13px;
  color: #7f1d1d;
}
.conflicts-list li { padding: 2px 0; }

/* Bulk action bar */
.bulk-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  margin-bottom: 16px;
}
.bulk-bar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}
.bulk-bar-info input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
}
.bulk-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bulk-bar .field-input-sm {
  background: #1e293b;
  color: #fff;
  border-color: #334155;
  padding: 8px 12px;
  font-size: 13px;
}
.bulk-dropdown {
  position: relative;
}
.bulk-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  min-width: 200px;
  padding: 6px;
  z-index: 40;
}
.bulk-dropdown-menu.open { display: block; }
.bulk-menu-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border-radius: 6px;
}
.bulk-menu-item:hover { background: var(--bg); color: var(--accent); }
.bulk-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.bulk-menu-custom {
  display: flex;
  gap: 6px;
  padding: 4px;
}
.bulk-menu-custom input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
}

/* Round cards grid */
.rounds-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.round-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
}
.round-card.dragging { opacity: 0.4; }

.round-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 10px;
}

.round-card-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.round-card-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.round-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.round-number {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.round-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 12px;
}
.status-completed { background: #f0fdf4; color: #15803d; }
.status-progress { background: #fffbeb; color: #92400e; }
.status-planned { background: #eff6ff; color: #1d4ed8; }

.warn-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.warn-chip-amber { background: #fffbeb; color: #92400e; }
.warn-chip-grey { background: #f1f5f9; color: #475569; }

.round-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

/* Inline weighbridge entry on the round card actions row */
.wb-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-right: 4px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.wb-inline.is-saving { opacity: 0.7; }
.wb-inline.is-saved {
  background: #dcfce7;
  border-color: #86efac;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}
.wb-inline-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  white-space: nowrap;
}
.wb-inline-input {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  width: 70px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  outline: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.wb-inline-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.wb-inline-input::-webkit-outer-spin-button,
.wb-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.wb-inline-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #16a34a;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.wb-inline-save:hover { background: #15803d; }
.wb-inline-save:disabled { opacity: 0.5; cursor: not-allowed; }

.round-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 4px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.round-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.round-meta-item svg { color: var(--ink-muted); }

.round-second {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Stats row */
.round-card-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  padding: 14px 18px;
}

.round-stat { min-width: 0; }

.round-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.round-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-stat-value.pos { color: var(--green); }
.round-stat-value.neg { color: var(--red); }

@media (max-width: 768px) {
  .round-card-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* Segmented progress bar */
.round-progress-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  margin: 0 18px 14px;
}

.round-progress-seg {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--border);
}
.round-progress-seg.seg-full { background: var(--green); }
.round-progress-seg.seg-partial { background: var(--amber); }
.round-progress-seg.seg-failed { background: var(--red); }
.round-progress-seg.seg-pending { background: #cbd5e1; }

/* Collapsed body — hidden by default */
.round-card-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg);
}

.round-card-body > * {
  overflow: hidden;
}

.round-card.expanded .round-card-body {
  grid-template-rows: 1fr;
  border-top: 1px solid var(--border);
}

.round-card-body-inner {
  padding: 14px 18px;
}

.round-card-body .data-table { background: transparent; }

.rounds-main { min-width: 0; }

.date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.date-nav-arrow {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--ink-secondary);
  text-decoration: none;
  transition: all var(--transition);
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.date-nav-arrow:hover { background: var(--bg); color: var(--ink); }

.date-display {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}

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

.btn-danger-sm {
  padding: 6px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-danger-sm:hover { background: var(--red-light); }

.btn-map-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-map-sm:hover { background: var(--accent-hover); }

.calendar-strip {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--card-shadow);
}

.calendar-header-row {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.calendar-header-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.calendar-week:last-child {
  border-bottom: none;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 56px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  border-right: 1px solid var(--border);
}

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

.calendar-day:hover { background: var(--accent-light); color: var(--accent); }

/* ── Calendar day dots (round indicators) ──────────────────────── */
.calendar-day-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 4px;
}

.calendar-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dot-planned   { background: var(--ink-muted); }
.dot-progress  { background: var(--amber); }
.dot-completed { background: var(--green); }

/* ── Calendar day hover preview tooltip ────────────────────────── */
.calendar-day {
  overflow: visible !important;
}

/* Open to the side of the cell (not above) so a day with many rounds
   never overflows off the top of the viewport. Capped height + internal
   scroll handles the rare day with 10+ rounds. pointer-events: auto
   (not none) so the cursor can move onto the popover to scroll — the
   popover is a descendant of .calendar-day, so hovering it keeps the
   :hover state live. A transparent ::before bridges the 8px gap. */
.calendar-day-preview {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%) translateX(-4px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow-lg);
  padding: 10px 12px;
  min-width: 220px;
  max-width: 280px;
  max-height: min(460px, 80vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

/* Invisible bridge across the 8px gap so moving cursor cell → popover
   doesn't break the :hover chain. */
.calendar-day-preview::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10px;
  width: 10px;
}

.calendar-day:hover .calendar-day-preview,
.calendar-day-preview:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

/* Flip to the left of the cell for the last two columns (Sat / Sun) so
   we don't clip off the right edge of the page. */
.calendar-week .calendar-day:nth-child(6) .calendar-day-preview,
.calendar-week .calendar-day:nth-child(7) .calendar-day-preview {
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(-50%) translateX(4px);
}
.calendar-week .calendar-day:nth-child(6) .calendar-day-preview::before,
.calendar-week .calendar-day:nth-child(7) .calendar-day-preview::before {
  left: auto;
  right: -10px;
}
.calendar-week .calendar-day:nth-child(6):hover .calendar-day-preview,
.calendar-week .calendar-day:nth-child(7):hover .calendar-day-preview,
.calendar-week .calendar-day:nth-child(6) .calendar-day-preview:hover,
.calendar-week .calendar-day:nth-child(7) .calendar-day-preview:hover {
  transform: translateY(-50%) translateX(0);
}

.cdp-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.cdp-round {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  flex-wrap: wrap;
}

.cdp-num {
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
}

.cdp-driver {
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}

.cdp-status {
  font-size: 10px;
  border-radius: 20px;
  padding: 1px 6px;
  font-weight: 600;
  text-transform: capitalize;
}

.cdp-planned  { background: var(--border); color: var(--ink-muted); }
.cdp-progress { background: var(--amber-light); color: #92400e; }
.cdp-done     { background: var(--green-light); color: var(--green-dark); }

.cdp-stops {
  font-size: 10px;
  color: var(--ink-muted);
  width: 100%;
}

.calendar-day-num {
  line-height: 1;
  font-weight: 600;
}

.calendar-day-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 3px;
  line-height: 1;
  color: var(--ink-muted);
}

.calendar-day-muted { color: var(--ink-muted); opacity: 0.4; }
.calendar-day-muted .calendar-day-label { opacity: 0.6; }
.calendar-day-muted:hover { opacity: 0.7; }

.calendar-day-today {
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--green);
}

.calendar-day-today .calendar-day-label { color: var(--green-dark); }

.calendar-day-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.calendar-day-selected .calendar-day-num { font-weight: 800; }
.calendar-day-selected .calendar-day-label { color: rgba(255, 255, 255, 0.75); }
.calendar-day-selected:hover { background: var(--accent-hover); color: #fff; }

/* ── Round card ─────────────────────────────────────────────────────── */
.round-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}

.round-card.dragging {
  opacity: 0.5;
}

.round-card-header {
  cursor: grab;
}

.round-card-header:active {
  cursor: grabbing;
}

.calendar-day.drag-over {
  background: var(--accent-light) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.round-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.round-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.round-driver {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.round-second {
  font-weight: 500;
  color: var(--ink-muted);
  font-size: 13px;
}

.round-van {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.round-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.round-stops { overflow-x: auto; }

.compact-table th,
.compact-table td {
  padding: 8px 12px;
  font-size: 13px;
}

.cell-muted { color: var(--ink-muted); font-weight: 500; }

.badge-muted {
  background: var(--bg);
  color: var(--ink-muted);
}

.round-costs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.cost-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--card-bg);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.cost-total {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: auto;
}

/* ── Missed shops sidebar ───────────────────────────────────────────── */
.rounds-sidebar { min-width: 0; }

.sidebar-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

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

.sidebar-panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.sidebar-panel-body {
  padding: 12px 16px;
  max-height: 500px;
  overflow-y: auto;
}

.missed-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.missed-item {
  font-size: 13px;
  color: var(--ink-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

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

.text-muted { color: var(--ink-muted); font-size: 13px; }

/* ── Round Builder ──────────────────────────────────────────────────── */
/* Compact topbar frees the middle column — driver + vehicle + save live
   here so shops (left) + route (right) can use the whole page width. */
.builder-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.builder-topbar-title { min-width: 0; }

.builder-topbar-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

.builder-topbar-fields {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex-direction: row;
  min-width: 0;
}

.field-inline .field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
  margin: 0;
}

.field-inline .field-input {
  padding: 6px 10px;
  font-size: 13px;
  min-width: 160px;
  max-width: 260px;
}

.builder-topbar-actions {
  display: flex;
  gap: 8px;
}

.builder-topbar-actions .btn {
  padding: 8px 16px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .builder-topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .builder-topbar-actions { justify-content: flex-end; }
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .builder-layout { grid-template-columns: 1fr; }
}

.builder-shops {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.builder-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* Inline tab toggle inside the picker panel header */
.builder-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.builder-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted, #64748b);
  cursor: pointer;
  transition: 0.12s;
}
.builder-tab[data-active="true"] {
  background: var(--card-bg);
  color: var(--ink, #0f172a);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.builder-tab:not([data-active="true"]):hover { color: var(--ink, #0f172a); }
.builder-tab-content[hidden] { display: none; }

/* Bin list group headers (Street / Leisure) */
.bin-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 4px;
  margin-top: 4px;
}
.bin-group-header:first-child { margin-top: 0; }
.bin-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted, #64748b);
}
.bin-group-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted, #64748b);
  background: var(--bg, #f8fafc);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

/* Bin chip + accents */
.bin-type-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.bin-type-chip.bin-type-street { background: #e0f2fe; color: #075985; }
.bin-type-chip.bin-type-leisure { background: #f3e8ff; color: #6b21a8; }
.bin-pick-desc {
  color: var(--ink-muted, #64748b);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}
.route-stop-bin {
  border-left: 3px solid #0ea5e9;
  padding-left: 6px;
}
.stop-weight-card.is-bin-stop {
  border-left: 3px solid #0ea5e9;
}
.stop-weight-cost-bin { color: var(--ink-muted, #64748b); font-style: italic; }

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

.builder-panel-header h3 {
  font-size: 14px;
  font-weight: 700;
}

.builder-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.search-compact {
  padding: 8px 12px 8px 12px;
  font-size: 13px;
}

.builder-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.builder-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
}

.builder-actions .btn { flex: 1; }

.date-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
}

/* Shop picker list */
.shop-pick-list {
  max-height: 640px;
  overflow-y: auto;
}

.shop-pick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.shop-pick-item:hover { background: var(--accent-light); }
.shop-pick-item:last-child { border-bottom: none; }

.shop-pick-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-pick-add {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.shop-pick-add:hover { background: var(--accent-hover); }

/* ── Needs Attention panel ────────────────────────────────────────── */
.attention-panel {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.04), rgba(245, 158, 11, 0.04));
}

.attention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b91c1c;
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.06);
}

.attention-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.attention-count {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0;
}

.attention-search {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.12);
  background: rgba(239, 68, 68, 0.03);
}

.attention-search .search-input {
  width: 100%;
  padding: 7px 11px;
  font-size: 13px;
  background: var(--card-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
}

.attention-search .search-input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.attention-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attention-list-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-secondary);
  opacity: 0.7;
}

.attention-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px 10px 8px 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.attention-card:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.attention-card-bar {
  width: 4px;
  flex-shrink: 0;
  border-radius: 2px;
  align-self: stretch;
}

.attention-failed {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.04);
}
.attention-failed .attention-card-bar { background: #ef4444; }

.attention-partial {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.04);
}
.attention-partial .attention-card-bar { background: #f59e0b; }

.attention-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.attention-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
  flex: 1;
  /* Allow up to 2 lines for long shop names instead of truncating. */
  word-break: break-word;
  line-height: 1.25;
}

.attention-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.attention-card-streak {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: #7f1d1d;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
  animation: attention-streak-pulse 2.4s ease-in-out infinite;
}

@keyframes attention-streak-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.28); }
}

.attention-card.is-repeat-miss {
  border-color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
}

.attention-card.is-repeat-miss .attention-card-bar {
  background: #b91c1c;
  width: 5px;
}

.attention-card-pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.attention-pill-failed { background: #ef4444; color: #fff; }
.attention-pill-partial { background: #f59e0b; color: #fff; }

.attention-card-reason {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.attention-card-meta {
  font-size: 11px;
  color: var(--ink-secondary);
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.attention-card-meta-sep { opacity: 0.5; }

.attention-card-add {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), opacity var(--transition);
  color: #fff;
}

.attention-failed .attention-card-add { background: #ef4444; }
.attention-failed .attention-card-add:hover:not(:disabled) { background: #dc2626; }
.attention-partial .attention-card-add { background: #f59e0b; }
.attention-partial .attention-card-add:hover:not(:disabled) { background: #d97706; }

.attention-card-add:disabled {
  background: #94a3b8;
  cursor: default;
}

.attention-card-added {
  opacity: 0.6;
}

/* Costs section */
.costs-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.costs-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}

.costs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-compact .field-label { font-size: 11px; }
.field-compact .field-input { padding: 7px 10px; font-size: 13px; }

/* Route list */
.route-list {
  min-height: 100px;
}

.route-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-muted);
}

.route-empty svg { margin-bottom: 10px; opacity: 0.3; }
.route-empty p { font-size: 13px; }

.route-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.route-stop:hover { background: rgba(59, 130, 246, 0.03); }
.route-stop:last-child { border-bottom: none; }

.route-stop-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-stop-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-stop-weight {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.route-stop-weight-none {
  color: var(--ink-muted);
  font-weight: 500;
  font-style: italic;
}

.route-weight-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.route-weight-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.route-weight-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

.route-weight-value.weight-warn { color: var(--amber); }
.route-weight-value.weight-over { color: var(--red); }

.shop-pick-avg {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 8px;
}

.route-stop-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.route-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.route-btn:hover { background: var(--bg); color: var(--ink); }
.route-btn:disabled { opacity: 0.25; cursor: default; }
.route-btn:disabled:hover { background: transparent; }

.route-btn-remove:hover {
  background: var(--red-light);
  color: var(--red);
}

/* ── Round Map Layout ───────────────────────────────────────────────── */
.round-map-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .round-map-layout {
    grid-template-columns: 1fr;
  }
  .round-map-layout .map-fullpage { height: 400px; }
}

.round-map-sidebar { min-width: 0; }

.round-driver-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.stop-list {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.stop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.stop-item:hover { background: var(--accent-light); }
.stop-item:last-child { border-bottom: none; }

.stop-item[data-collected="true"] { background: rgba(34, 197, 94, 0.04); }

.stop-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.stop-num {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.stop-pending { background: var(--red); }
.stop-collected { background: var(--green); }

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

.stop-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-address {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-toggle-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.stop-toggle-btn:hover { background: var(--red); color: #fff; }
.stop-toggle-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.stop-toggle-done {
  background: var(--green-light);
  color: var(--green);
}

.stop-toggle-done:hover { background: var(--green); color: #fff; }

/* ── View Toggle ────────────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-btn {
  padding: 7px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.view-btn:hover {
  color: var(--ink);
}

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

/* ── Map Container ──────────────────────────────────────────────────── */
.map-container {
  width: 100%;
  height: calc(100vh - 180px);
  min-height: 500px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }

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

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

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

  .stat-value {
    font-size: 22px;
  }

  /* Mobile hamburger button */
  .mobile-menu-btn {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 150;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    color: var(--ink);
  }

  .page-title {
    margin-left: 48px;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
  display: none;
}

.sidebar-overlay.visible {
  display: block;
}

/* ── Messages ────────────────────────────────────────────────────────── */
.messages-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.messages-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}

.messages-sidebar-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.messages-sidebar-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.contact-item:hover { background: var(--bg-hover); }
.contact-item.contact-active { background: var(--accent-light); }

.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.contact-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-preview {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-time {
  font-size: 11px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.contact-unread {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.contact-section-label {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.messages-thread {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.thread-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-muted);
}

.thread-empty-state svg { opacity: 0.3; }
.thread-empty-state p { font-size: 14px; margin: 0; }

.thread-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.thread-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-row {
  display: flex;
}

.msg-out { justify-content: flex-end; }
.msg-in { justify-content: flex-start; }

.msg-bubble {
  max-width: 68%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.msg-out .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-in .msg-bubble {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-body { word-break: break-word; white-space: pre-wrap; }

.msg-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

.msg-in .msg-time { text-align: left; }

.thread-compose {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.compose-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
  transition: border-color var(--transition);
  min-height: 36px;
  max-height: 120px;
  overflow-y: auto;
}

.compose-input:focus { outline: none; border-color: var(--accent); }

.msgs-empty, .msgs-loading {
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  padding: 30px;
}

@media (max-width: 700px) {
  .messages-shell { grid-template-columns: 1fr; }
  .messages-sidebar { display: none; }
  .messages-shell.sidebar-open .messages-sidebar { display: flex; }
  .messages-shell.sidebar-open .messages-thread { display: none; }
}

/* ── Storage Management ───────────────────────────────────────────── */
.storage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.storage-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.storage-stat-card.storage-stat-warn {
  border-color: #f59e0b;
  background: #fffbeb;
}

.storage-stat-label {
  font-size: 12px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.storage-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

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

.storage-filters .field-input {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.storage-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
}

.storage-toggle input { cursor: pointer; }

.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.storage-loading, .storage-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-muted);
  padding: 40px;
  font-size: 14px;
}

.storage-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.storage-item.storage-item-old {
  border-color: #f59e0b;
}

.storage-thumb-wrap {
  position: relative;
}

.storage-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.storage-old-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  padding: 2px 6px;
}

.storage-item-info {
  padding: 8px 10px;
}

.storage-item-date {
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.storage-item-size {
  font-size: 11px;
  color: var(--ink-muted);
}

.storage-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.55);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.storage-item:hover .storage-delete-btn { opacity: 1; }
.storage-delete-btn:hover { background: var(--red); }

/* ── Holiday Calendar (Manager) ──────────────────────────────────── */
.hol-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.hol-cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hol-month-label {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}

.hol-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.hol-cal-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 4px 0 8px;
  text-transform: uppercase;
}

.hol-cal-cell {
  min-height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.hol-cal-cell:hover { background: var(--bg); }
.hol-cal-empty-cell { background: transparent; border: none; cursor: default; }
.hol-cal-past { opacity: 0.45; }
.hol-cal-today { border-color: var(--accent); }

.hol-cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.hol-cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

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

.hol-dot-approved { background: #22c55e; }
.hol-dot-pending  { background: #f59e0b; }
.hol-dot-rejected { background: #ef4444; }

.hol-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

.hol-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}

.hol-request-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.hol-request-driver {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.hol-request-dates {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 4px;
}

.hol-request-meta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.hol-request-actions {
  display: flex;
  gap: 8px;
}

.hol-empty, .hol-loading {
  color: var(--ink-muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

@media (max-width: 900px) {
  .hol-layout { grid-template-columns: 1fr; }
}

/* ── Holiday calendar tooltip + day modal ──────────────────────── */
.hol-calendar-col { position: relative; }

/* Names-only hover preview — pointer-events:none guarantees zero
   flicker (cursor literally cannot enter the tooltip). */
.hol-day-tooltip {
  position: absolute;
  z-index: 50;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-line;
  max-width: 240px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}
.hol-day-tooltip[hidden] { display: none; }

/* Day-detail modal — opened by clicking a calendar cell. */
.hol-modal-wide { max-width: 520px; }
.hol-day-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.hol-day-modal-header .hol-modal-title { margin: 0; }
.hol-day-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink-muted);
  cursor: pointer;
}
.hol-day-modal-close:hover { color: var(--ink); border-color: var(--ink-muted); }
.hol-day-modal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
}
.hol-day-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hol-day-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hol-day-actions { display: flex; gap: 8px; }
.hol-day-reject {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.hol-day-reject[hidden] { display: none; }
.hol-day-reject-input {
  flex: 1;
  min-width: 140px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.hol-day-reject-input:focus { outline: none; border-color: var(--accent); }
.hol-day-empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 20px;
  font-size: 13px;
}
.hol-hover-name { font-weight: 600; }
.hol-hover-reason {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
}
.hol-hover-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.12s;
}
.hol-hover-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.hol-hover-btn-approve { color: #15803d; border-color: #86efac; }
.hol-hover-btn-approve:hover:not(:disabled) { background: #dcfce7; }
.hol-hover-btn-reject { color: #b91c1c; border-color: #fca5a5; }
.hol-hover-btn-reject:hover:not(:disabled) { background: #fee2e2; }
.hol-hover-kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 6px;
}
.hol-hover-kind-driver { background: #dbeafe; color: #1e40af; }
.hol-hover-kind-staff  { background: #fce7f3; color: #9d174d; }
.hol-hover-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.hol-hover-status-approved { background: #dcfce7; color: #15803d; }
.hol-hover-status-pending  { background: #fef3c7; color: #92400e; }
.hol-hover-status-rejected { background: #fee2e2; color: #b91c1c; }

/* ── Pending request kind tag ─────────────────────────────────── */
.hol-kind-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.hol-kind-driver { background: #dbeafe; color: #1e40af; }
.hol-kind-staff  { background: #fce7f3; color: #9d174d; }

/* ── Office Staff CRUD ─────────────────────────────────────────── */
.hol-staff-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.hol-staff-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.hol-staff-sub {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 4px 0 0;
  max-width: 560px;
}
.hol-staff-sub code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.hol-staff-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.hol-staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.hol-staff-table thead {
  background: var(--bg);
}
.hol-staff-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
}
.hol-staff-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.hol-staff-table tbody tr:last-child td { border-bottom: none; }
.hol-staff-login {
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.hol-staff-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
}
.hol-staff-status-active   { background: #dcfce7; color: #15803d; }
.hol-staff-status-inactive { background: #f1f5f9; color: #64748b; }
.hol-staff-used-over { color: #b91c1c; font-weight: 700; }
.hol-staff-actions { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
.hol-staff-actions-col { text-align: right; }

@media (max-width: 720px) {
  .hol-staff-table thead { display: none; }
  .hol-staff-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 12px;
  }
  .hol-staff-table td { padding: 0; border: none; }
  .hol-staff-table td:first-child { grid-column: 1 / -1; font-size: 15px; }
  .hol-staff-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}

/* ── Holiday modal (used by add / code / edit) ─────────────────── */
.hol-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.hol-modal-backdrop[hidden] { display: none; }
.hol-modal {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 24px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.hol-modal-title { margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.hol-modal-form { display: flex; flex-direction: column; gap: 14px; }
.hol-modal-label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.hol-modal-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}
.hol-modal-input:focus { outline: none; border-color: var(--accent); }
.hol-modal-hint { color: var(--ink-muted); font-weight: 400; font-size: 12px; }
.hol-modal-hint code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
}
.hol-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.hol-code-modal-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0 0 14px;
}
.hol-code-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.hol-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
}
.hol-code-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--ink-muted);
  min-width: 70px;
}
.hol-code-value {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
}
.hol-code-value-pw { font-size: 18px; letter-spacing: 1px; }
.hol-code-copy-btn {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.hol-code-copy-btn:hover { border-color: var(--ink-muted); }

/* ── Round Comments ───────────────────────────────────────────────── */
.round-comments {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}

.round-comments-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.round-comments-count { font-weight: 400; }

.round-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.round-comment {
  background: var(--bg);
  border-radius: 6px;
  padding: 8px 10px;
}

.round-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.round-comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.round-comment-date {
  font-size: 11px;
  color: var(--ink-muted);
}

.round-comment-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}

.round-comments-empty {
  font-size: 12px;
  color: var(--ink-muted);
  padding: 4px 0;
}

.round-comment-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.round-comment-form .field-input {
  flex: 1;
  padding: 7px 10px;
  font-size: 13px;
}

/* ── Test mode (admin-only test driver/vehicle/rounds) ───────────── */
.test-round-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #fde68a;
  color: #92400e;
  border-radius: 4px;
  vertical-align: middle;
}

.live-round-row-test {
  background: repeating-linear-gradient(
    45deg,
    rgba(253, 230, 138, 0.08),
    rgba(253, 230, 138, 0.08) 8px,
    transparent 8px,
    transparent 16px
  );
}

.test-tools-card {
  border: 1px dashed var(--border, #cbd5e1);
}

.test-tools-note {
  color: var(--ink-muted, #64748b);
  font-size: 13px;
  margin: 0 0 12px 0;
}

.driver-skip-checklist {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.driver-skip-checklist:hover { background: #b91c1c; }
.driver-skip-checklist:disabled { opacity: 0.6; cursor: wait; }

/* ── Returning drivers panel (Heading Back to Depot) ─────────────── */
.returning-drivers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.returning-driver-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.returning-driver-name {
  font-weight: 600;
  color: var(--ink, #0f172a);
}
.returning-driver-eta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.returning-driver-mins {
  font-size: 18px;
  font-weight: 700;
  color: #0369a1;
}
.returning-driver-clock {
  font-size: 12px;
  color: var(--ink-muted, #64748b);
}
.returning-driver-meta {
  font-size: 12px;
  color: var(--ink-muted, #64748b);
}

/* ── Fleetsmart connection indicators ─────────────────────────────── */
.vehicle-reg-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fs-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.fs-badge-live {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}
.fs-badge-stale {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.3);
}
.fs-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.fs-badge-live .fs-badge-dot {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: fs-pulse 1.8s infinite;
}
.fs-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.fs-status-live {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.fs-status-stale {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.fs-status-none {
  color: #94a3b8;
  font-weight: 500;
  font-style: italic;
}
.fs-status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: fs-pulse 1.8s infinite;
}
@keyframes fs-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── Fuel expenses form ──────────────────────────────────────────── */
.fuel-form {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.fuel-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.fuel-form-row .field {
  flex: 1;
  min-width: 120px;
}
.fuel-form-row .field:last-of-type {
  min-width: 80px;
}
.fuel-form-action {
  padding-bottom: 4px;
}
.fuel-total {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted, #64748b);
  border-bottom: 1px solid var(--border, #e2e8f0);
}
@media (max-width: 640px) {
  .fuel-form-row {
    flex-direction: column;
  }
  .fuel-form-row .field {
    min-width: 100%;
  }
}

/* ── Per-user themes ─────────────────────────────────────────────────
   Opt-in by setting `theme` on a user doc. The matching class is
   added to <body> by layout.pug. Overrides CSS variables only, so the
   whole app re-tints without page-level rewrites. */

/* Burgundy — deep wine with warm rose highlights */
body.theme-burgundy {
  --accent: #7a1f2b;
  --accent-hover: #5e1822;
  --accent-light: #fbeff1;
  --accent-gradient: linear-gradient(135deg, #a64d5c 0%, #7a1f2b 100%);
  --green: #7a1f2b;
  --green-light: #fbeff1;
  --green-dark: #4d1319;
  --green-gradient: linear-gradient(135deg, #a64d5c 0%, #7a1f2b 100%);
  --sidebar-bg: #2d0a10;
  --sidebar-bg-solid: #2d0a10;
  --sidebar-ink: #c8a6ac;
  --sidebar-active: #e7a8b2;
  --sidebar-hover-bg: rgba(231, 168, 178, 0.08);
  --sidebar-active-bg: rgba(231, 168, 178, 0.14);
  --sidebar-border: rgba(231, 168, 178, 0.08);
}
