/* ============================================================
   เบิกรถช่าง — Shared Styles (Redesign v2)
   Mobile-first · Thai · vanilla CSS
   ============================================================ */

:root {
  /* Primary palette */
  --clr-primary:         #4361EE;
  --clr-primary-light:   #EEF2FF;
  --clr-primary-dark:    #3A4FC7;
  --clr-primary-bg-tint: #F5F7FF;

  /* Status colors */
  --clr-success:         #2DD881;
  --clr-success-light:   #DCFCE7;
  --clr-warning:         #FF8A3D;
  --clr-warning-light:   #FFF1E6;
  --clr-danger:          #FF5A5F;
  --clr-danger-light:    #FEE4E4;

  /* Neutrals */
  --clr-text:            #1F2937;
  --clr-text-muted:      #6B7280;
  --clr-text-light:      #9CA3AF;
  --clr-border:          #E5E7EB;
  --clr-border-light:    #F3F4F6;
  --clr-bg:              #F8F9FB;
  --clr-surface:         #FFFFFF;

  /* Sky gradient (hero illustration) */
  --gradient-sky: linear-gradient(180deg, #DBEAFE 0%, #E0E7FF 50%, #FCE7F3 80%, #FEE4E2 100%);

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   18px;
  --radius-xl:   22px;
  --radius-2xl:  28px;
  --radius-pill: 999px;
  --radius:      14px; /* backwards-compat alias → --radius-md */

  /* Shadows */
  --shadow-sm:      0 2px 8px rgba(67, 97, 238, 0.06);
  --shadow-md:      0 4px 16px rgba(67, 97, 238, 0.10);
  --shadow-lg:      0 8px 24px rgba(67, 97, 238, 0.12);
  --shadow-button:  0 4px 12px rgba(67, 97, 238, 0.30);
  --shadow-success: 0 4px 12px rgba(45, 216, 129, 0.30);
  --shadow:         var(--shadow-md); /* backwards-compat alias */

  /* Typography */
  --font-sans:       'Sarabun', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --font-size-xs:    11px;
  --font-size-sm:    13px;
  --font-size-base:  14px;
  --font-size-md:    15px;
  --font-size-lg:    17px;
  --font-size-xl:    20px;
  --font-size-2xl:   26px;

  /* Transitions */
  --transition: all 0.2s ease;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

/* ============================================================
   Base
   ============================================================ */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--clr-text);
  background: var(--clr-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Hidden utility (SPA view switching)
   ============================================================ */
.hidden, [hidden] { display: none !important; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3 { line-height: 1.3; font-weight: 700; }
h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

.text-center { text-align: center; }
.text-muted  { color: var(--clr-text-muted); }
.text-sm     { font-size: var(--font-size-sm); }
.text-danger { color: var(--clr-danger); }

/* ============================================================
   Page background helpers
   ============================================================ */
.page-tint-blue { background: var(--clr-primary-bg-tint); min-height: 100vh; }
.page-default   { background: var(--clr-bg); min-height: 100vh; }

/* ============================================================
   App Header (sticky top bar)
   ============================================================ */
.app-header {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.app-header-title { font-size: var(--font-size-lg); font-weight: 500; }
/* backwards-compat — old HTML uses .app-header-name */
.app-header-name  { flex: 1; font-weight: 600; font-size: var(--font-size-md); }

.app-content {
  padding: var(--space-4);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 0.5px solid var(--clr-border-light);
}

/* ============================================================
   Button — base
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 50px;
  padding: 14px 20px;
  font-size: var(--font-size-md);
  font-family: var(--font-sans);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled               { opacity: 0.5; cursor: not-allowed; }

/* Variants */
.btn-primary {
  background: var(--clr-primary);
  color: #fff;
  box-shadow: var(--shadow-button);
}
.btn-primary:hover:not(:disabled) { background: var(--clr-primary-dark); }

.btn-success {
  background: var(--clr-success);
  color: #fff;
  box-shadow: var(--shadow-success);
}

.btn-outline {
  background: var(--clr-surface);
  color: var(--clr-primary);
  border: 1.5px solid #C7D2FE;
}
.btn-outline:hover:not(:disabled) { background: var(--clr-primary-light); }

.btn-danger {
  background: var(--clr-danger);
  color: #fff;
}

.btn-warning {
  background: var(--clr-warning);
  color: #fff;
}
.btn-warning:hover:not(:disabled) { filter: brightness(0.92); }

.btn-ghost {
  background: transparent;
  color: var(--clr-text-muted);
  border: 1.5px solid var(--clr-border);
}
.btn-ghost:hover:not(:disabled) { background: var(--clr-bg); }

.btn-danger-outline {
  background: transparent;
  color: var(--clr-danger);
  border: 1.5px solid var(--clr-danger);
}

/* Size modifiers */
.btn-sm {
  min-height: auto;
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}
.btn-lg {
  min-height: 56px;
  padding: 16px 24px;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-xl);
}
.btn-block { width: 100%; }

/* ============================================================
   Input
   ============================================================ */
.input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: var(--font-size-base);
  font-family: var(--font-sans);
  color: var(--clr-text);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.input:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-light);
}
.input::placeholder { color: var(--clr-text-muted); }

/* ============================================================
   Pill / Badge
   ============================================================ */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 500;
  white-space: nowrap;
}

