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

:root {
  --bg: #f5f7fb;
  --bg-gradient: radial-gradient(circle at 0% 0%, #eef2ff 0%, transparent 40%), radial-gradient(circle at 100% 100%, #f0fdfa 0%, transparent 40%), #f5f7fb;
  --sidebar-bg: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  --sidebar-bg-solid: #0f172a;
  --sidebar-ink: #94a3b8;
  --sidebar-active: #e2e8f0;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.04));
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #94a3b8;
  --border: #e5e9f2;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --card-shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.08);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --green: #22c55e;
  --green-light: #f0fdf4;
  --green-dark: #15803d;
  --green-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 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(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 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 #bbf7d0;
  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);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 28px;
}

.brand-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.brand-text {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: #e2e8f0;
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: #fff;
}

.nav-item.active::before { height: 60%; }

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

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

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

/* ── Sidebar Footer ─────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  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: var(--accent);
  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: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

.sidebar-footer-link:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ── 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: 12px;
}

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

/* ── 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 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:hover {
  background: rgba(59, 130, 246, 0.03);
}

.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 ─────────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.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: var(--accent-light);
  color: var(--accent);
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--ink-muted);
}

.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;
}

.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-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);
}
.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: #6b7280; }
.live-round-seg.live-seg-pending { background: var(--border); }

.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 {
  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); }

/* ── Reports dashboard ─────────────────────────────────────────────── */
.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: 18px;
  box-shadow: var(--card-shadow);
  margin-bottom: 14px;
}

.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;
}

.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: var(--ink-muted);
  margin-top: 12px;
  text-decoration: none;
}

.login-back:hover { color: var(--accent); }

/* ── 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);
}

/* ── 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%;
}

/* ── 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-emoji { font-size: 16px; }
.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); }

/* 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;
}

.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: #6b7280; }
.round-progress-seg.seg-pending { background: var(--border); }

/* Collapsed body — hidden by default */
.round-card-body {
  display: none;
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  background: var(--bg);
}

.round-card.expanded .round-card-body { display: block; }

.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-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 ──────────────────────────────────────────────────── */
.builder-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 16px;
  align-items: start;
}

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

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

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

.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: 500px;
  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); }

/* 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;
}
