/* ═══════════════════════════════════════════════════════════════════
   BOSON White Water – Fuel Reimbursement System
   Clean, professional theme
═══════════════════════════════════════════════════════════════════ */

:root {
  --brand-dark:   #003566;
  --brand-mid:    #0077B6;
  --brand-light:  #00B4D8;
  --brand-pale:   #CAF0F8;
  --brand-bg:     #F4F9FF;
  --sidebar-bg:   #002952;
  --sidebar-w:    230px;

  --white:   #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100:#F1F5F9;
  --gray-200:#E2E8F0;
  --gray-300:#CBD5E1;
  --gray-500:#64748B;
  --gray-700:#334155;
  --gray-900:#0F172A;

  --green:  #16A34A;
  --amber:  #D97706;
  --red:    #DC2626;
  --purple: #7C3AED;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--brand-bg);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Logo area */
.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,.15);
}
.sidebar-logo .logo-img {
  width: 140px;
  height: 56px;
  object-fit: contain;
  display: block;
}
/* SVG fallback shown when image fails */
.logo-fallback {
  display: none;
  text-align: center;
}
.logo-fallback .logo-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.1;
}
.logo-fallback .logo-sub {
  font-size: 10px;
  color: var(--brand-pale);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-logo .app-label {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* User pill */
.sidebar-user {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-mid);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.user-info .role-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 1px 7px;
  border-radius: 20px;
  margin-top: 2px;
}
.role-chip.superadmin { background: #7C3AED; color: #fff; }
.role-chip.admin      { background: var(--brand-light); color: var(--brand-dark); }
.role-chip.employee   { background: rgba(255,255,255,.15); color: rgba(255,255,255,.9); }

/* Nav */
.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-section {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
  padding: 12px 18px 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.nav-link .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active {
  background: rgba(0,180,216,.18);
  color: #fff;
  border-left-color: var(--brand-light);
}

/* Logout */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.logout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 2px;
  transition: color .15s;
}
.logout-link:hover { color: rgba(255,255,255,.9); }

/* ── Main content ────────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex: 1;
}

/* Topbar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-dark);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-500);
}
.topbar-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Page body */
.page-body {
  padding: 24px 28px;
  flex: 1;
}

/* Copyright footer */
.page-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 12px 28px;
  text-align: center;
  font-size: 11px;
  color: var(--gray-500);
}

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.login-panel-left {
  flex: 1;
  background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand-mid) 60%, var(--brand-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.login-panel-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  top: -100px; right: -100px;
}
.login-panel-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  bottom: -80px; left: -80px;
}
.login-brand {
  position: relative;
  z-index: 1;
  text-align: center;
}
.login-brand .brand-logo-img {
  width: 180px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
}
.login-brand .brand-logo-fallback {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 4px;
}
.login-brand .brand-logo-sub {
  font-size: 16px;
  color: var(--brand-pale);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.login-brand .brand-tagline {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  max-width: 300px;
  margin: 0 auto;
}
.login-panel-right {
  width: 440px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 48px;
}
.login-panel-right h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 6px;
}
.login-panel-right .login-sub {
  color: var(--gray-500);
  margin-bottom: 32px;
  font-size: 13px;
}
.login-form { width: 100%; }
.login-footer-copy {
  margin-top: auto;
  padding-top: 24px;
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0;
}
.card-body { padding: 20px; }
.card + .card { margin-top: 16px; }

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #DBEAFE; }
.stat-icon.green  { background: #DCFCE7; }
.stat-icon.amber  { background: #FEF3C7; }
.stat-icon.red    { background: #FEE2E2; }
.stat-icon.purple { background: #EDE9FE; }
.stat-icon.teal   { background: #CFFAFE; }
.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1;
}
.stat-val.small { font-size: 18px; }
.stat-label { font-size: 11px; color: var(--gray-500); margin-top: 3px; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border-left: 4px solid;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-success { background: #F0FDF4; border-color: var(--green); color: #14532D; }
.alert-danger  { background: #FFF5F5; border-color: var(--red);   color: #7F1D1D; }
.alert-warning { background: #FFFBEB; border-color: var(--amber); color: #78350F; }
.alert-info    { background: #EFF6FF; border-color: var(--brand-mid); color: var(--brand-dark); }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-submitted        { background: #DBEAFE; color: #1E40AF; }
.badge-resubmitted      { background: #EDE9FE; color: #5B21B6; }
.badge-approved         { background: #DCFCE7; color: #14532D; }
.badge-resubmit_requested { background: #FEF3C7; color: #78350F; }
.badge-self             { background: #CFFAFE; color: #155E75; }
.badge-public           { background: #F3E8FF; color: #6B21A8; }
.badge-admin            { background: #DBEAFE; color: #1E40AF; }
.badge-employee         { background: var(--gray-100); color: var(--gray-700); }
.badge-superadmin       { background: #EDE9FE; color: #5B21B6; }
.badge-active           { background: #DCFCE7; color: #14532D; }
.badge-inactive         { background: #FEE2E2; color: #7F1D1D; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 5px;
  letter-spacing: .2px;
}
.form-label .req { color: var(--red); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(0,119,182,.12);
}
.form-hint { font-size: 11px; color: var(--gray-500); margin-top: 3px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Vehicle radio group */
.vehicle-group { display: flex; gap: 10px; }
.vehicle-option {
  flex: 1;
  position: relative;
}
.vehicle-option input[type="radio"] { position: absolute; opacity: 0; }
.vehicle-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--gray-50);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}
.vehicle-option label .v-icon { font-size: 24px; }
.vehicle-option input:checked + label {
  border-color: var(--brand-mid);
  background: #EFF8FF;
  color: var(--brand-dark);
}

/* ── Destination rows ──────────────────────────────────────────────────────── */
.dest-list { display: flex; flex-direction: column; gap: 8px; }
.dest-row {
  display: grid;
  grid-template-columns: 1fr 130px 36px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
.dest-row.office-row {
  background: #EFF8FF;
  border-color: var(--brand-pale);
}
.dest-row.office-row input { background: var(--white); }
.remove-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.remove-btn:hover { background: #FEE2E2; }
.remove-btn:disabled { opacity: .3; cursor: default; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s;
  line-height: 1.4;
}
.btn-primary   { background: var(--brand-mid); color: #fff; border-color: var(--brand-mid); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-success   { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #15803D; }
.btn-danger    { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #B91C1C; }
.btn-warning   { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn-warning:hover { background: #B45309; }
.btn-outline   { background: transparent; color: var(--brand-mid); border-color: var(--brand-mid); }
.btn-outline:hover { background: var(--brand-mid); color: #fff; }
.btn-ghost     { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-200); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-sm  { padding: 4px 11px; font-size: 12px; }
.btn-lg  { padding: 11px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr {
  background: var(--brand-dark);
}
thead th {
  padding: 11px 14px;
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
  text-align: left;
}
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--brand-bg); }
tbody td { padding: 10px 14px; vertical-align: middle; color: var(--gray-700); }
tfoot td {
  padding: 11px 14px;
  background: var(--gray-50);
  font-weight: 700;
  color: var(--brand-dark);
  border-top: 2px solid var(--gray-200);
}
.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--gray-500);
}
.table-empty .empty-icon { font-size: 40px; margin-bottom: 10px; }

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar label { font-size: 11px; font-weight: 600; color: var(--gray-500); margin-bottom: 4px; display: block; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-bg.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--brand-dark); }
.modal-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: var(--gray-500); line-height: 1;
  padding: 0 2px;
}
.modal-close:hover { color: var(--gray-900); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Amount highlight ──────────────────────────────────────────────────────── */
.amount-box {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.amount-box .a-label { font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.amount-box .a-value { font-size: 34px; font-weight: 800; }
.amount-box .a-sub   { font-size: 12px; opacity: .7; margin-top: 2px; }

/* ── Detail grid ────────────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-item label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-500);
  display: block;
  margin-bottom: 3px;
}
.detail-item .dv { font-size: 14px; font-weight: 500; color: var(--gray-900); }

/* ── Upload zone ────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover { border-color: var(--brand-mid); background: #EFF8FF; }
.upload-zone .uz-icon { font-size: 28px; margin-bottom: 6px; }
.upload-zone p { font-size: 12px; color: var(--gray-500); }
.slip-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.slip-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--gray-700);
}
.slip-chip a { color: var(--brand-mid); text-decoration: none; }
.slip-chip a:hover { text-decoration: underline; }

/* ── Utilities ──────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-0  { margin-top: 0; }
.mt-2  { margin-top: 10px; }
.mt-3  { margin-top: 16px; }
.mt-4  { margin-top: 24px; }
.mb-2  { margin-bottom: 10px; }
.mb-3  { margin-bottom: 16px; }
.mb-4  { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden  { display: none; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.font-bold   { font-weight: 700; }
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 18px 0; }

/* ── Page header row ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.page-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile-first adjustments
══════════════════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop, shown on mobile via CSS) ─── */
.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--brand-dark);
  line-height: 1;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.menu-btn:hover { background: var(--gray-100); }

/* ── Sidebar overlay (only active on mobile) ──────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* Tablet & below (≤ 900px) */
@media (max-width: 900px) {
  :root { --sidebar-w: 210px; }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {

  /* Show hamburger */
  .menu-btn { display: inline-flex; align-items: center; }

  /* Sidebar slides off-screen; toggled with .open */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.25);
  }

  /* Main fills full width */
  .main { margin-left: 0; }

  /* Topbar */
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-title { font-size: 15px; }
  .topbar-date { display: none; }          /* hide date on small screens */

  /* Page body */
  .page-body { padding: 16px 14px; }
  .page-footer { padding: 10px 14px; }

  /* Login — show form panel only */
  .login-panel-left { display: none; }
  .login-panel-right { width: 100%; padding: 32px 20px; }

  /* Grids → single column */
  .form-row,
  .form-row-3,
  .detail-grid { grid-template-columns: 1fr; }

  /* Stat grid → 2 columns */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-val { font-size: 20px; }
  .stat-val.small { font-size: 16px; }
  .stat-icon { width: 38px; height: 38px; font-size: 18px; }

  /* Vehicle group — stack vertically */
  .vehicle-group { flex-direction: column; gap: 8px; }

  /* Destination rows — stack on mobile */
  .dest-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px;
  }
  .dest-row input[name="destination[]"],
  .dest-row input[type="text"] {
    grid-column: 1 / -1;   /* destination spans full width */
  }

  /* Filter bar — stack vertically */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .filter-bar .form-group { width: 100%; }
  .filter-bar .form-control { width: 100%; }

  /* Page header — stack title + actions */
  .page-header { flex-direction: column; align-items: flex-start; }

  /* Buttons — larger touch targets on mobile */
  .btn { padding: 9px 16px; min-height: 42px; }
  .btn-sm { padding: 6px 12px; min-height: 36px; }
  .btn-lg { padding: 12px 24px; min-height: 48px; }

  /* Tables — horizontal scroll with min width enforced */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 540px; }

  /* Modal — nearly full-screen on mobile */
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
  }
  .modal-bg { align-items: flex-end; }

  /* Card body padding */
  .card-body { padding: 14px; }

  /* Amount box */
  .amount-box .a-value { font-size: 28px; }

  /* form-control bigger tap area */
  .form-control { padding: 10px 12px; font-size: 16px; } /* 16px prevents iOS zoom */
  select.form-control { font-size: 16px; }
}

/* Extra small (≤ 400px) */
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-right { display: none; }
}

/* ── Entry form sections ───────────────────────────────────────────────────── */
.section-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.section-card-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-card-body { padding: 16px; }

/* ── Other expense rows ────────────────────────────────────────────────────── */
.expense-list { display: flex; flex-direction: column; gap: 10px; }
.expense-row {
  display: grid;
  grid-template-columns: 150px 1fr 100px 160px 34px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
.inv-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-600);
  cursor: pointer;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.inv-label:hover { border-color: var(--brand-mid); color: var(--brand-mid); }
.exp-total-bar {
  background: var(--brand-bg);
  border: 1px solid var(--brand-pale);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .expense-row {
    grid-template-columns: 1fr 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 6px;
  }
  .expense-row select      { grid-column: 1 / 3; }
  .expense-row input[name="expense_desc[]"] { grid-column: 1 / 3; }
  .expense-row input[name="expense_amount[]"] { grid-column: 1 / 2; }
  .expense-row .inv-label  { grid-column: 2 / 3; }
  .expense-row .remove-btn { grid-column: 3 / 4; grid-row: 1 / 2; align-self: start; }
}

/* ═══════════════════════════════════════════════════════════════════
   BOSON WHITE WATER — Extended Brand Styles (Inter font, role updates)
═══════════════════════════════════════════════════════════════════ */

/* ── Technician role badge ─────────────────────────────────────────────────── */
.badge-technician { background: #0E7490; color: #fff; }
.role-chip.technician { background: rgba(14,116,144,.25); color: #CAF0F8; border: 1px solid rgba(14,116,144,.4); }

/* ── Dept chip ─────────────────────────────────────────────────────────────── */
.dept-chip {
  background: var(--brand-bg);
  border: 1px solid var(--brand-pale);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Fuel section — ocean blue tint ───────────────────────────────────────── */
.section-fuel {
  border-color: #BFDBFE;
  background: #F0F7FF;
}
.section-fuel .section-card-header {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-bottom-color: #BFDBFE;
  color: #1E40AF;
}
.section-fuel .section-icon { color: #1D4ED8; }

/* Fuel total bar — blue theme */
.fuel-total-bar {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid #93C5FD;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #1E40AF;
}

/* ── Expenses section — teal/cyan tint ────────────────────────────────────── */
.section-expenses {
  border-color: #A5F3FC;
  background: #F0FFFE;
}
.section-expenses .section-card-header {
  background: linear-gradient(135deg, #ECFEFF 0%, #CFFAFE 100%);
  border-bottom-color: #A5F3FC;
  color: #0E7490;
}
.section-expenses .section-icon { color: #0891B2; }

/* Expense total bar — teal theme */
.exp-total-bar {
  background: linear-gradient(135deg, #ECFEFF 0%, #CFFAFE 100%);
  border: 1px solid #67E8F9;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
  color: #0E7490;
}

/* Grand total bar */
.grand-total-bar {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  border: 2px solid #A5B4FC;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #3730A3;
  font-size: 14px;
}

/* Section optional label */
.section-optional {
  font-weight: 400;
  font-size: 11px;
  color: var(--gray-500);
  margin-left: 4px;
}

/* ── Invoice label states ──────────────────────────────────────────────────── */
.inv-required {
  border-color: #FCA5A5 !important;
  background: #FEF2F2 !important;
  color: #DC2626 !important;
}
.inv-ok {
  border-color: #86EFAC !important;
  background: #F0FDF4 !important;
  color: #16A34A !important;
}
.inv-error {
  border-color: #EF4444 !important;
  background: #FEE2E2 !important;
  color: #DC2626 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important;
  animation: shake .3s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ── Fuel/expense type indicator in tables ────────────────────────────────── */
.type-fuel    { background: #DBEAFE; color: #1E40AF; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.type-expenses { background: #CFFAFE; color: #0E7490; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.type-both    { background: #EDE9FE; color: #5B21B6; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* ── Water wave decoration on sidebar bottom ──────────────────────────────── */
.sidebar::after {
  content: '';
  display: block;
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40'%3E%3Cpath d='M0 20 Q50 10 100 20 Q150 30 200 20 Q250 10 300 20 Q350 30 400 20 L400 40 L0 40 Z' fill='%230077B6' opacity='0.3'/%3E%3Cpath d='M0 26 Q50 16 100 26 Q150 36 200 26 Q250 16 300 26 Q350 36 400 26 L400 40 L0 40 Z' fill='%2300B4D8' opacity='0.2'/%3E%3C/svg%3E") no-repeat bottom center;
  background-size: cover;
  pointer-events: none;
  margin-top: auto;
}

/* ── Login page — water wave ──────────────────────────────────────────────── */
.login-panel-left::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 80'%3E%3Cpath d='M0 40 Q100 20 200 40 Q300 60 400 40 Q500 20 600 40 Q700 60 800 40 L800 80 L0 80 Z' fill='%2300B4D8' opacity='0.3'/%3E%3Cpath d='M0 52 Q100 32 200 52 Q300 72 400 52 Q500 32 600 52 Q700 72 800 52 L800 80 L0 80 Z' fill='%23CAF0F8' opacity='0.4'/%3E%3C/svg%3E") no-repeat;
  background-size: cover;
  pointer-events: none;
}

/* ── Technician badge in entries table ────────────────────────────────────── */
.badge-active   { background: #D1FAE5; color: #065F46; }
.badge-inactive { background: #F3F4F6; color: #6B7280; }

/* ── Entries table — fuel row highlight ──────────────────────────────────── */
tr.row-fuel td:first-child { border-left: 3px solid #3B82F6; }
tr.row-expenses td:first-child { border-left: 3px solid #06B6D4; }
tr.row-both td:first-child { border-left: 3px solid #8B5CF6; }

/* ── Improved topbar date pill ────────────────────────────────────────────── */
.topbar-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Amount box upgrade ────────────────────────────────────────────────────── */
.amount-box {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  color: white;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.amount-box::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30'%3E%3Cpath d='M0 15 Q37 5 75 15 Q112 25 150 15 Q187 5 225 15 Q262 25 300 15 L300 30 L0 30 Z' fill='%2300B4D8' opacity='0.3'/%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
}
.amount-box .a-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .75; margin-bottom: 6px; }
.amount-box .a-value { font-size: 36px; font-weight: 800; letter-spacing: -1px; }
.amount-box .a-sub   { font-size: 12px; opacity: .7; margin-top: 4px; }

/* ── Stat card hover effect ───────────────────────────────────────────────── */
.stat-card {
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── Nav link active indicator ─────────────────────────────────────────────── */
.nav-link.active {
  background: rgba(0,180,216,.15);
  border-left: 3px solid var(--brand-light);
}


/* ── Finance role badge ───────────────────────────────────────────────────── */
.badge-finance   { background: #FEF3C7; color: #92400E; }
.role-chip.finance { background: rgba(251,191,36,.2); color: #92400E; }

/* ── Fuel row layout (multi-vehicle) ─────────────────────────────────────── */
.fuel-row-list { display: flex; flex-direction: column; gap: 10px; }

.fuel-row {
  background: #F0F7FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
  padding: 12px 14px;
}

.fuel-row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.fuel-row-fields .form-group { margin-bottom: 0; }
.fuel-row-fields .form-group .form-label { font-size: 11px; color: var(--gray-500); margin-bottom: 4px; }

/* ── Section card layout ──────────────────────────────────────────────────── */
.section-card {
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
}

.section-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
}

.section-card-body { padding: 16px 18px; }

.section-icon { font-size: 18px; }

.section-optional {
  font-weight: 400;
  font-size: 11px;
  color: var(--gray-500);
  margin-left: 4px;
}

.section-fuel .section-card-header {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-bottom: 1px solid #BFDBFE;
  color: #1E40AF;
}

.section-expenses .section-card-header {
  background: linear-gradient(135deg, #ECFEFF 0%, #CFFAFE 100%);
  border-bottom: 1px solid #A5F3FC;
  color: #0E7490;
}

/* ── Total bars ───────────────────────────────────────────────────────────── */
.fuel-total-bar {
  background: linear-gradient(90deg, #EFF6FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  color: #1E40AF;
}

.exp-total-bar {
  background: linear-gradient(90deg, #ECFEFF, #CFFAFE);
  border: 1px solid #A5F3FC;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  color: #0E7490;
}

.grand-total-bar {
  background: linear-gradient(90deg, #EDE9FE, #DDD6FE);
  border: 1px solid #C4B5FD;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  color: #5B21B6;
  margin-bottom: 16px;
}

/* ── Invoice label states ─────────────────────────────────────────────────── */
.inv-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
  user-select: none;
}
.inv-required { background: #FEF9C3; border: 1px dashed #FCD34D; color: #92400E; }
.inv-ok       { background: #D1FAE5; border: 1px solid #6EE7B7; color: #065F46; }
.inv-error    { background: #FEE2E2; border: 1px solid #FCA5A5; color: #991B1B;
                animation: shake .3s ease; }

@keyframes shake {
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-4px)}
  40%{transform:translateX(4px)}
  60%{transform:translateX(-3px)}
  80%{transform:translateX(3px)}
}

/* ── Dept chip ────────────────────────────────────────────────────────────── */
.dept-chip {
  background: var(--brand-bg);
  border: 1px solid var(--brand-pale);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark);
}

/* ── Upload zone ──────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--gray-50);
}
.upload-zone:hover { border-color: var(--brand-mid); background: var(--brand-bg); }
.uz-icon { font-size: 24px; margin-bottom: 6px; }

/* ── Slip chips ───────────────────────────────────────────────────────────── */
.slip-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slip-chip {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--gray-700);
}

/* ── Expense rows ─────────────────────────────────────────────────────────── */
.expense-row {
  display: grid;
  grid-template-columns: 160px 1fr 120px auto auto;
  gap: 8px;
  align-items: center;
  background: #F0FDFA;
  border: 1px solid #A5F3FC;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}

/* ── Login page redesign ──────────────────────────────────────────────────── */
.login-page {
  display: flex;
  min-height: 100vh;
}

.login-panel-left {
  flex: 0 0 42%;
  background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand-mid) 60%, var(--brand-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-brand { color: white; text-align: center; position: relative; z-index: 1; }
.brand-logo-img { max-width: 180px; max-height: 120px; object-fit: contain; margin-bottom: 20px; filter: brightness(0) invert(1); }
.brand-logo-sub { font-size: 15px; font-weight: 700; letter-spacing: .3px; margin-bottom: 10px; opacity: .95; }
.brand-tagline  { font-size: 13px; opacity: .8; line-height: 1.6; max-width: 280px; margin: 0 auto; }

.login-panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  background: white;
}

.login-panel-right h2 { font-size: 24px; font-weight: 800; color: var(--brand-dark); margin-bottom: 6px; }
.login-sub { color: var(--gray-500); font-size: 13px; margin-bottom: 28px; }

.login-form .form-group { margin-bottom: 18px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

.login-footer-copy {
  margin-top: 32px;
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
}

/* ── Detail grid (view entry) ─────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.detail-label { display: block; font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.detail-val   { font-weight: 600; color: var(--gray-900); }
.amount-highlight { font-size: 18px; font-weight: 800; color: var(--brand-dark); }

/* ── Filter bar ───────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.filter-bar .form-group { margin-bottom: 0; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .login-panel-left { display: none; }
  .login-panel-right { padding: 32px 24px; }
  .fuel-row-fields { flex-direction: column; }
  .fuel-row-fields .form-group { flex: 1 1 100% !important; }
  .expense-row { grid-template-columns: 1fr 1fr; }
}

/* ── Destination row layout ───────────────────────────────────────────────── */
.dest-list { display: flex; flex-direction: column; gap: 8px; }

.dest-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dest-row .form-control:first-child { flex: 2; }
.dest-row .form-control.dest-km { flex: 0 0 110px; }
.dest-row .remove-btn { flex: none; }

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { background: var(--brand-pale); }
th.sortable .sort-icon { margin-left: 4px; font-size: 11px; opacity: 0.5; }
th.sortable.asc .sort-icon::after  { content: '▲'; opacity: 1; }
th.sortable.desc .sort-icon::after { content: '▼'; opacity: 1; }
th.sortable:not(.asc):not(.desc) .sort-icon::after { content: '⇅'; }
