/* FleetDispatch admin design system.
 *
 * Mirrors the deployed React application (AdminDashboard.v2.css): a 256px
 * green-gradient sidebar with a yellow active pill, a white sticky topbar,
 * a cool-grey page background and white cards.
 *
 * Kept as a plain stylesheet (not a Tailwind layer) so the admin shell can be
 * restyled without a Node build step. Loaded after {% tailwind_css %} in
 * base.html, so these rules win at equal specificity.
 */

:root {
  --fd-bg: #f1f4f8;
  --fd-surface: #ffffff;
  --fd-text: #0f172a;
  --fd-muted: #64748b;
  --fd-border: rgba(15, 23, 42, 0.10);
  --fd-border-strong: rgba(15, 23, 42, 0.16);
  --fd-shadow-sm: 0 1px 3px rgba(2, 6, 23, 0.06), 0 2px 8px rgba(2, 6, 23, 0.04);
  --fd-shadow: 0 8px 24px rgba(2, 6, 23, 0.10), 0 1px 4px rgba(2, 6, 23, 0.06);
  --fd-brand: #006205;
  --fd-brand-2: #004a1f;
  --fd-accent: #fdd117;
  --fd-radius: 12px;
  --fd-focus: 0 0 0 3px rgba(0, 98, 5, 0.22);
}

/* ── Shell ─────────────────────────────────────────────────────────────── */

.fd-shell {
  display: flex;
  min-height: 100vh;
  background: var(--fd-bg);
  color: var(--fd-text);
  font-family: "Inter", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--fd-bg);
}

.fd-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex: 0 0 256px;
  flex-direction: column;
  gap: 2px;
  width: 256px;
  height: 100vh;
  padding: 20px 14px;
  color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(180deg, var(--fd-brand) 0%, var(--fd-brand-2) 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04), 6px 0 24px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
}

.fd-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.fd-logo-main {
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
  line-height: 0;
}

.fd-logo-main img {
  display: block;
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 8px;
}

.fd-logo-caption {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.fd-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background 150ms ease, color 150ms ease;
}

.fd-nav:hover {
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.96);
}

.fd-nav.is-active {
  background: var(--fd-accent);
  color: #0d2110;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(253, 209, 23, 0.28);
}

.fd-nav-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 150ms ease;
}

.fd-nav.is-active .fd-nav-icon {
  background: rgba(0, 0, 0, 0.10);
}

.fd-nav-icon svg {
  width: 15px;
  height: 15px;
}

.fd-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--fd-accent);
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.fd-nav.is-active .fd-nav-badge {
  background: rgba(0, 0, 0, 0.18);
  color: #0d2110;
}

.fd-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: auto;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
  white-space: nowrap;
}

.fd-sidebar-footer span {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.fd-sidebar-footer .fd-year {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.32);
}

/* ── Main column / topbar ──────────────────────────────────────────────── */

.fd-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  background: var(--fd-bg);
}

.fd-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--fd-border);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
}

.fd-topbar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--fd-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.fd-hamburger {
  display: none;
  padding: 7px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: #fff;
  color: var(--fd-text);
  cursor: pointer;
}

.fd-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--fd-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fd-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.fd-live.is-on {
  background: #dcfce7;
  color: #15803d;
}

.fd-live.is-on .fd-live-dot {
  background: #16a34a;
}

.fd-live.is-off {
  background: #fef2f2;
  color: #b91c1c;
}

.fd-live.is-off .fd-live-dot {
  background: #dc2626;
}

.fd-user {
  position: relative;
}

.fd-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--fd-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.fd-user-btn:hover {
  border-color: var(--fd-border-strong);
  box-shadow: var(--fd-shadow-sm);
}

.fd-avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.fd-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.fd-user-name {
  max-width: 160px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fd-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-user-role {
  font-size: 10.5px;
  color: var(--fd-muted);
}

.fd-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  display: none;
  width: 250px;
  padding: 8px;
  border: 1px solid var(--fd-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--fd-shadow);
}

.fd-user-menu.is-open {
  display: block;
}

.fd-user-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--fd-border);
}

.fd-user-menu-head strong {
  display: block;
  font-size: 13px;
}

.fd-user-menu-head span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 11px;
  color: var(--fd-muted);
  text-overflow: ellipsis;
}

.fd-user-menu a,
.fd-user-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--fd-text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.fd-user-menu a:hover,
.fd-user-menu button:hover {
  background: #f1f5f9;
}

.fd-user-menu .fd-signout {
  color: #b91c1c;
}

.fd-content {
  flex: 1;
  padding: 20px 24px 44px;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.fd-card {
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius);
  background: var(--fd-surface);
  box-shadow: var(--fd-shadow-sm);
}

.fd-card:last-child {
  margin-bottom: 0;
}

.fd-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--fd-border);
  background: #fdfdfe;
}

