html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* FleetQ colour system: overrides Bootstrap 5.3's CSS custom properties so every existing
   bg-*/text-*/-subtle/-emphasis/progress-bar/button class picks up the brand palette without
   per-component changes. Bootstrap pre-computes -bg-subtle/-text-emphasis/-border-subtle at
   build time rather than deriving them from the base colour at runtime, so each triad below is
   set explicitly to stay in sync. */
:root {
  --bs-primary: #6c63ff;
  --bs-primary-rgb: 108, 99, 255;
  --bs-primary-bg-subtle: #ecebff;
  --bs-primary-text-emphasis: #3f35b5;
  --bs-primary-border-subtle: #c7c2fa;

  /* App shell (dark sidebar) surface tokens - not part of Bootstrap's theme variables. */
  --fq-sidebar-bg: #1e293b;
  --fq-sidebar-hover-bg: #29354a;
  --fq-sidebar-text: #c9cae0;
  --fq-sidebar-text-muted: #7b7e9e;
  --fq-accent-teal: #14b8a6;
  --fq-brand-orange: #ff8a00;
  --fq-accent-purple: #7c3aed;
  --fq-accent-blue: #2563eb;
  --fq-accent-green: #16a34a;
  --fq-accent-cyan: #06b6d4;
  --fq-accent-indigo: #4f46e5;
  --fq-text-secondary: #94a3b8;
  --fq-text-label: #64748b;

  --bs-success: #1b8a5a;
  --bs-success-rgb: 27, 138, 90;
  --bs-success-bg-subtle: #dff5ea;
  --bs-success-text-emphasis: #0e5a38;
  --bs-success-border-subtle: #a7e0c4;

  --bs-warning: #e2962b;
  --bs-warning-rgb: 226, 150, 43;
  --bs-warning-bg-subtle: #fcf1dc;
  --bs-warning-text-emphasis: #7a4a05;
  --bs-warning-border-subtle: #f0ce94;

  --bs-danger: #d64545;
  --bs-danger-rgb: 214, 69, 69;
  --bs-danger-bg-subtle: #fbe4e4;
  --bs-danger-text-emphasis: #7c1f1f;
  --bs-danger-border-subtle: #efb3b3;

  --bs-info: #2fb8d9;
  --bs-info-rgb: 47, 184, 217;
  --bs-info-bg-subtle: #dff4fa;
  --bs-info-text-emphasis: #0b5c72;
  --bs-info-border-subtle: #a6e3f0;

  --bs-secondary: #5b6b85;
  --bs-secondary-rgb: 91, 107, 133;
  --bs-secondary-bg-subtle: #e7eaf0;
  --bs-secondary-text-emphasis: #333f52;
  --bs-secondary-border-subtle: #c3cada;

  --bs-link-color: var(--bs-primary);
  --bs-link-hover-color: #3f35b5;
}

body {
  background-color: #f5f7fa;
  font-family: "InterVariable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Section grouping label above a row of related cards (e.g. "Fleet Status"). */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8792a3;
  margin-bottom: 0.6rem;
}

/* Softer, larger-radius card shadow used for dashboard cards instead of Bootstrap's flat shadow-sm. */
.shadow-soft {
  box-shadow: 0 2px 10px rgba(30, 41, 59, 0.06), 0 1px 2px rgba(30, 41, 59, 0.05);
  border-radius: 0.75rem;
  border: 1px solid rgba(30, 41, 59, 0.06);
}

/* Subtle lift on hover for clickable dashboard cards. */
.card-hover {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 41, 59, 0.1), 0 2px 6px rgba(30, 41, 59, 0.06);
}

/* Staggered fade-in for dashboard card entrance. */
@keyframes fq-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-stagger {
  animation: fq-fade-in 0.35s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-stagger {
    animation: none;
  }

  .card-hover:hover {
    transform: none;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--bs-primary);
}