/* Pill colour variants */
.pill-primary { background: var(--clr-primary-light); color: var(--clr-primary-dark); }
.pill-success { background: var(--clr-success-light); color: #15803D; }
.pill-warning { background: var(--clr-warning-light); color: #C2410C; }
.pill-danger  { background: var(--clr-danger-light);  color: #B91C1C; }

/* Badge colour variants (original class names — kept for existing HTML) */
.badge-pending   { background: var(--clr-border-light); color: var(--clr-text-muted); }
.badge-traveling { background: var(--clr-primary-light); color: var(--clr-primary-dark); }
.badge-onsite    { background: var(--clr-success-light); color: #15803D; }
.badge-returned  { background: var(--clr-border-light); color: var(--clr-text-muted); }
.badge-insert    { background: var(--clr-warning-light); color: #C2410C; }

/* ============================================================
   Chip (tag inside cards — e.g. "⛽ น้ำมัน")
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--clr-border-light);
  color: var(--clr-text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

/* ============================================================
   FAB (Floating Action Button)
   ============================================================ */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 200;
  transition: var(--transition);
}
.fab:active { transform: scale(0.94); }

/* ============================================================
   Modal / Backdrop
   ============================================================ */
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* .modal-backdrop is the new name; .modal-overlay kept for existing HTML */
.modal-backdrop,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal {
  background: var(--clr-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  max-width: 92vw;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
  margin-bottom: var(--space-4);
}
.modal-header h3 { font-size: var(--font-size-md); margin: 0; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--clr-text-muted);
  line-height: 1;
  padding: var(--space-1);
  transition: color var(--transition);
}
.modal-close:hover { color: var(--clr-text); }
.modal-body   { overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  padding-top: var(--space-4);
  border-top: 1px solid var(--clr-border);
  flex-shrink: 0;
  margin-top: var(--space-4);
}

/* ============================================================
   Loading dot animation
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.2); }
}
.dot-pulse { animation: pulse-dot 1.4s ease-in-out infinite; }

/* ============================================================
   Spinner
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

/* ============================================================
   Form
   ============================================================ */
.form-group            { margin-bottom: var(--space-5); }
.form-group:last-child { margin-bottom: 0; }

.label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--space-2);
}
.label-optional { font-weight: 400; color: var(--clr-text-muted); font-size: var(--font-size-xs); }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  margin-top: var(--space-4);
}
.alert-danger  { background: var(--clr-danger-light);  color: var(--clr-danger);  }
.alert-success { background: var(--clr-success-light); color: #15803D; }
.alert-warning { background: var(--clr-warning-light); color: #C2410C; }

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--clr-border);
}
.avatar-sm { width: 40px; height: 40px; }
.avatar-md { width: 64px; height: 64px; }
.avatar-lg { width: 96px; height: 96px; }

/* ============================================================
   Photo Upload
   ============================================================ */
.photo-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  margin-bottom: var(--space-6);
  -webkit-tap-highlight-color: transparent;
}
.photo-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px dashed var(--clr-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--clr-bg);
  transition: var(--transition);
  position: relative;
}
.photo-ring.has-photo       { border-style: solid; border-color: var(--clr-primary); }
.photo-ring img             { width: 100%; height: 100%; object-fit: cover; display: none; }
.photo-ring.has-photo img   { display: block; }
.photo-ring.has-photo .photo-placeholder { display: none; }

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--clr-text-muted);
  text-align: center;
  gap: 4px;
  padding: var(--space-2);
}
.photo-icon { font-size: 2rem; line-height: 1; }
.photo-hint { font-size: var(--font-size-sm); color: var(--clr-text-muted); }

/* ============================================================
   Section heading
   ============================================================ */
.section-title {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}

/* ============================================================
   Spacing utilities
   ============================================================ */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2        { gap: var(--space-2); }
.gap-3        { gap: var(--space-3); }
.flex-1       { flex: 1; }
.w-full       { width: 100%; }