.fd-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.1px;
  color: var(--fd-text);
}

.fd-card-body {
  padding: 18px;
}

.fd-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.fd-muted {
  color: var(--fd-muted);
}

.fd-small {
  font-size: 11.5px;
}

/* ── Tables ────────────────────────────────────────────────────────────── */

.fd-table-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fd-table thead th {
  padding: 10px 16px;
  border-bottom: 1.5px solid rgba(2, 6, 23, 0.09);
  background: #f8fafc;
  color: var(--fd-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.fd-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(2, 6, 23, 0.06);
  vertical-align: middle;
  overflow-wrap: break-word;
}

.fd-table tbody tr {
  transition: background-color 120ms ease;
}

.fd-table tbody tr:hover td {
  background: #f8fafc;
}

.fd-table tbody tr:last-child td {
  border-bottom: 0;
}

.fd-table .fd-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fd-empty {
  padding: 40px 16px;
  color: var(--fd-muted);
  text-align: center;
}

.fd-empty svg {
  margin: 0 auto 8px;
  opacity: 0.4;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.fd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: #fff;
  color: var(--fd-text);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease, background 160ms ease,
    border-color 160ms ease;
}

.fd-btn:hover {
  border-color: var(--fd-border-strong);
  box-shadow: var(--fd-shadow-sm);
  transform: translateY(-1px);
}

.fd-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.fd-btn:focus-visible {
  outline: none;
  box-shadow: var(--fd-focus);
}

.fd-btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.fd-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
  color: #fff;
}

.fd-btn-primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #007a08, #005c27);
}

.fd-btn-amber {
  border-color: transparent;
  background: linear-gradient(135deg, #ffe580, #fdd117);
  color: #0d2110;
}

.fd-btn-danger {
  border-color: rgba(185, 28, 28, 0.28);
  background: #fff;
  color: #b91c1c;
}

.fd-btn-danger:hover {
  background: #fef2f2;
}

.fd-btn-blue {
  border-color: transparent;
  background: #2563eb;
  color: #fff;
}

.fd-btn-blue:hover {
  background: #1d4ed8;
}

.fd-btn-sm {
  padding: 6px 10px;
  font-size: 11.5px;
}

.fd-btn-icon {
  padding: 6px;
  border-radius: 7px;
}

/* ── Badges ────────────────────────────────────────────────────────────── */

.fd-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
  white-space: nowrap;
}

.fd-pill::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.fd-pill.is-plain::before {
  display: none;
}

.fd-green {
  border-color: #86efac;
  background: #dcfce7;
  color: #15803d;
}

.fd-amber {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #92400e;
}

.fd-red {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}