/* Layout: full-height dark sidebar rail (desktop) beside a light topbar + fluid content column */
.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.app-sidebar {
  width: 256px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--fq-sidebar-bg, #1e293b);
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 64px;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* Topbar search */
.topbar-search {
  max-width: 420px;
  width: 100%;
}

.topbar-search .form-control,
.topbar-search .input-group-text {
  background-color: #f5f7fa;
  border-color: transparent;
}

.topbar-search .input-group-text {
  border-right: none;
}

.topbar-search .form-control {
  border-left: none;
}

.topbar-search .form-control:focus {
  background-color: #fff;
  box-shadow: none;
}

.topbar-search:focus-within .input-group-text {
  background-color: #fff;
}

/* Notification bell */
.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.notification-bell .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.6rem;
  padding: 0.25em 0.4em;
}

.notification-dropdown {
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  padding: 0;
}

/* Topbar profile avatar */
.topbar-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  font-size: 1.05rem;
}

/* Sidebar brand header: a compact single row - mark + wordmark on the left, collapse toggle
   near the top-right. Live text (not a PNG wordmark) so there's no dark-on-dark contrast problem
   to solve with a background card; the mark alone gets a very soft glow so its darker shadow
   tones don't disappear into the navy rail. */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: padding 0.22s ease;
}

.sidebar-brand-link,
.sidebar-brand-link:hover,
.sidebar-brand-link:visited {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
}