/* ============================================================
   Layout — Login page
   ============================================================ */
.page-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-6);
}
.login-wrap     { width: 100%; max-width: 420px; }
.login-logo     { text-align: center; margin-bottom: var(--space-8); }
.login-icon     { font-size: 3.5rem; line-height: 1; margin-bottom: var(--space-2); }
.login-title    { font-size: var(--font-size-2xl); color: var(--clr-primary); margin-bottom: 4px; }
.login-subtitle { color: var(--clr-text-muted); font-size: var(--font-size-base); }
.login-card     { padding: var(--space-6); }

/* ============================================================
   Vehicle Selection (checkout)
   ============================================================ */
.vehicle-list { display: flex; flex-direction: column; gap: var(--space-2); }

.vehicle-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px var(--space-4);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  background: var(--clr-surface);
}
.vehicle-option.selected {
  border-color: var(--clr-primary);
  background: var(--clr-primary-light);
}
.vehicle-plate        { font-weight: 700; font-size: var(--font-size-md); flex: 1; }
.vehicle-model        { font-size: var(--font-size-sm); color: var(--clr-text-muted); }
.vehicle-section-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 4px 0 var(--space-2);
}
.vtype-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.vtype-chip.fuel { background: #fef3c7; color: #92400e; }
.vtype-chip.ev   { background: #d1fae5; color: #065f46; }

/* ============================================================
   Status Banner (traveling / onsite)
   ============================================================ */
.status-banner {
  padding: var(--space-4);
  text-align: center;
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-lg);
}
.status-banner-traveling { background: var(--clr-primary-light); color: var(--clr-primary-dark); }
.status-banner-onsite    { background: var(--clr-success-light); color: #15803D; }

/* ============================================================
   Info Grid (trip info rows)
   ============================================================ */
.info-grid  { display: flex; flex-direction: column; gap: 10px; }
.info-row   { display: flex; justify-content: space-between; align-items: baseline; }
.info-label { color: var(--clr-text-muted); font-size: var(--font-size-sm); }
.info-value { font-weight: 600; text-align: right; }

/* ============================================================
   Admin Dashboard
   ============================================================ */
.dash-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-5);
}
.dash-header-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.dash-date        { font-size: var(--font-size-xs); color: var(--clr-text-muted); }
.dash-actions     { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-6); }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}
.stat-label { font-size: var(--font-size-sm); color: var(--clr-text-muted); font-weight: 500; line-height: 1.3; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--clr-primary); }
.stat-value-traveling { color: var(--clr-warning); }
.stat-value-onsite    { color: var(--clr-success); }
.stat-value-muted     { color: var(--clr-text-muted); }

/* Admin nav */
.dash-nav { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }

