/* Fleet Management System - Design System & Stylesheet (v1.0.0) */
:root {
  color-scheme: dark;
  --bg-app: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-raised: #21262d;
  --bg-surface-hover: #30363d;
  --border: #30363d;
  --border-focus: #58a6ff;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-inverse: #0d1117;
  --accent: #2ea043;
  --accent-hover: #3fb950;
  --primary: #238636;
  --primary-hover: #2ea043;
  --brand: #38bdf8;
  --danger: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.15);
  --warning: #d29922;
  --warning-bg: rgba(210, 153, 34, 0.15);
  --success: #3fb950;
  --success-bg: rgba(63, 185, 80, 0.15);
  --info: #58a6ff;
  --info-bg: rgba(88, 166, 255, 0.15);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--info);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

/* Icons */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

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

.sidebar {
  width: 260px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.25s ease-in-out;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none !important;
  color: var(--text-main);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(56, 189, 248, 0.25);
  background: transparent;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.brand:hover .brand-mark {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 14px rgba(56, 189, 248, 0.4);
}
.brand-mark .brand-img,
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.brand-mark .icon {
  width: 22px;
  height: 22px;
}
.brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-text small {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

nav {
  padding: 1rem 0.5rem;
  flex: 1;
}
.nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.35rem;
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}
.nav-link:hover {
  background-color: var(--bg-surface-raised);
  color: var(--text-main);
}
.nav-link.active {
  background-color: #1f6feb22;
  color: var(--brand);
  font-weight: 600;
  border-left: 3px solid var(--brand);
}
.nav-link .pill-count {
  margin-left: auto;
  background-color: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-style: normal;
  font-weight: 700;
}

.sidebar-foot {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
.sidebar-foot .who {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--brand);
}
.sidebar-foot .who span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.sidebar-foot .who small {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: capitalize;
}
.foot-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}
.foot-links .linklike {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
}
.foot-links .linklike:hover {
  text-decoration: underline;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 {
  font-size: 1.3rem;
  font-weight: 700;
}
.menu-btn {
  display: none;
}

.content {
  padding: 1.5rem;
  flex: 1;
}

/* Language selector */
.lang {
  display: inline-flex;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.lang a {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  text-decoration: none !important;
}
.lang a.on {
  background: var(--brand);
  color: var(--text-inverse);
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-error {
  background: var(--danger-bg);
  border-color: rgba(248, 81, 73, 0.4);
  color: #ff7b72;
}
.alert-warning {
  background: var(--warning-bg);
  border-color: rgba(210, 153, 34, 0.4);
  color: #d29922;
}
.alert-success {
  background: var(--success-bg);
  border-color: rgba(63, 185, 80, 0.4);
  color: #3fb950;
}
.alert-info {
  background: var(--info-bg);
  border-color: rgba(88, 166, 255, 0.4);
  color: #79c0ff;
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Badges & Pills */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: capitalize;
}
.badge-ok {
  background: var(--success-bg);
  color: var(--success);
}
.badge-flagged {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge-void {
  background: var(--danger-bg);
  color: var(--danger);
  text-decoration: line-through;
}

/* Tooltip / Hover Popups */
.has-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: help;
}
.has-tooltip .tooltip-popup {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f0f6fc;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.has-tooltip .tooltip-popup::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #0d1117 transparent;
}
.has-tooltip:hover .tooltip-popup,
.has-tooltip:focus .tooltip-popup,
.has-tooltip:focus-within .tooltip-popup {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
th:last-child .has-tooltip .tooltip-popup,
td:last-child .has-tooltip .tooltip-popup {
  left: auto;
  right: 0;
  transform: translateY(-4px);
}
th:last-child .has-tooltip:hover .tooltip-popup,
th:last-child .has-tooltip:focus .tooltip-popup,
th:last-child .has-tooltip:focus-within .tooltip-popup,
td:last-child .has-tooltip:hover .tooltip-popup,
td:last-child .has-tooltip:focus .tooltip-popup,
td:last-child .has-tooltip:focus-within .tooltip-popup {
  transform: translateY(0);
}
th:last-child .has-tooltip .tooltip-popup::after,
td:last-child .has-tooltip .tooltip-popup::after {
  left: auto;
  right: 20px;
}
.has-tooltip .info-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: var(--brand);
  font-size: 0.7rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.has-tooltip:hover .info-circle {
  background: var(--brand);
  color: #0d1117;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}
.pill-on {
  background: var(--success-bg);
  color: var(--success);
}
.pill-off {
  background: var(--bg-surface-raised);
  color: var(--text-muted);
}
.pill-warn {
  background: var(--warning-bg);
  color: var(--warning);
}
.pill-bad {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none !important;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.btn .icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}
.btn-accent {
  background: linear-gradient(135deg, #1f6feb, #238636);
  color: #fff;
}
.btn-ghost {
  background-color: var(--bg-surface-raised);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-ghost:hover {
  background-color: var(--bg-surface-hover);
}
.btn-danger {
  background-color: var(--danger);
  color: #fff;
}
.btn-danger-ghost {
  background-color: transparent;
  border-color: rgba(248, 81, 73, 0.4);
  color: var(--danger);
}
.btn-danger-ghost:hover {
  background-color: var(--danger-bg);
}
.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}
.btn-sm .icon {
  width: 0.85rem;
  height: 0.85rem;
}
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
}
.btn-xs .icon {
  width: 0.75rem;
  height: 0.75rem;
}
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.4rem;
  cursor: pointer;
}

/* Tables */
.table-card {
  padding: 0;
  overflow: hidden;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}
.table th, .table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.table th {
  background-color: var(--bg-surface-raised);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}
.table tbody tr.row-off {
  opacity: 0.55;
}
.table .sort {
  color: inherit;
  text-decoration: none !important;
}
.table .empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.table td.actions {
  text-align: right;
  white-space: nowrap;
}
.rowlink {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.rowlink:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Detail View Layout */
.detail-card {
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2rem;
}
@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.detail-item {
  min-width: 0;
}
.detail-item.full {
  grid-column: 1 / -1;
}
.detail-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.detail-value {
  font-size: 0.95rem;
  color: var(--text-bright);
  word-break: break-word;
}


/* Toolbar & Filters */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem 1rem;
}
.toolbar input, .toolbar select {
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
}
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--border-focus);
  outline: none;
}
.toolbar .count {
  font-size: 0.82rem;
}
.toolbar .push {
  margin-left: auto;
}
.inline-form {
  display: inline-block;
  margin: 0;
}

/* Forms */
.form-card {
  max-width: 860px;
  width: 100%;
  box-sizing: border-box;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.field.full {
  grid-column: span 2;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.field label .req {
  color: var(--danger);
}
.field input, .field select, .field textarea,
select, input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="search"], input[type="date"], input[type="time"], input[type="number"], textarea {
  color-scheme: dark;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
select {
  text-overflow: ellipsis;
}
.field input:focus, .field select:focus, .field textarea:focus,
select:focus, input:focus, textarea:focus {
  border-color: var(--border-focus);
  outline: none;
}
select option, select optgroup {
  background-color: #161b22 !important;
  color: #f0f6fc !important;
}
select option:checked {
  background-color: var(--primary) !important;
  color: #ffffff !important;
}
.field .help {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.field .err {
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 600;
}
.field.has-error input, .field.has-error select, .field.has-error textarea {
  border-color: var(--danger);
}
.field .check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding-top: 0.5rem;
}
.field .check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Public Layout (Driver Form / Login) */
.public-wrap {
  max-width: 520px;
  margin: 2rem auto 3rem;
  padding: 0 1rem;
}
.public-lang-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}
.public-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.15rem;
  margin-bottom: 2rem;
}
.brand-mark-lg {
  width: 160px;
  height: 160px;
  border-radius: 32px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 35px rgba(56, 189, 248, 0.4);
  margin: 0 auto;
}
.brand-mark-lg:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65), 0 0 45px rgba(56, 189, 248, 0.55);
}
.public-name {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  text-align: center;
  margin: 0;
}
@media (max-width: 480px) {
  .brand-mark-lg {
    width: 128px;
    height: 128px;
    border-radius: 26px;
  }
  .public-name {
    font-size: 1.55rem;
  }
}
.public-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.public-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.public-card p.lead {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.public-foot {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

/* KPI Stats Grid (Dashboard) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--bg-surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}
.stat-icon.green { color: var(--success); background: var(--success-bg); }
.stat-icon.amber { color: var(--warning); background: var(--warning-bg); }
.stat-icon.blue  { color: var(--info);    background: var(--info-bg); }
.stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Modal Backdrop & Dialog */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 35;
}
.backdrop.active {
  display: block;
}

/* Mobile responsive */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-btn {
    display: inline-flex;
    margin-right: 0.75rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: span 1;
  }
  .toolbar .push {
    margin-left: 0;
    width: 100%;
  }
  .content {
    padding: 1rem;
  }
}