.sidebar-brand-icon {
  display: block;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.25));
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.sidebar-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-brand-subtitle {
  font-size: 0.68rem;
  color: var(--fq-text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebarOffcanvasLabel .sidebar-brand-icon {
  width: 26px;
  height: 26px;
}

/* Icon-only collapse/expand toggle, sits beside the brand link */
.sidebar-toggle-btn {
  background: none;
  border: none;
  color: #c9cae0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar-toggle-btn:hover {
  background-color: var(--fq-sidebar-hover-bg, #29354a);
  color: #ffffff;
}

/* Sidebar navigation (dark surface) */
.sidebar-nav {
  padding: 1rem 0.75rem;
}

.sidebar-nav .nav-link {
  color: #c9cae0;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar-nav .nav-link:hover {
  background-color: var(--fq-sidebar-hover-bg, #29354a);
  color: #ffffff;
}

/* Active item: translucent blue fill + a crisp left accent stripe via an inset shadow (which
   auto-clips to border-radius, unlike a real border-left, so the pill stays fully rounded) plus
   a soft outer glow. Replaces the old flat solid-purple pill. */
.sidebar-nav .nav-link.active {
  background-color: rgba(20, 184, 166, 0.18);
  color: #ffffff;
  box-shadow: inset 3px 0 0 0 var(--fq-accent-teal, #14b8a6), 0 2px 10px rgba(20, 184, 166, 0.2);
}

.sidebar-nav .nav-link.disabled {
  color: #7b7e9e;
  cursor: default;
}

.sidebar-nav .nav-link.disabled:hover {
  background-color: transparent;
  color: #7b7e9e;
}

.sidebar-nav-divider {
  margin: 1.25rem 0.75rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fq-text-label, #64748b);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav-divider:first-child {
  margin-top: 0.25rem;
}

/* Small muted "Soon" pill beside not-yet-available integrations, distinct from a disabled item's
   own muted text so it doesn't wash out against it. */
.nav-badge {
  margin-left: auto;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background-color: rgba(168, 177, 199, 0.16);
  color: var(--fq-text-secondary, #94a3b8);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

#sidebarOffcanvas {
  --bs-offcanvas-bg: var(--fq-sidebar-bg, #1e293b);
  --bs-offcanvas-color: #c9cae0;
  --bs-offcanvas-border-color: rgba(255, 255, 255, 0.08);
}

/* Compact bottom user area, pinned below the nav list. */
.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.25rem 0.6rem;
  font-size: 0.72rem;
  color: var(--fq-text-secondary, #94a3b8);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  flex-shrink: 0;
}

.sidebar-footer-user-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 0.4rem 0.4rem;
  color: #ffffff;
  transition: background-color 0.18s ease;
}

.sidebar-footer-user-btn:hover {
  background-color: var(--fq-sidebar-hover-bg, #29354a);
}

.sidebar-footer-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background-color: var(--fq-brand-orange, #ff8a00);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-footer-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  flex: 1 1 auto;
}

.sidebar-footer-settings {
  color: var(--fq-text-secondary, #94a3b8);
  flex-shrink: 0;
}

/* Collapsed desktop sidebar: icon-only rail. Always scoped under .app-sidebar (never a bare
   .sidebar-nav/.nav-text selector) so the mobile offcanvas - which renders the same
   _SidebarNav.cshtml partial - is never affected. */
html.sidebar-collapsed .app-sidebar {
  width: 72px;
}

html.sidebar-collapsed .app-sidebar .nav-text,
html.sidebar-collapsed .app-sidebar .sidebar-nav-divider,
html.sidebar-collapsed .app-sidebar .sidebar-brand-text {
  display: none;
}

/* Collapsed brand row: the mark stays visible (per design), the wordmark/subtitle hide via the
   shared .nav-text rule above, and the row stacks into a centred column so the icon and the
   toggle button don't have to compete for ~48px of width side-by-side. */
html.sidebar-collapsed .app-sidebar .sidebar-brand {
  flex-direction: column;
  padding: 0.9rem 0.5rem;
  gap: 0.6rem;
}

html.sidebar-collapsed .app-sidebar .sidebar-brand-link {
  justify-content: center;
}

html.sidebar-collapsed .app-sidebar .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

html.sidebar-collapsed .app-sidebar .sidebar-toggle-btn .bi::before {
  content: "\f285"; /* bi-chevron-right */
}

html.sidebar-collapsed .app-sidebar .sidebar-footer-user-btn {
  justify-content: center;
  padding: 0.4rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar {
    transition: none;
  }
}

/* Indian commercial-vehicle plate styling for registration numbers (BRD §7.1) - kept compact
   rather than a full oversized plate replica: thin border, tight padding, soft depth shadow. */
.plate {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid #1a1a1a;
  border-radius: 6px;
  background-color: #f4c430;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.15);
  font-family: "Courier New", Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #111;
  overflow: hidden;
}

.plate-segment {
  padding: 0.1rem 0.35rem;
  border-right: 1px solid rgba(0, 0, 0, 0.3);
}

.plate-segment:last-child {
  border-right: none;
}

.plate-sm {
  font-size: 0.8rem;
}

/* Dashboard stat cards + KPI hero cards share the top accent-bar treatment */
.stat-card,
.kpi-hero-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before,
.kpi-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--stat-accent, var(--bs-primary));
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  font-size: 1.3rem;
}

.stat-card .stat-card-value {
  line-height: 1.1;
}

.kpi-hero-value {
  font-size: 2.1rem;
  line-height: 1.1;
}

/* Flat enterprise stat-card variant (Vehicle Master fleet-status row) - white surface, thin top
   accent bar, and a compact tinted icon chip instead of a solid-fill circle + decorative
   watermark. Decoupled from .stat-card::before above so Dashboard/Compliance's StatCardViewComponent
   (which still uses .stat-card) is unaffected. */
.stat-card-flat {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.stat-card-flat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--stat-accent, var(--bs-primary));
}

.stat-card-flat-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  font-size: 1.05rem;
}

/* Compact toolbar buttons (page header actions): consistent 42px height, 8px radius, with a
   tasteful hover lift so the whole toolbar (header + filter bar) feels more premium. */
.btn-toolbar-action {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-toolbar-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30, 41, 59, 0.12);
}

/* Import: a distinct professional accent (teal, reused from the sidebar active state) instead of
   plain gray, so it doesn't read as a muted/disabled secondary action. */
.btn-import {
  border: 1px solid var(--fq-accent-teal, #14b8a6);
  color: var(--fq-accent-teal, #14b8a6);
  background-color: #fff;
}

.btn-import:hover {
  background-color: rgba(20, 184, 166, 0.1);
  border-color: var(--fq-accent-teal, #14b8a6);
  color: var(--fq-accent-teal, #14b8a6);
}

/* Brand teal button variants, using Bootstrap 5.3's per-component CSS-variable API so they layer
   cleanly on top of .btn / .btn-toolbar-action without touching the global --bs-primary token
   (which also drives the sidebar, links, and focus rings). Used for the app's primary CTAs: Add
   Vehicle, Search, Save, New Hiring. */
.btn-teal {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--fq-accent-teal, #14b8a6);
  --bs-btn-border-color: var(--fq-accent-teal, #14b8a6);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #109384;
  --bs-btn-hover-border-color: #0e7d70;
  --bs-btn-focus-shadow-rgb: 20, 184, 166;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0e7d70;
  --bs-btn-active-border-color: #0e7d70;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--fq-accent-teal, #14b8a6);
  --bs-btn-disabled-border-color: var(--fq-accent-teal, #14b8a6);
}

.btn-outline-teal {
  --bs-btn-color: var(--fq-accent-teal, #14b8a6);
  --bs-btn-border-color: var(--fq-accent-teal, #14b8a6);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--fq-accent-teal, #14b8a6);
  --bs-btn-hover-border-color: var(--fq-accent-teal, #14b8a6);
  --bs-btn-focus-shadow-rgb: 20, 184, 166;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--fq-accent-teal, #14b8a6);
  --bs-btn-active-border-color: var(--fq-accent-teal, #14b8a6);
  --bs-btn-disabled-color: var(--fq-accent-teal, #14b8a6);
  --bs-btn-disabled-border-color: var(--fq-accent-teal, #14b8a6);
}

/* Driver name link (table): refined medium-weight blue instead of Bootstrap's default purple
   link color or an overly bright blue. */
.driver-name-link {
  color: #1d4ed8;
  font-weight: 500;
  text-decoration: none;
}

.driver-name-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Small bullet-dot prefix for status badges (e.g. "● Active"), inherits the badge's text color. */
.status-badge-dot {
  font-size: 0.5rem;
  vertical-align: middle;
  margin-right: 0.35rem;
}

/* Reset/clear actions (full filter reset + inline search clear): neutral at rest, tints toward
   danger on hover so it visually reads as "this clears something". */
.btn-clear-action {
  color: var(--fq-text-label, #64748b);
}

.btn-clear-action:hover {
  background-color: var(--bs-danger-bg-subtle);
  border-color: var(--bs-danger-border-subtle);
  color: var(--bs-danger-text-emphasis);
}

/* "View a related record" navigation buttons (e.g. Compliance Document -> Vehicle Details):
   primary-blue tint on hover, matching the "View" meaning already used for row-action icon
   buttons elsewhere in the app. */
.btn-view-action:hover {
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
  color: var(--bs-primary-text-emphasis);
}

/* Driver avatar (photo, or a colored initials circle when no photo has been uploaded). */
.driver-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.driver-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--fq-brand-orange, #ff8a00);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
}

.driver-avatar-sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 0.75rem;
}

/* Preserves saved line breaks in multi-line text fields (e.g. driver Address) without needing
   Html.Raw/manual <br> injection. */
.text-multiline {
  white-space: pre-line;
}

/* Filter toolbar (Vehicle Master search/filter card): taller inputs, softer borders than the
   Bootstrap default, consistent radius. Scoped so it doesn't affect other forms. */
.filter-toolbar .form-control,
.filter-toolbar .form-select {
  height: 42px;
  border-radius: 0.5rem;
  border-color: #d9dee7;
}

.filter-toolbar .input-group-text {
  border-color: #d9dee7;
  border-radius: 0.5rem 0 0 0.5rem;
}

/* Inline clear ("x") button sitting inside the search input-group, shown only while it has text
   (toggled via site.js). */
.search-input-clearable {
  padding-right: 2.25rem;
}

.search-clear-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  border: none;
  background: none;
  padding: 0;
  line-height: 1;
  color: #adb5bd;
  z-index: 5;
}

.search-clear-btn.is-visible {
  display: inline-flex;
}

.search-clear-btn:hover {
  color: var(--bs-danger);
}

/* Enterprise data-table treatment: rounded container, muted uppercase header row, taller rows. */
.table-modern-card {
  border-radius: 1rem;
  overflow: hidden;
}

.table-modern thead th {
  background-color: var(--bs-secondary-bg-subtle);
  color: var(--fq-text-label, #64748b);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(30, 41, 59, 0.08);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  white-space: nowrap;
}

.table-modern tbody td {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  vertical-align: middle;
}

.table-modern tbody tr {
  transition: background-color 0.15s ease;
}

.table-modern tbody tr:hover {
  --bs-table-hover-bg: var(--bs-primary-bg-subtle);
}

/* Square icon-only row action buttons, replacing the old btn-group outline pair. View/Edit each
   get a distinct hover tint matching their intent, plus a small lift for a more modern feel. */
.btn-icon-action {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid #d9dee7;
  background-color: #fff;
  color: var(--fq-text-label, #64748b);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-icon-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(30, 41, 59, 0.12);
}

.btn-icon-view:hover {
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
  color: var(--bs-primary-text-emphasis);
}

.btn-icon-edit:hover {
  background-color: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
  color: var(--bs-warning-text-emphasis);
}

.btn-icon-renew:hover {
  background-color: rgba(20, 184, 166, 0.1);
  border-color: var(--fq-accent-teal, #14b8a6);
  color: var(--fq-accent-teal, #14b8a6);
}

/* Compact mobile card representation of a table row, used below the md breakpoint. */
.vehicle-mobile-card {
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 0.75rem;
}

.vehicle-mobile-card + .vehicle-mobile-card {
  margin-top: 0.75rem;
}

/* Pagination: rounded pill page-links instead of Bootstrap's default square-joined group. */
.pagination .page-link {
  border-radius: 0.5rem;
  margin: 0 0.15rem;
  border-color: #d9dee7;
  color: var(--fq-text-label, #64748b);
}

.pagination .page-item.active .page-link {
  background-color: var(--fq-accent-teal, #14b8a6);
  border-color: var(--fq-accent-teal, #14b8a6);
}

.pagination .page-item.disabled .page-link {
  border-color: #e7eaf0;
}

/* Compliance summary bar */
.compliance-bar {
  height: 10px;
}

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

/* Chart cards (doughnuts, category bar charts) */
.chart-canvas-wrap {
  position: relative;
  height: 220px;
}

/* Dashboard page header: a low-contrast branded banner (not a marketing hero) — dark text on a
   soft tint so it stays readable and reads as enterprise, not promotional. */
.dashboard-hero-header {
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  background-image: linear-gradient(120deg, var(--bs-primary-bg-subtle) 0%, rgba(20, 184, 166, 0.12) 100%);
  border: 1px solid rgba(30, 41, 59, 0.06);
}

.dashboard-hero-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  font-size: 1.3rem;
  border-radius: 0.65rem;
  background-color: rgba(255, 255, 255, 0.65);
  color: var(--bs-primary);
}

.dashboard-hero-date-badge {
  border-radius: 0.5rem;
  background-color: rgba(255, 255, 255, 0.65);
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  color: var(--fq-text-label, #64748b);
}

/* Dashboard/summary card headers: a small icon chip in front of the card title, echoing
   .stat-card-icon's treatment but sized down for a header row rather than a stat row. */
.card-icon-chip {
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Vahan-Assisted Data Capture: drag-and-drop upload target. Dashed border reads as "drop zone"
   without needing a library; teal accent + tint on drag-over gives clear affordance. */
.upload-dropzone {
  border: 2px dashed #d9dee7;
  border-radius: 0.75rem;
  background-color: #f8fafc;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--fq-accent-teal, #14b8a6);
  background-color: rgba(20, 184, 166, 0.06);
}

.upload-dropzone-icon {
  font-size: 2rem;
  color: var(--fq-accent-teal, #14b8a6);
}

/* Selected-file summary row shown once a document is chosen, replacing the dropzone prompt. */
.upload-file-summary {
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.upload-file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  object-fit: cover;
}

/* OCR-extracted field: small "OCR Detected" indicator row under each reviewed field. */
.ocr-detected-note {
  font-size: 0.75rem;
}

/* Login page: split screen matching the approved reference design - a light feature/illustration
   panel on the left and a dark navy sign-in panel on the right. Colors reuse the app's own brand
   tokens (indigo/teal/orange/purple) so the page stays on-brand. */
.login-page {
  background-color: #eef4fb;
  overflow: hidden;
}

.login-split {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.login-left {
  position: relative;
  flex: 0 0 62%;
  max-width: 62%;
  padding: 2.25rem 3rem;
  background-color: #eef4fb;
  background-image:
    linear-gradient(to bottom, rgba(238, 244, 251, 0.97) 0%, rgba(238, 244, 251, 0.94) 30%, rgba(238, 244, 251, 0.55) 52%, rgba(238, 244, 251, 0.12) 72%, rgba(238, 244, 251, 0) 90%),
    url("/img/login-hero-truck.jpg");
  background-size: cover, cover;
  background-position: center, bottom center;
  background-repeat: no-repeat, no-repeat;
  overflow: hidden;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.4rem 0.9rem;
  border-radius: 2rem;
  background-color: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-headline {
  margin-top: 0.9rem;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
}

.login-subcopy {
  margin-top: 0.65rem;
  max-width: 34rem;
  color: var(--fq-text-label, #64748b);
}

.login-subcopy-accent {
  color: var(--bs-primary);
}

.login-divider {
  width: 3rem;
  height: 3px;
  margin: 1rem 0 1.25rem;
  border: none;
  border-radius: 2px;
  background-color: var(--bs-primary);
  opacity: 1;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.login-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 0.65rem;
  font-size: 1rem;
}

.login-feature-icon-blue { background-color: rgba(37, 99, 235, 0.14); color: var(--fq-accent-blue); }
.login-feature-icon-teal { background-color: rgba(20, 184, 166, 0.14); color: var(--fq-accent-teal); }
.login-feature-icon-orange { background-color: rgba(255, 138, 0, 0.14); color: var(--fq-brand-orange); }
.login-feature-icon-purple { background-color: rgba(124, 58, 237, 0.14); color: var(--fq-accent-purple); }

.login-feature-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.login-feature-desc {
  font-size: 0.78rem;
  color: var(--fq-text-label, #64748b);
}

.login-stat-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: auto;
  margin-bottom: 1.25rem;
  padding: 1.5rem 1.5rem 1rem;
  border-radius: 1rem;
  background-color: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.3);
}

.login-stat-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.login-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.05rem;
}

.login-stat-icon-blue { background-color: var(--fq-accent-blue); box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.35); }
.login-stat-icon-green { background-color: var(--fq-accent-green); box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.35); }
.login-stat-icon-orange { background-color: var(--fq-brand-orange); box-shadow: 0 0 0 5px rgba(255, 138, 0, 0.35); }

.login-stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.login-stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.login-right {
  position: relative;
  flex: 1 1 auto;
  padding: 1.75rem 2rem 2rem;
  background-color: #0b1f3a;
  border-radius: 5rem 0 0 5rem / 50% 0 0 50%;
  overflow: hidden;
}

.login-right-brand {
  padding-left: 3rem;
  color: #fff;
}

.login-right-footer {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.login-right-footer-accent {
  color: #60a5fa;
  font-weight: 600;
}

.login-stage {
  padding: 1.5rem 0;
}

.login-glass-card {
  width: 100%;
  max-width: 400px;
  padding: 2.25rem;
  border-radius: 1.25rem;
  background-color: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.login-glass-card .btn {
  border-radius: 0.7rem;
}

.login-glass-card .btn-signin {
  background-color: #2f6fed;
  border-color: #2f6fed;
  color: #fff;
}

.login-glass-card .btn-signin:hover,
.login-glass-card .btn-signin:focus {
  background-color: #2660d0;
  border-color: #2660d0;
  color: #fff;
}

.login-forgot-link {
  color: #2f6fed;
  text-decoration: none;
  cursor: pointer;
}

.login-hero-icon {
  width: 34px;
  height: 34px;
  padding: 5px;
  border-radius: 0.6rem;
  background-color: rgba(255, 255, 255, 0.18);
}

.login-hero-brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
}

.login-card-avatar {
  width: 56px;
  height: 56px;
  padding: 8px;
  border-radius: 50%;
  background-color: var(--bs-primary-bg-subtle);
}

.login-brand-icon {
  width: 48px;
  height: 48px;
}

@media (max-width: 991.98px) {
  .login-right {
    border-radius: 0;
    padding: 1.5rem 1.25rem 2rem;
  }
}

/* Sign In CTA: gradient fill instead of flat teal, reserved for this one high-visibility button. */
.btn-gradient {
  background-image: linear-gradient(135deg, var(--fq-accent-teal, #14b8a6), var(--bs-primary, #6c63ff));
  border: none;
  color: #fff;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-gradient:hover,
.btn-gradient:focus {
  filter: brightness(1.08);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(108, 99, 255, 0.3);
}

.btn-gradient:active {
  color: #fff;
  filter: brightness(0.96);
  transform: translateY(0);
}

/* Security & Access sub-nav (Users & Roles / Audit Trail / Security Settings) - lightweight pill
   tabs, teal active state matching the rest of the app's brand accent. */
.security-sub-nav .nav-link {
  color: var(--fq-text-label, #64748b);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.security-sub-nav .nav-link:hover {
  background-color: rgba(20, 184, 166, 0.08);
  color: var(--fq-accent-teal, #14b8a6);
}

.security-sub-nav .nav-link.active {
  background-color: var(--fq-accent-teal, #14b8a6);
  color: #fff;
}

/* Password strength meter (Add User form). */
.password-strength-bar {
  height: 6px;
  border-radius: 999px;
  background-color: #e9edf3;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.2s ease, background-color 0.2s ease;
}

/* ==========================================================================
   GPS / Telematics module (claude.md Phase 2) — stylized dependency-free mock
   map, marker states, floating vehicle card, telemetry, timeline, alerts.
   ========================================================================== */

.gps-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #eef2f4;
  background-image:
    linear-gradient(135deg, #e9f0ee 0%, #e4ecf2 55%, #e9eef5 100%);
  border: 1px solid rgba(30, 41, 59, 0.08);
}

.gps-map-grid {
  position: absolute;
  inset: 0;
}

.gps-map-road {
  position: absolute;
  background-color: rgba(148, 163, 184, 0.35);
}

.gps-map-road-h {
  left: 0;
  right: 0;
  height: 10px;
  transform: translateY(-5px);
}

.gps-map-road-v {
  top: 0;
  bottom: 0;
  width: 10px;
  transform: translateX(-5px);
}

.gps-map-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}

.gps-map-marker-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.25);
  transition: transform 0.15s ease;
}

.gps-map-marker:hover .gps-map-marker-icon,
.gps-map-marker:focus-visible .gps-map-marker-icon {
  transform: scale(1.12);
}

.gps-map-marker.is-selected .gps-map-marker-icon {
  outline: 3px solid var(--bs-primary);
  outline-offset: 2px;
}

.gps-map-marker.is-moving .gps-map-marker-icon { background-color: var(--bs-success); }
.gps-map-marker.is-idle .gps-map-marker-icon { background-color: var(--bs-warning); }
.gps-map-marker.is-offline .gps-map-marker-icon { background-color: var(--bs-secondary); }
.gps-map-marker.is-alert .gps-map-marker-icon { background-color: var(--bs-danger); }

.gps-map-marker.is-alert .gps-map-marker-icon {
  animation: gps-marker-pulse 1.6s ease-in-out infinite;
}

@keyframes gps-marker-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(30, 41, 59, 0.25), 0 0 0 0 rgba(214, 69, 69, 0.5); }
  50% { box-shadow: 0 2px 8px rgba(30, 41, 59, 0.25), 0 0 0 8px rgba(214, 69, 69, 0); }
}

.gps-map-marker-arrow {
  position: absolute;
  top: -12px;
  font-size: 0.7rem;
  color: var(--fq-text-label, #64748b);
  transform-origin: center 22px;
}

.gps-map-marker-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #1e293b;
  background-color: rgba(255, 255, 255, 0.92);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(30, 41, 59, 0.15);
}

.gps-map-geofence-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  color: var(--fq-accent-purple, #7c3aed);
  font-size: 1.1rem;
  opacity: 0.75;
  z-index: 1;
}

.geofence-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  width: calc(var(--geofence-radius-px, 60px) * 2);
  height: calc(var(--geofence-radius-px, 60px) * 2);
  border-radius: 50%;
  background-color: rgba(20, 184, 166, 0.16);
  border: 2px dashed var(--fq-accent-teal, #14b8a6);
  z-index: 1;
  transition: width 0.15s ease, height 0.15s ease;
}

.geofence-overlay-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--fq-accent-teal, #14b8a6);
  transform: translate(-50%, -50%);
}

/* Floating vehicle info card shown over the map when a marker/list row is selected. */
.gps-floating-card {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 300px;
  max-width: calc(100% - 2rem);
  z-index: 5;
  border-radius: 0.75rem;
  background-color: #fff;
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.18), 0 2px 8px rgba(30, 41, 59, 0.08);
  border: 1px solid rgba(30, 41, 59, 0.06);
}

.gps-connection-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.35rem;
}

.gps-connection-dot.is-connected { background-color: var(--bs-success); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.gps-connection-dot.is-warning { background-color: var(--bs-warning); box-shadow: 0 0 0 3px rgba(226, 150, 43, 0.2); }
.gps-connection-dot.is-disconnected { background-color: var(--bs-danger); box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.2); }

/* Vehicle Tracking List rows (Live Tracking side panel). */
.gps-vehicle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gps-vehicle-row:hover {
  background-color: var(--bs-secondary-bg-subtle);
}

.gps-vehicle-row.is-selected {
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
}

.gps-telemetry-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(30, 41, 59, 0.06);
  background-color: #fff;
  padding: 1rem;
  height: 100%;
}

.gps-telemetry-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fq-text-label, #64748b);
}

.gps-telemetry-card-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
}

/* Vehicle telemetry timeline. */
.gps-timeline {
  position: relative;
  padding-left: 2.25rem;
}

.gps-timeline::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background-color: rgba(30, 41, 59, 0.1);
}

.gps-timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.gps-timeline-item:last-child {
  padding-bottom: 0;
}

.gps-timeline-icon {
  position: absolute;
  left: -2.25rem;
  top: 0;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-size: 0.85rem;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(30, 41, 59, 0.08);
}

/* GPS Alerts list rows — severity-coloured left accent, same inset-shadow pill treatment as the
   existing sidebar active-item accent (site.css .sidebar-nav .nav-link.active). */
.gps-alert-row {
  border-radius: 0.65rem;
  border: 1px solid rgba(30, 41, 59, 0.06);
  background-color: #fff;
  padding: 0.9rem 1rem;
}

.gps-alert-row.is-critical { box-shadow: inset 3px 0 0 0 var(--bs-danger); }
.gps-alert-row.is-warning { box-shadow: inset 3px 0 0 0 var(--bs-warning); }
.gps-alert-row.is-information { box-shadow: inset 3px 0 0 0 var(--bs-info); }

.gps-alert-row.is-read {
  opacity: 0.65;
}

/* Sidebar collapsible "GPS Tracking" nav group. */
.sidebar-nav-group-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
}

.sidebar-nav-group-chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

.sidebar-nav-group-toggle[aria-expanded="true"] .sidebar-nav-group-chevron {
  transform: rotate(180deg);
}

.sidebar-nav-subitem .nav-link {
  padding-left: 2.75rem;
  font-size: 0.85rem;
}

html.sidebar-collapsed .app-sidebar .sidebar-nav-subitem,
html.sidebar-collapsed .app-sidebar .sidebar-nav-group-chevron {
  display: none;
}

/* GPS Integration connection status pill. */
.gps-connection-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.gps-connection-status-pill.is-connected { background-color: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.gps-connection-status-pill.is-warning { background-color: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.gps-connection-status-pill.is-disconnected { background-color: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }

.gps-spin {
  animation: gps-spin-rotate 0.6s linear;
}

@keyframes gps-spin-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