/* Technician table (desktop ≥768px) */
.tech-table-wrap {
  display: none;
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
@media (min-width: 768px) { .tech-table-wrap { display: block; } }

.tech-table              { width: 100%; border-collapse: collapse; table-layout: auto; }
.tech-table thead th {
  padding: 12px var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  background: var(--clr-bg);
  border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.tech-table thead th:nth-child(1) { width: 34%; }
.tech-table thead th:nth-child(2) { width: 18%; }
.tech-table thead th:nth-child(3) { width: 24%; }
.tech-table thead th:nth-child(4) { width: 19%; }
.tech-table thead th:nth-child(5) { width: 5%;  }

.tech-table tbody td {
  padding: 14px var(--space-4);
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
}
.tech-table tbody tr:last-child td { border-bottom: none; }

.tech-row           { cursor: pointer; transition: background var(--transition); }
.tech-row:hover     { background: var(--clr-bg); }
.tech-row.expanded  { background: var(--clr-primary-light); }

.tech-row .expand-icon {
  display: inline-block;
  font-size: 1.1rem;
  color: var(--clr-text-muted);
  transition: transform 0.2s ease;
}
.tech-row.expanded .expand-icon { transform: rotate(90deg); }

.tech-detail-row > td { padding: 0; border-bottom: 2px solid var(--clr-primary); }

/* Name + avatar cell */
.tech-name-cell        { display: flex; align-items: center; gap: var(--space-3); }
.tech-name-cell .avatar{ width: 46px; height: 46px; flex-shrink: 0; }
.tech-name-primary     { font-weight: 600; font-size: var(--font-size-base); }
.tech-name-sub         { font-size: var(--font-size-xs); color: var(--clr-text-muted); margin-top: 2px; }

/* Expand panel */
.expand-panel { padding: var(--space-6); background: var(--clr-bg); }
.detail-grid  {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 680px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-info  { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.detail-row   { display: flex; gap: var(--space-2); font-size: var(--font-size-sm); align-items: baseline; }
.detail-label { color: var(--clr-text-muted); min-width: 110px; flex-shrink: 0; }
.detail-value { font-weight: 600; }

/* Technician mobile cards (<768px) */
.tech-cards-wrap { display: block; }
@media (min-width: 768px) { .tech-cards-wrap { display: none; } }

.tech-card {
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.tech-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tech-card-header .avatar { width: 46px; height: 46px; flex-shrink: 0; }
.tech-card-info  { flex: 1; min-width: 0; }
.tech-card-name  { font-weight: 700; font-size: var(--font-size-md); }
.tech-card-sub   { font-size: var(--font-size-sm); color: var(--clr-text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tech-card-expand{ color: var(--clr-text-muted); font-size: 1.1rem; transition: transform 0.2s ease; flex-shrink: 0; }
.tech-card.expanded .tech-card-expand { transform: rotate(90deg); }
.tech-card-detail{ border-top: 1px solid var(--clr-border); background: var(--clr-bg); padding: var(--space-4); }

/* Photo grid */
.photo-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  display: block;
}
.photo-thumb:hover { border-color: var(--clr-primary); transform: scale(1.03); }
.photo-missing {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--clr-bg);
  border: 1.5px dashed var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text-muted);
  font-size: var(--font-size-xs);
  text-align: center;
  gap: 4px;
  padding: var(--space-2);
}
.photo-section-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 6px;
}
.photo-section-label:first-child { margin-top: 0; }

/* Star rating */
.star-group { display: flex; gap: 2px; align-items: center; }
.star-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 2px 4px;
  transition: transform 0.15s;
  color: var(--clr-border);
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.star-btn.on    { color: #f59e0b; }
.star-btn:hover { transform: scale(1.2); color: #f59e0b; }
.score-saved    { font-size: var(--font-size-xs); color: var(--clr-success); margin-left: var(--space-2); }

/* Fuel log list */
.fuel-log-list { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.fuel-log-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  border: 1px solid var(--clr-border);
}
.fuel-log-time { color: var(--clr-text-muted); min-width: 48px; flex-shrink: 0; }
.fuel-receipt-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}

/* Location link */
.loc-link {
  font-size: var(--font-size-sm);
  color: var(--clr-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.loc-link:hover { text-decoration: underline; }
.loc-no { font-size: var(--font-size-sm); color: var(--clr-text-muted); }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  cursor: zoom-out;
}
.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  cursor: default;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.4); }

/* ============================================================
   Admin management table (users / vehicles)
   ============================================================ */
.mgmt-table-wrap {
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.mgmt-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.mgmt-table thead th {
  padding: 10px var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  background: var(--clr-bg);
  border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.mgmt-table tbody td {
  padding: 12px var(--space-4);
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
  font-size: var(--font-size-base);
}
.mgmt-table tbody tr:last-child td { border-bottom: none; }
.mgmt-table tbody tr:hover { background: var(--clr-bg); }
.mgmt-actions { display: flex; gap: 6px; }

/* ============================================================
   Insert job banner
   ============================================================ */
.insert-banner {
  background: linear-gradient(135deg, #fff7ed 0%, var(--clr-warning-light) 100%);
  border: 2px solid var(--clr-warning);
  border-radius: var(--radius-xl);
  padding: 18px var(--space-5);
  margin-bottom: var(--space-5);
}
.insert-banner-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--clr-warning);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.insert-banner-customer { font-size: var(--font-size-md); font-weight: 700; margin-bottom: 4px; }
.insert-banner-detail   { font-size: var(--font-size-sm); color: var(--clr-text-muted); margin-bottom: 14px; }
.insert-banner-actions  { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ============================================================
   Queue list
   ============================================================ */
.queue-section { margin-top: var(--space-6); }
.queue-item {
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border-light);
  border-radius: var(--radius-md);
  padding: 14px var(--space-4);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.queue-item-date     { font-size: var(--font-size-xs); color: var(--clr-primary); font-weight: 700; margin-bottom: 3px; }
.queue-item-customer { font-weight: 600; font-size: var(--font-size-base); }
.queue-item-detail   { font-size: var(--font-size-sm); color: var(--clr-text-muted); margin-top: 2px; }

/* ============================================================
   Fuel chip (onsite summary)
   ============================================================ */
.fuel-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  background: var(--clr-warning-light);
  color: var(--clr-warning);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
  text-align: center;
}

/* ============================================================
   Summary rows
   ============================================================ */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--clr-border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--clr-text-muted); font-size: var(--font-size-sm); }
.summary-value { font-weight: 600; text-align: right; }
