/* ─────────────────────────────────────────────────────────
   TLN Hub — Main Stylesheet
   ───────────────────────────────────────────────────────── */
:root {
  --tln-navy:          #0a1933;
  --tln-navy-2:        #122a55;
  --tln-gray:          #f2f4f7;
  --tln-card:          #ffffff;
  --tln-border:        #d6dbe3;
  --tln-text:          #111827;
  --tln-muted:         #4b5563;
  --tln-accent:        #2b6cb0;
  --tln-accent-2:      #1e4e8c;
  --success:           #0f5132;
  --success-bg:        #e7f7ee;
  --success-border:    #b7ebc6;
  --error:             #842029;
  --error-bg:          #f8d7da;
  --error-border:      #f5c2c7;
  --warning:           #7a5b00;
  --warning-bg:        #fff3cd;
  --warning-border:    #ffe69c;
  --shadow:            0 6px 18px rgba(0,0,0,0.08);
  --radius:            14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Lexend', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tln-text);
  background: var(--tln-gray);
  line-height: 1.5;
  font-size: 15px;
}

/* ── Layout ──────────────────────────────────────────────── */
.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: var(--tln-card);
  border: 1px solid var(--tln-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1 1 400px; min-width: 400px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-header h1,
.page-header h2 { margin: 0; }

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3 { color: var(--tln-text); margin: 0 0 8px; }

/* ── Forms ───────────────────────────────────────────────── */
label {
  display: block;
  font-weight: 700;
  margin: 10px 0 6px;
  font-size: 15px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--tln-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--tln-accent);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.14);
}

textarea { min-height: 90px; resize: vertical; }

.label-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  cursor: pointer;
}

.label-inline input[type="checkbox"] { width: auto; margin: 0; }