/* Photo Uploader Styles (v1.2.1) */
.photo-uploader {
  position: relative;
  margin-top: 0.35rem;
}
.photo-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  background-color: var(--bg-surface-raised);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  gap: 0.35rem;
}
.photo-placeholder[hidden],
.photo-placeholder.hidden,
.photo-preview-box[hidden],
.photo-preview-box.hidden {
  display: none !important;
}
.photo-placeholder:hover,
.photo-placeholder:focus,
.photo-placeholder:active {
  border-color: var(--brand);
  background-color: var(--bg-surface-hover);
}
.photo-uploader:focus-within .photo-placeholder {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}
.photo-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  pointer-events: none;
}
.photo-prompt {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  pointer-events: none;
}
.photo-placeholder small {
  pointer-events: none;
}
.photo-retake-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.photo-preview-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: #000;
  cursor: pointer;
}
.photo-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.photo-size {
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 500;
}
.photo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border);
  color: var(--info);
  text-decoration: none !important;
  cursor: pointer;
}
.photo-pill:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--info);
}

/* OCR Status Badges & Animations */
.ocr-status-badge,
.geo-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  line-height: 1.35;
  transition: all 0.25s ease;
}
.ocr-status-scanning {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.ocr-status-success {
  background: rgba(35, 134, 54, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.4);
  color: #3fb950;
}
.ocr-status-notice {
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: #d29922;
}
.ocr-spinner {
  display: inline-block;
  animation: ocrSpin 1.4s infinite linear;
}
@keyframes ocrSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.input-highlight-pulse {
  animation: ocrPulse 2.5s ease-out;
}
@keyframes ocrPulse {
  0% {
    box-shadow: 0 0 0 4px rgba(46, 160, 67, 0.6);
    border-color: #3fb950;
  }
  50% {
    box-shadow: 0 0 0 2px rgba(46, 160, 67, 0.3);
    border-color: #3fb950;
  }
  100% {
    box-shadow: none;
  }
}

/* Lightbox Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}
.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.modal-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}
.modal-bar strong {
  font-size: 1rem;
}
.modal-actions {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}
.modal-actions .btn {
  color: #fff;
  text-decoration: none;
}
.modal-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.badge-role {
  background: var(--bg-surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ==========================================================================
   Customer Tax Invoice Component & Printable Styles
   ========================================================================== */
.invoice-card {
  background: #ffffff;
  color: #1e293b;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 2.5rem;
  max-width: 960px;
  margin: 0 auto 2rem;
  border: 1px solid #e2e8f0;
}
.invoice-card table {
  color: #1e293b;
}
.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}
.inv-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin: 0 0 0.25rem;
}
.inv-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.inv-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  color: #1e293b;
}
.inv-box h4 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}
.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  color: #1e293b;
}
.inv-table th {
  background: #f1f5f9;
  color: #475569;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 2px solid #cbd5e1;
}
.inv-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
  vertical-align: top;
  color: #1e293b;
}
.inv-table tr:last-child td {
  border-bottom: none;
}
.inv-totals {
  margin-left: auto;
  width: 320px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  color: #1e293b;
}
.inv-total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  color: #475569;
}
.inv-total-row.grand {
  border-top: 2px solid #cbd5e1;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}
.inv-status-pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-draft { background: #e2e8f0; color: #475569; }
.status-sent { background: #dbeafe; color: #1d4ed8; }
.status-paid { background: #dcfce7; color: #15803d; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.action-bar {
  max-width: 960px;
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media print {
  body { background: #ffffff !important; color: #000000 !important; }
  .shell { display: block !important; }
  .sidebar, .action-bar, .no-print, header, .nav, .topbar { display: none !important; }
  .main, .content { padding: 0 !important; margin: 0 !important; }
  .invoice-card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

/* User Manual Component */
.manual-nav-link:hover, .manual-nav-link.active {
  background: rgba(6, 182, 212, 0.12) !important;
  color: var(--accent-light) !important;
}
@media print {
  .manual-sidebar, .manual-actions, #manual-search-wrap, button[data-action="print-manual"] {
    display: none !important;
  }
  .manual-layout {
    display: block !important;
  }
  .manual-section {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #ffffff !important;
    color: #000000 !important;
    break-inside: avoid;
    margin-bottom: 2rem !important;
  }
}

/* ==========================================================================
   Depot Map Picker & Geofence Styles
   ========================================================================== */
.depot-map-picker-wrap {
  width: 100%;
  margin-top: 0.25rem;
}
.map-search-row {
  position: relative;
}
.map-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
}
.map-search-item {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.map-search-item:last-child {
  border-bottom: none;
}
.map-search-item:hover {
  background: var(--bg-surface-raised);
}
.map-search-item strong {
  font-size: 0.88rem;
  color: var(--text-bright);
}
.map-search-item small {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.depot-leaflet-map, #depot-leaflet-map, #depot-view-leaflet-map {
  z-index: 10;
}
.leaflet-container {
  font-family: inherit;
}

/* Leaflet Layer Control Dark Theme */
.leaflet-control-layers {
  background: var(--bg-surface, #0f172a) !important;
  border: 1px solid var(--border, #334155) !important;
  border-radius: var(--radius-sm, 6px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  color: var(--text, #e2e8f0) !important;
}
.leaflet-control-layers-toggle {
  background-color: var(--bg-surface-raised, #1e293b) !important;
  border-radius: var(--radius-sm, 6px) !important;
  filter: invert(1) hue-rotate(180deg) brightness(1.2);
}
.leaflet-control-layers-expanded {
  padding: 0.75rem 1rem !important;
  background: var(--bg-surface-raised, #1e293b) !important;
  color: var(--text-bright, #f8fafc) !important;
  min-width: 190px !important;
}
.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-bottom: 0.4rem !important;
  font-size: 0.88rem !important;
  color: var(--text, #e2e8f0) !important;
  cursor: pointer !important;
  font-weight: 500 !important;
  user-select: none !important;
}
.leaflet-control-layers-base label:hover,
.leaflet-control-layers-overlays label:hover {
  color: var(--text-bright, #ffffff) !important;
}
.leaflet-control-layers-base input,
.leaflet-control-layers-overlays input {
  accent-color: var(--accent-light, #06b6d4) !important;
  margin: 0 !important;
  cursor: pointer !important;
  width: 15px !important;
  height: 15px !important;
}
.leaflet-control-layers-separator {
  border-top: 1px solid var(--border, #334155) !important;
  margin: 0.5rem 0 !important;
}