.fd-slate {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.fd-blue {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.fd-violet {
  border-color: #c4b5fd;
  background: #ede9fe;
  color: #5b21b6;
}

/* ── Tabs ──────────────────────────────────────────────────────────────── */

.fd-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.fd-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fd-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.fd-tab:hover {
  background: #f1f5f9;
  color: var(--fd-text);
}

.fd-tab.is-active {
  background: #0f172a;
  color: #fff;
}

.fd-tab .fd-count {
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

.fd-tab.is-active .fd-count {
  background: var(--fd-accent);
  color: #0d2110;
}

/* ── KPI cards ─────────────────────────────────────────────────────────── */

.fd-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.fd-kpi {
  position: relative;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid var(--fd-border);
  border-top: 3px solid var(--fd-brand);
  border-radius: var(--fd-radius);
  background: #fff;
  box-shadow: var(--fd-shadow-sm);
}

.fd-kpi.is-amber { border-top-color: #f59e0b; }
.fd-kpi.is-blue { border-top-color: #3b82f6; }
.fd-kpi.is-red { border-top-color: #dc2626; }
.fd-kpi.is-violet { border-top-color: #6366f1; }

.fd-kpi-label {
  margin: 0;
  padding-right: 44px;
  color: var(--fd-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fd-kpi-value {
  margin: 6px 0 0;
  font-size: 25px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--fd-text);
}

.fd-kpi-note {
  margin: 7px 0 0;
  color: var(--fd-muted);
  font-size: 11.5px;
}

.fd-kpi-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(0, 98, 5, 0.10);
  color: var(--fd-brand);
}

.fd-kpi.is-amber .fd-kpi-icon { background: #fef3c7; color: #b45309; }
.fd-kpi.is-blue .fd-kpi-icon { background: #dbeafe; color: #1d4ed8; }
.fd-kpi.is-red .fd-kpi-icon { background: #fee2e2; color: #b91c1c; }
.fd-kpi.is-violet .fd-kpi-icon { background: #e0e7ff; color: #4338ca; }

/* ── Toolbar / filters ─────────────────────────────────────────────────── */

.fd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.fd-search {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 160px;
  max-width: 290px;
  padding: 7px 12px;
  border: 1px solid var(--fd-border);
  border-radius: 9px;
  background: #fff;
}

.fd-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--fd-text);
}

.fd-search input::placeholder {
  color: #94a3b8;
}

.fd-select {
  padding: 7px 30px 7px 11px;
  border: 1px solid var(--fd-border);
  border-radius: 9px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--fd-text);
  font-size: 12.5px;
  font-weight: 600;
  appearance: none;
}

.fd-select:focus {
  outline: none;
  border-color: var(--fd-brand);
  box-shadow: var(--fd-focus);
}

/* ── Vehicle card grid ─────────────────────────────────────────────────── */

.fd-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.fd-vehicle {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius);
  background: #fff;
  box-shadow: var(--fd-shadow-sm);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.fd-vehicle:hover {
  box-shadow: var(--fd-shadow);
  transform: translateY(-1px);
}

.fd-vehicle-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #0b6b12 0%, #004a1f 100%);
  color: #fff;
}

.fd-vehicle-head.is-onduty {
  background: linear-gradient(135deg, #1e5a3a 0%, #0f3d24 100%);
}

.fd-vehicle-head.is-repair {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.fd-vehicle-head.is-out {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
}

.fd-vehicle-head .fd-head-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.fd-vehicle-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.fd-head-pill {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fd-vehicle-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
}

.fd-plate {
  align-self: center;
  padding: 4px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--fd-text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.fd-vehicle-name {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.fd-vehicle-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--fd-muted);
  font-size: 11.5px;
}

.fd-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.fd-vehicle-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

/* ── Month / log groups ────────────────────────────────────────────────── */

.fd-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--fd-border);
  border-bottom: 1px solid var(--fd-border);
  background: #f8fafc;
  color: var(--fd-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fd-group-head span {
  color: var(--fd-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.fd-notice {
  display: flex;
  gap: 10px;
  margin: 12px 16px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
}

.fd-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Dashboard extras ──────────────────────────────────────────────────── */

.fd-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.fd-split-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.fd-list {
  display: flex;
  flex-direction: column;
}

.fd-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
}

.fd-list-row:last-child {
  border-bottom: 0;
}

.fd-chart {
  padding: 4px 0 0;
}

.fd-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
  .fd-vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .fd-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

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

  .fd-hamburger {
    display: inline-flex;
  }

  .fd-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: none;
    background: rgba(2, 6, 23, 0.45);
  }

  .fd-overlay.is-open {
    display: block;
  }

  .fd-split,
  .fd-split-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .fd-content { padding: 14px 12px 32px; }
  .fd-topbar { padding: 0 14px; }
  .fd-topbar h1 { font-size: 16px; }
  .fd-user-meta { display: none; }
  .fd-vehicle-grid { grid-template-columns: minmax(0, 1fr); }
  .fd-kpis { grid-template-columns: minmax(0, 1fr); }
  .fd-search { max-width: none; }
}

/* DaisyUI modals: match the card language. */
.modal-box {
  border-radius: 14px;
  border: 1px solid var(--fd-border);
  box-shadow: 0 24px 60px -20px rgba(2, 6, 23, 0.45);
}

/* Sidebar nav container (children are the .fd-nav links). */
.fd-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Bar chart ─────────────────────────────────────────────────────────── */

.fd-bars {
  display: flex;
  align-items: stretch;
  gap: 12px;
  height: 190px;
  padding: 4px 2px 0;
}

.fd-bar-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fd-bar-track {
  display: flex;
  flex: 1;
  align-items: flex-end;
  width: 100%;
}

.fd-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #1f8a2a 0%, #006205 100%);
}

.fd-bar-label {
  color: var(--fd-muted);
  font-size: 11px;
  font-weight: 700;
}

.fd-bar-value {
  color: var(--fd-muted);
  font-size: 10px;
  white-space: nowrap;
}

/* Table cells that should not wrap mid-number. */
.fd-nowrap { white-space: nowrap; }

/* Inline assignment selects inside a booking row. */
.fd-row-form .fd-select {
  width: 100%;
  min-width: 150px;
  max-width: 230px;
  font-size: 11.5px;
}

@media (max-width: 720px) {
  .fd-bars { gap: 6px; }
  .fd-bar-value { display: none; }
}

/* A group header rendered as a <td colspan>: keep it a table cell, but lay
   its two labels out on one line. */
td.fd-group-head {
  display: table-cell;
  padding: 9px 16px;
  border-top: 1px solid var(--fd-border);
  border-bottom: 1px solid var(--fd-border);
  background: #f8fafc;
  color: var(--fd-text);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

td.fd-group-head span {
  float: right;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fd-muted);
}

.fd-card-head .fd-toolbar {
  flex-wrap: nowrap;
  margin: 0;
}

@media (max-width: 900px) {
  .fd-card-head .fd-toolbar { flex-wrap: wrap; }
  .fd-search { flex-basis: 100%; max-width: none; }
}

.fd-toolbar-inline { flex-wrap: nowrap; }
@media (max-width: 900px) { .fd-toolbar-inline { flex-wrap: wrap; } }

/* ══ Overview: KPI strip, active-trip strip, calendar, mission control ══ */

.fd-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.fd-kpi2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--fd-border);
  border-left: 4px solid var(--fd-brand);
  border-radius: var(--fd-radius);
  background: #fff;
  box-shadow: var(--fd-shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.fd-kpi2:hover {
  box-shadow: var(--fd-shadow);
  transform: translateY(-1px);
}

.fd-kpi2-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.fd-kpi2-label {
  margin: 0;
  color: var(--fd-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fd-kpi2-value {
  margin: 1px 0 0;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--fd-text);
}

.fd-kpi2-value span {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.fd-kpi2-note {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 1px 0 0;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
}

.fd-kpi2-note.is-warn {
  color: #d97706;
}

.fd-cond-bar {
  display: flex;
  gap: 1px;
  height: 7px;
  margin: 6px 0 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #e2e8f0;
}

.fd-cond-bar span {
  display: block;
}

.fd-cond-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
}

/* Active trips strip */
.fd-onroad {
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #006205;
  border-radius: 10px;
  background: linear-gradient(90deg, #004a1f 0%, #006205 100%);
  box-shadow: 0 1px 6px rgba(0, 98, 5, 0.22);
}

.fd-onroad-label {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.fd-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fdd117;
  box-shadow: 0 0 6px #fdd117;
  animation: fdPulse 1.6s ease-in-out infinite;
}

@keyframes fdPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

.fd-onroad-list {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  overflow-x: auto;
}

.fd-onroad-chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #f0fdf4;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.fd-onroad-chip small {
  color: #bbf7d0;
  font-weight: 500;
}

/* Calendar layout */
.fd-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

.fd-cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.fd-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fd-cal-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--fd-muted);
  font-size: 10px;
  font-weight: 700;
}

.fd-cal-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.fd-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 5px 8px 2px;
}

.fd-cal-dow span {
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

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

.fd-cal-cell {
  display: flex;
  flex-direction: column;
  min-height: 76px;
  padding: 3px 4px;
  border: 1px solid #e8edf5;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: background 100ms ease, border-color 100ms ease;
}

.fd-cal-cell.is-empty {
  border-color: transparent;
  background: transparent;
}

.fd-cal-cell.has-bookings {
  border-color: #d1fae5;
  background: #fafcff;
}

.fd-cal-cell.is-today,
.fd-cal-cell.is-selected {
  border: 2px solid #006205;
  background: #f0fdf4;
}

.fd-cal-cell.is-selected {
  background: #ecfdf5;
}

.fd-cal-cell.is-overdue {
  border-color: #fca5a5;
  background: #fff7f7;
}

.fd-cal-cell:hover:not(.is-empty) {
  border-color: #94a3b8;
}

.fd-cal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.fd-cal-num {
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.fd-cal-cell.is-today .fd-cal-num,
.fd-cal-cell.is-selected .fd-cal-num {
  color: #006205;
  font-weight: 900;
}

.fd-cal-total {
  padding: 1px 4px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.4;
}

.fd-cal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: auto;
}

.fd-cal-chip {
  padding: 0 4px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
}

.fd-cal-hint {
  padding: 3px 12px 8px;
  border-top: 1px solid #f1f5f9;
  color: #cbd5e1;
  font-size: 10px;
  font-style: italic;
  text-align: center;
}

/* Mission-control cards */
.fd-mission {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.fd-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.fd-mini-head strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fd-text);
}

.fd-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fd-alert-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fd-alert-head a {
  color: #dc2626;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.fd-day-group {
  margin-bottom: 10px;
}

.fd-day-group:last-child {
  margin-bottom: 0;
}

.fd-day-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fd-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 4px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
}

.fd-day-row:last-child {
  border-bottom: 0;
}

.fd-op-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid;
  border-radius: 8px;
  text-decoration: none;
  transition: box-shadow 140ms ease;
}

.fd-op-row:hover {
  box-shadow: var(--fd-shadow-sm);
}

.fd-op-row .num {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.fd-fin-bar {
  display: flex;
  gap: 1px;
  height: 5px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 3px;
}

.fd-fin-bar span {
  display: block;
}

.fd-fin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.fd-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
}

@media (max-width: 1280px) {
  .fd-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-calendar-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .fd-kpi-strip { grid-template-columns: minmax(0, 1fr); }
  .fd-cal-cell { min-height: 58px; }
  .fd-cal-dow span { font-size: 9px; }
  .fd-cal-legend { display: none; }
}