.field-error input,
.field-error select,
.field-error textarea { border-color: #dc3545; }

.field-error-text {
  color: #dc3545;
  font-size: 13px;
  margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--tln-accent); color: #fff; }
.btn-primary:hover { background: var(--tln-accent-2); }

.btn-light { background: #e8eefc; color: var(--tln-accent-2); }
.btn-light:hover { background: #d6e4f7; }

.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; }

.btn-warning { background: #e57c00; color: #fff; border: none; }
.btn-warning:hover { background: #c96c00; }

.btn-sm { padding: 6px 12px; font-size: 14px; }

/* ── Topbar / Nav ────────────────────────────────────────── */
.topbar {
  background: linear-gradient(90deg, var(--tln-navy) 0%, var(--tln-navy-2) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 180px;
  text-decoration: none;
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.62);
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  white-space: nowrap;
}

.nav-link:hover { background: rgba(255,255,255,0.16); }

/* Dropdown (Invoices, Username) */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
  user-select: none;
}

.nav-dropdown-toggle:hover { background: rgba(255,255,255,0.16); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--tln-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  z-index: 200;
  overflow: hidden;
}


.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 9px 16px;
  color: var(--tln-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.1s;
}

.nav-dropdown-menu a:hover { background: var(--tln-gray); }

.nav-dropdown-menu .menu-divider {
  height: 1px;
  background: var(--tln-border);
  margin: 4px 0;
}

/* ── Flash messages ──────────────────────────────────────── */
.msg {
  margin: 12px 0;
  padding: 11px 16px;
  border-radius: 10px;
  border-left: 4px solid var(--tln-border);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.msg-success {
  border-left-color: #28a745;
  background: var(--success-bg);
  color: var(--success);
}

.msg-error {
  border-left-color: #dc3545;
  background: var(--error-bg);
  color: var(--error);
}

/* ── Stat cards (admin dashboard) ───────────────────────── */
.stat-card {
  flex: 1 1 240px;
  border: 1px solid var(--tln-border);
  border-radius: 14px;
  padding: 16px 18px;
  background: #fff;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--tln-text);
  line-height: 1.1;
}

/* ── Tables ──────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
  font-size: 15px;
}

th {
  font-weight: 800;
  border-bottom: 2px solid #e5e7eb;
  background: #f7f8fa;
}

tbody tr:nth-child(even) { background: #fafbfc; }
tbody tr:hover { background: #eef4ff; transition: background 0.1s; }

.td-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-ok, .badge-active {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.badge-inactive {
  background: #f1f3f5;
  border-color: #dee2e6;
  color: #6c757d;
}

.badge-admin {
  background: #e7eeff;
  border-color: #c0cff7;
  color: #1e3a7a;
}

/* ── Hint text ───────────────────────────────────────────── */
.hint {
  font-size: 13px;
  color: var(--tln-muted);
  margin-top: 4px;
}

/* ── Library autocomplete ────────────────────────────────── */
.suggestions {
  border: 1px solid #cfd6df;
  border-radius: 10px;
  background: #fff;
  max-height: 220px;
  overflow: auto;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.09);
}

.suggestions button {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
}

.suggestions button:hover { background: #f3f4f6; }

/* ── Filter / search bar ─────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .filter-field { min-width: 220px; }

/* ── Library card (admin edit list) ─────────────────────── */
.lib-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 14px;
  background: #fff;
}

/* ── Toggle switch ───────────────────────────────────────── */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: #cfd6df;
  border-radius: 12px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-switch input:checked + .toggle-track { background: var(--tln-accent); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* ── Invoice form footer ─────────────────────────────────── */
.form-footer {
  margin-top: 18px;
  border-top: 1px solid var(--tln-border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fee-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.fee-amount-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e7eeff;
  border: 1px solid #c0cff7;
  color: var(--tln-navy-2);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 14px;
  font-weight: 700;
}

.form-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.total-block {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.total-label {
  font-size: 12px;
  color: var(--tln-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--tln-text);
  line-height: 1.1;
}

/* ── Password show/hide ──────────────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--tln-muted); line-height: 1;
}
.pw-eye:hover { color: var(--tln-text); }
.pw-eye svg { width: 20px; height: 20px; display: block; }

/* ── Nav icons ───────────────────────────────────────────── */
.nav-icon { width: 16px; height: 16px; display: block; flex-shrink: 0; }
.nav-chevron { font-size: 11px; opacity: 0.75; }
.nav-link-icon { display: inline-flex; align-items: center; gap: 6px; }

/* ── Hamburger button ────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column; gap: 5px; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 8px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: #fff; border-radius: 2px; transition: all 0.2s;
}

/* ── Scroll wrapper for wide tables ─────────────────────── */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .brand { min-width: auto; }
  .topbar .wrap { align-items: flex-start; flex-wrap: wrap; }
  .nav { justify-content: flex-start; }
  .col { min-width: 100%; }
  .page-header { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .filter-field { min-width: auto; }
}

@media (max-width: 640px) {
  /* Hamburger: show button, hide nav by default */
  .nav-hamburger { display: flex; }
  .nav {
    display: none; flex-direction: column; width: 100%;
    padding: 6px 0 10px; gap: 0;
    border-top: 1px solid rgba(255,255,255,0.10);
    margin-top: 6px;
  }
  .nav-open .nav { display: flex; }

  /* Topbar: brand + hamburger on row 1, nav on row 2 */
  .topbar .wrap { flex-wrap: wrap; padding: 10px 14px; gap: 0; align-items: center; }
  .brand { flex: 1; }

  /* Nav items: full-width left-aligned rows with dividers */
  .nav-dropdown-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 6px;
    border-radius: 0; border: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: transparent;
    width: 100%; font-size: 15px; font-weight: 600;
    justify-content: flex-start;
  }
  .nav-dropdown-toggle:hover { background: rgba(255,255,255,0.07); }
  .nav-dropdown-toggle .nav-icon { width: 20px; height: 20px; }
  .nav-dropdown-toggle .nav-chevron { margin-left: auto; font-size: 13px; opacity: 0.6; }

  /* Admin nav-link: same drawer style */
  .nav-link, .nav-link-icon {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 6px;
    border-radius: 0; border: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: transparent;
    width: 100%; font-size: 15px; font-weight: 600;
  }
  .nav-link:hover, .nav-link-icon:hover { background: rgba(255,255,255,0.07); }
  .nav-link .nav-icon, .nav-link-icon .nav-icon { width: 20px; height: 20px; }

  /* Mobile dropdowns: inline/static, indented sub-items */
  .nav-dropdown-menu {
    position: static; box-shadow: none; border: none; border-radius: 0;
    background: rgba(0,0,0,0.12); overflow: visible;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a {
    color: rgba(255,255,255,0.88); padding: 10px 10px 10px 36px;
    font-size: 14px; font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .nav-dropdown-menu a:hover { background: rgba(255,255,255,0.08); color: #fff; }
  .nav-dropdown-menu .menu-divider { background: rgba(255,255,255,0.10); }

  /* Layout */
  .wrap { padding: 10px 12px; }
  .card { padding: 14px 16px; border-radius: 10px; }

  /* Page headers */
  .page-title { font-size: 20px; }
  .page-header { margin-bottom: 12px; }
  .page-actions .btn { padding: 7px 12px; font-size: 14px; }

  /* Form buttons stack full-width */
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; text-align: center; }

  /* Stat cards: 2 per row */
  .stat-card { flex: 1 1 140px; padding: 12px 14px; }
  .stat-value { font-size: 24px; }

  /* Cols fill 100% */
  .col { min-width: 100%; }

  /* Pill selector: tighter */
  .pill { padding: 7px 14px; font-size: 14px; }
}

/* ─────────────────────────────────────────────────────────
   Mileage module + shared utility additions
   ───────────────────────────────────────────────────────── */

/* ── Utilities ───────────────────────────────────────────── */
.mt-1   { margin-top: 8px; }
.mt-2   { margin-top: 16px; }
.mt-half { margin-top: 4px; }
.text-muted { color: var(--tln-muted); font-size: 14px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Page header ─────────────────────────────────────────── */
.page-title { margin: 0; font-size: 22px; }
.page-sub { margin: 2px 0 0; font-size: 14px; color: var(--tln-muted); }

/* ── Button variants ─────────────────────────────────────── */
.btn-secondary {
  background: #fff;
  color: var(--tln-text);
  border: 1px solid var(--tln-border);
}
.btn-secondary:hover { background: var(--tln-gray); }

.btn-lg { padding: 12px 22px; font-size: 15px; }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--tln-accent);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
.btn-link:hover { color: var(--tln-accent-2); }
.btn-link.danger { color: #dc3545; }
.btn-link.danger:hover { color: #b02a37; }

/* ── Input class variants ─────────────────────────────────── */
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--tln-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.input:focus {
  outline: none;
  border-color: var(--tln-accent);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.14);
}
.input-sm { padding: 7px 10px; font-size: 14px; }

/* ── Table helpers ───────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
  font-size: 14px;
  text-align: left;
}
.tbl th { font-weight: 800; border-bottom: 2px solid #e5e7eb; background: #f7f8fa; }
.tbl tbody tr:nth-child(even) { background: #fafbfc; }
.tbl tbody tr:hover { background: #eef4ff; }
.tbl .num { text-align: right; }
.desc { max-width: 220px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--tln-muted);
}
.empty-state p { font-size: 15px; margin: 0 0 16px; }

/* ── Status badges ───────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge.status-draft    { background: #f1f3f5; color: #495057; }
.status-badge.status-submitted { background: #dbeafe; color: #1e40af; }
.status-badge.status-approved  { background: var(--success-bg); color: var(--success); }
.status-badge.status-rejected  { background: var(--error-bg); color: var(--error); }

.badge-gray {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  background: #e5e7eb;
  color: #4b5563;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Month navigation ────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.month-label {
  font-weight: 700;
  font-size: 15px;
  min-width: 120px;
  text-align: center;
}

/* ── Report status bar ───────────────────────────────────── */
.report-status-bar {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  border-left: 4px solid var(--tln-border);
  background: #f7f8fa;
  margin-bottom: 4px;
}
.report-status-bar.status-draft      { border-left-color: #9ca3af; background: #f9fafb; }
.report-status-bar.status-complete   { border-left-color: #22c55e; background: var(--success-bg); }
.report-status-bar.status-submitted  { border-left-color: #3b82f6; background: #eff6ff; }
.report-status-bar.status-approved   { border-left-color: #22c55e; background: var(--success-bg); }

/* ── Deduction row styling ───────────────────────────────── */
.deduction { color: #dc3545; font-weight: 700; }
tr.has-deduction > td { border-top: 2px solid #d1d5db; }

/* ── Row action links ────────────────────────────────────── */
.row-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.row-actions a {
  font-size: 14px;
  font-weight: 600;
  color: var(--tln-accent);
  text-decoration: none;
}
.row-actions a:hover { text-decoration: underline; }

/* ── Totals card ─────────────────────────────────────────── */
.totals-card { padding: 16px 24px; }
.totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  align-items: end;
}
.total-item { display: flex; flex-direction: column; gap: 4px; }
.total-item .total-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--tln-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.total-item .total-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--tln-text);
  line-height: 1.1;
}
.total-item-highlight {
  background: var(--tln-navy);
  border-radius: 10px;
  padding: 10px 14px;
}
.total-item-highlight .total-label { color: rgba(255,255,255,0.70); }
.total-item-highlight .total-value { color: #fff; font-size: 22px; }

/* ── Submit bar ──────────────────────────────────────────── */
.submit-bar {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.submit-note { font-size: 13px; color: var(--tln-muted); margin: 0; }

/* ── Form field groups ───────────────────────────────────── */
.field-group { margin-bottom: 18px; }
.field-label { display: block; font-weight: 700; margin: 0 0 6px; font-size: 15px; }
.field-label-sm { display: block; font-weight: 600; margin: 0 0 4px; font-size: 14px; color: var(--tln-muted); }
.field-hint { font-size: 13px; color: var(--tln-muted); margin: 4px 0 0; }
.req { color: #dc3545; margin-left: 2px; }

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin: 0;
}
.check-label input[type="checkbox"] { width: auto; margin: 0; }

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-right: 16px;
}
.radio-label input[type="radio"] { width: auto; margin: 0; }

.dest-type-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.dest-field { margin-top: 6px; }

.odo-row { display: flex; gap: 16px; flex-wrap: wrap; }
.odo-row > div { flex: 1 1 180px; }

/* ── Autocomplete (mileage/library search) ───────────────── */
.autocomplete-wrap { position: relative; }
.suggestion-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.suggestion-item:hover { background: #f3f4f6; }
.suggestion-item.no-results { color: var(--tln-muted); cursor: default; }
.sug-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--tln-muted);
  font-family: monospace;
  background: #f1f3f5;
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

/* ── Form actions ─────────────────────────────────────────── */
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ── Filter field labels ──────────────────────────────────── */
.filter-field label { margin: 0 0 4px; font-size: 14px; }

/* ── Status dot ──────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot-draft    { background: #9ca3af; }
.status-dot-complete { background: #22c55e; }

/* ── Status badge — complete variant ────────────────────── */
.status-badge.status-complete { background: var(--success-bg); color: var(--success); }

/* ── Trip flag badges (H / HQ) ───────────────────────────── */
.trip-flag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  background: #e5e7eb;
  color: #374151;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: 0.3px;
}

/* ── Date cell ───────────────────────────────────────────── */
.date-cell { white-space: nowrap; color: var(--tln-muted); font-size: 14px; }

/* ── Pill selector (destination type) ───────────────────── */
.pill-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.pill {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--tln-border);
  background: #fff;
  color: var(--tln-text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.pill:hover { border-color: var(--tln-accent); color: var(--tln-accent); }
.pill-active {
  background: var(--tln-accent);
  border-color: var(--tln-accent);
  color: #fff;
}
.pill-active:hover { background: var(--tln-accent-2); border-color: var(--tln-accent-2); color: #fff; }

/* ── Narrow form card ────────────────────────────────────── */
.form-card-narrow { max-width: 640px; margin: 0 auto; }

/* ── Check group ─────────────────────────────────────────── */
.check-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* ── Details summary / odometer toggle ───────────────────── */
.details-summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tln-accent);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 0;
  margin: 0;
  border: none;
  background: none;
}
.details-summary::-webkit-details-marker { display: none; }
.odo-toggle-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  transition: transform 0.15s;
  display: inline-block;
}
details[open] .odo-toggle-icon { transform: rotate(45deg); }
.optional-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--tln-muted);
  margin-left: 2px;
}


/* ── Mileage summary row (totals + complete card) ────────── */
.mileage-summary-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  align-items: start;
}

/* ── Complete action card ─────────────────────────────────── */
.complete-action-card {
  text-align: center;
  padding: 20px;
}
.complete-icon {
  font-size: 32px;
  color: #22c55e;
  margin-bottom: 6px;
  line-height: 1;
}
.complete-icon.incomplete { color: #9ca3af; }
.complete-label {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 6px;
}
.complete-hint {
  font-size: 13px;
  color: var(--tln-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}
.btn-block { display: block; width: 100%; text-align: center; }

/* ── Mileage responsive ───────────────────────────────────── */
@media (max-width: 860px) {
  .mileage-summary-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .totals-grid { grid-template-columns: 1fr 1fr; }
  .month-nav { flex-wrap: wrap; }
  .odo-row { flex-direction: column; }
  .form-card-narrow { max-width: 100%; }
}

/* ── Home dashboard — module cards ───────────────────────── */
.module-card {
  flex: 1 1 240px;
  background: var(--tln-card);
  border: 1px solid var(--tln-border);
  border-radius: 6px;
  padding: 20px 18px;
}

/* ── Profile avatar (initials + photo) ───────────────────── */
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #005a8e;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.profile-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--tln-border);
}

/* ── Role badge ───────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
  border: 1px solid transparent;
}
.role-badge.role-admin      { background: #e7eeff; border-color: #c0cff7; color: #1e3a7a; }
.role-badge.role-supervisor { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; }
.role-badge.role-staff      { background: #f1f3f5; border-color: #dee2e6; color: #495057; }
.role-badge.role-read_only  { background: #f1f3f5; border-color: #dee2e6; color: #6c757d; }

/* ── Home dashboard — alert bar ──────────────────────────── */
.alert-bar {
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 8px;
}
.alert-bar-warning {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-left: 4px solid #f59e0b;
  color: #92400e;
}
.alert-bar-info {
  background: #eff6ff;
  border: 1px solid #3b82f6;
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}
