/* =========================================================
   TransitTrack – design system (matches product prototype)
   ========================================================= */
:root {
  --navy: #0B2B5F;
  --navy-d: #061C42;
  --navy-2: #143F82;
  --yellow: #FFC20E;
  --yellow-d: #E9AC00;
  --green: #1F9D49;
  --green-d: #167F3A;
  --green-l: #E8F6EC;
  --green-b: #9ED6B0;
  --orange: #F26A1B;
  --orange-l: #FEF0E6;
  --red: #D93636;
  --red-l: #FDECEC;
  --bg: #EEF3FA;
  --card: #FFFFFF;
  --line: #E1E7F0;
  --ink: #0B1F44;
  --muted: #5D6D88;
  --cream: #FFF6DA;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(11, 43, 95, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.ico { width: 20px; height: 20px; flex: none; }
code { background: #EEF2F8; padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.nowrap { white-space: nowrap; }

.wordmark { font-weight: 800; letter-spacing: -.01em; }
.wordmark span { color: var(--yellow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 18px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  transition: background .15s, transform .05s, box-shadow .15s;
  text-align: center; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn-yellow { background: var(--yellow); color: var(--navy-d); box-shadow: 0 3px 0 var(--yellow-d); }
.btn-yellow:hover { background: #FFCB33; }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-d); }
.btn-green:hover { background: #22AA50; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-outline-green { background: var(--green-l); border: 1.5px solid var(--green); color: var(--green-d); }
.btn-light { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-light:hover { border-color: #C5D0E0; }
.btn-danger { background: var(--red-l); color: var(--red); border: 1.5px solid #F4C2C2; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 18px; font-size: 17px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; border: 1px solid; }
.alert-success { background: var(--green-l); border-color: var(--green-b); color: var(--green-d); }
.alert-error { background: var(--red-l); border-color: #F4C2C2; color: #A42121; }
.alert-info { background: #EAF1FC; border-color: #C6D6F2; color: var(--navy); }
.alert-warn { background: var(--cream); border-color: #F3DD94; color: #7A5A00; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; outline: none; font-size: 15px;
}
.input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(20, 63, 130, .12); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; }

/* =========================================================
   Login / installer
   ========================================================= */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #1C4C96 0, var(--navy) 40%, var(--navy-d) 100%);
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: 14px;
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-logo .wordmark { font-size: 26px; color: var(--navy); display: block; line-height: 1; }
.auth-logo small { color: var(--muted); font-size: 13px; }
.logo-tile {
  width: 52px; height: 52px; border-radius: 13px; background: var(--navy); color: #fff;
  display: grid; place-items: center; box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px var(--navy);
}
.logo-tile .ico { width: 30px; height: 30px; }
/* Login – split screen */
.login-body { background: #fff; }
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-photo { position: relative; background-size: cover; background-position: center; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 32px 40px 48px; }
.login-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 28, 66, .55) 0%, rgba(6, 28, 66, .25) 40%, rgba(6, 28, 66, .92) 100%); }
.login-photo > * { position: relative; }
.login-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; color: #fff; }
.login-brand .logo-tile { width: 42px; height: 42px; border-radius: 11px; background: #fff; color: var(--navy); box-shadow: none; }
.login-brand .logo-tile .ico { width: 24px; height: 24px; }
.login-quote h2 { font-size: 36px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; }
.login-quote h2 span { color: var(--yellow); }
.login-quote p { font-size: 17px; max-width: 460px; opacity: .92; margin: 0; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 30px; margin: 0; color: var(--navy); }
.login-box > p { margin: -8px 0 6px; }
.login-brand--mobile { display: none; color: var(--navy); margin-bottom: 8px; }
.login-brand--mobile .logo-tile { background: var(--navy); color: #fff; }
.input-icon { position: relative; }
.input-icon > .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #8A98B0; pointer-events: none; }
.input-icon .input { padding-left: 40px; height: 50px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--navy-2); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.pw-toggle:hover { background: var(--bg); }
.login-box .btn-lg { margin-top: 4px; height: 52px; }
.login-help { text-align: center; margin: 6px 0 0; }
@media (max-width: 860px) {
  .login-split { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; }
  .login-photo { padding: 20px; justify-content: flex-start; }
  .login-quote { display: none; }
  .login-main { align-items: flex-start; padding: 28px 16px; border-radius: 22px 22px 0 0; margin-top: -22px; position: relative; }
}

/* =========================================================
   Driver mobile app
   ========================================================= */
.app-body { background: #D9E2EF; }
.app-shell {
  max-width: 440px; margin: 0 auto; min-height: 100vh; background: #F3F6FB;
  display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(6, 28, 66, .12); position: relative;
}
.app-bar {
  background: var(--navy); color: #fff; padding: 14px 14px; display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0; z-index: 20; min-height: 58px;
}
.app-bar h1 { font-size: 18px; margin: 0; font-weight: 600; flex: 1; }
.app-bar--brand { flex-direction: column; align-items: stretch; gap: 0; padding: 12px 14px 10px; }
.brand-row { display: flex; align-items: center; justify-content: center; position: relative; }
.brand-row .brand { display: flex; align-items: center; gap: 8px; font-size: 21px; }
.brand-row .brand .ico { width: 24px; height: 24px; }
.brand-row .icon-btn { position: absolute; right: -4px; }
.brand-sub { text-align: center; font-size: 13px; font-weight: 600; opacity: .95; }
.icon-btn {
  background: none; border: 0; color: inherit; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 9px; cursor: pointer; flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn .ico { width: 22px; height: 22px; }
.app-main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.app-foot { padding: 0 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; }

/* Screen 1 – home */
.profile-card { display: flex; gap: 14px; align-items: center; padding: 14px; }
.profile-card .bus-img {
  width: 92px; height: 70px; border-radius: 10px; flex: none; overflow: hidden;
  background: linear-gradient(180deg, #CFE2F7, #EAF2FB);
}
.profile-card .bus-img img { width: 100%; height: 100%; object-fit: cover; }
.profile-card dl { margin: 0; font-size: 14px; display: grid; gap: 3px; }
.profile-card dl div { display: flex; gap: 4px; }
.profile-card dt { color: var(--ink); }
.profile-card dd { margin: 0; font-weight: 600; }
.status-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.big-check {
  width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px rgba(31, 157, 73, .35);
}
.big-check .ico { width: 30px; height: 30px; stroke-width: 3; }
.status-card small { display: block; font-size: 14px; color: var(--ink); }
.status-card strong { display: block; font-size: 24px; line-height: 1.15; }
.status-card .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.status-card.owing .big-check { background: var(--red); box-shadow: 0 4px 12px rgba(217, 54, 54, .3); }
.status-card.owing strong { color: var(--red); }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; font-weight: 500; font-size: 15px;
}
.menu-item:hover { border-color: #C5D0E0; }
.menu-item > .ico { color: var(--navy); width: 22px; height: 22px; }
.menu-item .chev { margin-left: auto; color: #9AA6BB; width: 18px; height: 18px; }

/* Screen 2 – period options */
.opt {
  display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer; position: relative; transition: .15s;
}
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.radio {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #9AA7BD; flex: none;
  display: grid; place-items: center; background: #fff;
}
.radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--green); transform: scale(0); transition: .15s; }
.opt.is-checked, .opt:has(input:checked) { background: var(--green-l); border-color: var(--green-b); }
.opt.is-checked .radio, .opt:has(input:checked) .radio { border-color: var(--green); }
.opt.is-checked .radio::after, .opt:has(input:checked) .radio::after { transform: scale(1); }
.opt:focus-within { box-shadow: 0 0 0 3px rgba(31, 157, 73, .2); }
.opt-text b { display: block; font-size: 16px; }
.opt-text span { font-size: 13px; color: var(--muted); }
.opt-list { display: flex; flex-direction: column; gap: 10px; }

/* Screen 3 – calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 6px; }
.cal-head b { font-size: 17px; }
.cal-head .icon-btn { color: var(--navy); }
.cal-head .icon-btn:hover { background: var(--bg); }
.cal-head .icon-btn[disabled] { opacity: .25; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 10px 12px; text-align: center; }
.cal-dow { font-size: 12px; color: var(--ink); font-weight: 600; padding: 4px 0 6px; }
.cal-day {
  min-height: 44px; border-radius: 8px; border: 0; background: none; font-weight: 500; font-size: 15px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  position: relative; padding: 0;
}
.cal-day:hover:not(:disabled) { background: #EDF2F9; }
.cal-day .tick { width: 12px; height: 12px; stroke-width: 3.2; }
.cal-day.sel { background: var(--green); color: #fff; font-weight: 700; box-shadow: 0 2px 0 var(--green-d); }
.cal-day.sel:hover { background: var(--green); }
.cal-day.paid { color: var(--green-d); background: var(--green-l); cursor: default; font-size: 13px; }
.cal-day.paid .tick { width: 10px; height: 10px; }
.cal-day.owing::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.cal-day.dis { color: #C3CBD8; cursor: default; }
.cal-day.today:not(.sel) { box-shadow: inset 0 0 0 1.5px var(--navy-2); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); padding: 0 14px 12px; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sel-card { padding: 12px 14px; }
.sel-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding-bottom: 6px; }
.sel-head .ico { color: var(--navy); }
.sel-head .total { margin-left: auto; color: var(--green-d); }
.sel-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.sel-row .ok { color: var(--green); width: 20px; height: 20px; }
.sel-row button { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--ink); padding: 4px; border-radius: 6px; }
.sel-row button:hover { background: var(--red-l); color: var(--red); }
.sel-empty { color: var(--muted); font-size: 14px; padding: 8px 0 4px; }

/* Screen 4 – payment method */
.method { padding: 13px 14px; gap: 12px; }
.method .m-ico { color: var(--navy); width: 26px; height: 26px; }
.method .opt-text b { font-size: 15px; }
.account-box {
  background: var(--cream); border: 1px solid #F1DC9A; border-radius: 12px; padding: 14px 16px;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
}
.account-box > .ico { color: var(--navy); width: 30px; height: 30px; grid-row: span 2; }
.account-box h4 { margin: 0; font-size: 15px; }
.account-box dl { margin: 6px 0 0; font-size: 13px; display: grid; gap: 2px; grid-column: 2; }
.account-box dt { color: var(--muted); font-size: 12px; }
.account-box dd { margin: 0 0 4px; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.copy-btn { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--green); border-radius: 5px; }
.copy-btn:hover { background: rgba(31, 157, 73, .12); }
.copy-btn .ico { width: 18px; height: 18px; }
.pay-summary { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 12px 14px; }
.pay-summary b { font-size: 18px; }
.ussd-code { font-size: 22px; font-weight: 800; letter-spacing: .04em; color: var(--navy); }
.method-panel[hidden] { display: none !important; }

/* Screen 5 – success */
.success-hero { text-align: center; padding: 22px 16px 10px; }
.success-burst { position: relative; width: 120px; height: 100px; margin: 0 auto 8px; }
.success-burst .big-check { width: 72px; height: 72px; position: absolute; left: 24px; top: 14px; }
.success-burst .big-check .ico { width: 40px; height: 40px; }
.success-burst i { position: absolute; width: 4px; height: 14px; border-radius: 2px; background: var(--green); }
.success-burst i:nth-child(2) { left: 6px; top: 26px; transform: rotate(-60deg); }
.success-burst i:nth-child(3) { left: 16px; top: 8px; transform: rotate(-30deg); }
.success-burst i:nth-child(4) { right: 6px; top: 26px; transform: rotate(60deg); }
.success-burst i:nth-child(5) { right: 16px; top: 8px; transform: rotate(30deg); }
.success-burst i:nth-child(6) { left: 10px; top: 62px; transform: rotate(60deg); height: 9px; }
.success-burst i:nth-child(7) { right: 10px; top: 62px; transform: rotate(-60deg); height: 9px; }
.success-hero h2 { color: var(--green); margin: 0; font-size: 22px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; padding: 16px; font-size: 14.5px; }
.kv dt { color: var(--ink); }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.kv dd.stack-left { text-align: left; grid-column: 1 / -1; margin-top: -8px; font-size: 16px; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(6, 28, 66, .5); z-index: 50; opacity: 0; pointer-events: none; transition: .2s; }
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: 290px; max-width: 85vw; background: #fff; z-index: 51;
  transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer-open .drawer { transform: none; }
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { background: var(--navy); color: #fff; padding: 20px 18px; }
.drawer-head b { display: block; font-size: 17px; }
.drawer-head span { font-size: 13px; opacity: .85; }
.drawer nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.drawer nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; font-weight: 500; }
.drawer nav a:hover { background: var(--bg); }
.drawer nav a .ico { color: var(--navy); }
.drawer nav a.logout { color: var(--red); }
.drawer nav a.logout .ico { color: var(--red); }

/* History list */
.list-card { overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .l-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--green-l); color: var(--green); display: grid; place-items: center; flex: none; }
.list-row .l-main { flex: 1; min-width: 0; }
.list-row .l-main b { display: block; font-size: 14.5px; }
.list-row .l-main span { font-size: 12.5px; color: var(--muted); }
.list-row .l-amt { text-align: right; font-weight: 700; font-size: 15px; }
.list-row .l-amt small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
a.list-row:hover { background: #F7F9FD; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }

.stat-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-trio .card { padding: 12px 8px; text-align: center; }
.stat-trio b { display: block; font-size: 22px; }
.stat-trio span { font-size: 12px; color: var(--muted); }
.meter { height: 10px; background: #E6ECF4; border-radius: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--green); border-radius: 6px; }

/* =========================================================
   Admin / Route Manager dashboard
   ========================================================= */
.adm-top {
  height: 58px; background: var(--navy); color: #fff; display: flex; align-items: center;
  padding: 0 18px; gap: 12px; position: sticky; top: 0; z-index: 30;
}
.adm-top .brand { display: flex; align-items: center; gap: 9px; font-size: 18px; white-space: nowrap; }
.adm-top .brand .ico { width: 24px; height: 24px; }
.adm-top .brand .dash-title { font-weight: 500; font-size: 15px; opacity: .95; }
.adm-top .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.adm-top .who .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--navy-d); display: grid; place-items: center; font-weight: 800; }
.adm-top .who .meta { line-height: 1.2; text-align: right; }
.adm-top .who .meta span { opacity: .75; font-size: 12px; display: block; }
.adm-top .menu-toggle { display: none; }
.adm-wrap { display: flex; min-height: calc(100vh - 58px); }
.adm-side { width: 220px; background: var(--navy-d); color: #C9D5EA; padding: 14px 10px; flex: none; display: flex; flex-direction: column; }
.adm-side a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; font-size: 14.5px; font-weight: 500; margin-bottom: 3px; }
.adm-side a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.adm-side a.active { background: var(--yellow); color: var(--navy-d); font-weight: 700; }
.adm-side .side-foot { margin-top: auto; padding: 10px 6px 4px; font-size: 12px; opacity: .65; }
.adm-main { flex: 1; padding: 22px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 12px; text-align: center; box-shadow: var(--shadow); }
.kpi .k-ico { width: 40px; height: 40px; margin: 0 auto 6px; display: grid; place-items: center; }
.kpi .k-ico .ico { width: 34px; height: 34px; }
.kpi .num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.kpi .lbl { font-size: 13px; color: var(--ink); margin-top: 2px; }
.kpi.navy .k-ico { color: var(--navy); }
.kpi.green .k-ico { color: #fff; background: var(--green); border-radius: 50%; }
.kpi.green .k-ico .ico { width: 24px; height: 24px; stroke-width: 3; }
.kpi.orange .k-ico { color: var(--orange); }
.kpi.orange .num { color: var(--orange); }
.kpi.gauge .k-ico { color: var(--green); }

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel h3 a { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--navy-2); }
.bar-row { display: grid; grid-template-columns: 74px 1fr 46px; align-items: center; gap: 10px; margin: 10px 0; font-size: 13.5px; }
.bar-row .pv { text-align: right; font-weight: 700; }
.bar { height: 13px; background: #E8EDF4; border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }
.bar.warn i { background: var(--yellow-d); }
.bar.bad i { background: var(--red); }
.money-card { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.money-card .ico { width: 42px; height: 42px; color: var(--yellow-d); }
.money-card b { font-size: 26px; display: block; line-height: 1.1; }
.money-card span { color: var(--muted); font-size: 13px; }
.target-card { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.target-card .lbl { font-weight: 700; font-size: 14px; }
.target-card b { font-size: 24px; display: block; }

.tbl-wrap { overflow-x: auto; border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; background: #F6F8FC; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFBFE; }
.tbl.small th, .tbl.small td { padding: 7px 9px; font-size: 13px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 800; background: #F6F8FC; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-green { background: var(--green-l); color: var(--green-d); }
.badge-red { background: var(--red-l); color: var(--red); }
.badge-orange { background: var(--orange-l); color: #B9470A; }
.badge-navy { background: #E6EDF9; color: var(--navy); }
.badge-gray { background: #EEF1F6; color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 140px; }
.filters .input { padding: 9px 11px; font-size: 14px; }
.tabs { display: inline-flex; background: #E4EAF3; padding: 4px; border-radius: 10px; gap: 2px; }
.tabs a { padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding: 12px 4px 0; font-size: 14px; }
.pager a { color: var(--navy-2); font-weight: 600; }
.pager .off { color: #B4BECE; }

.suggest { position: relative; }
.suggest-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: min(380px, 92vw); z-index: 70; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 43, 95, .16);
  max-height: 320px; overflow-y: auto; padding: 4px;
}
.modal .suggest-list { position: static; margin-top: 4px; box-shadow: none; }
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.suggest-item.on, .suggest-item:hover { background: #EEF3FA; }
.suggest-item .s-main { flex: 1; min-width: 0; font-size: 14px; }
.suggest-item .s-main > span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .s-plate { font-style: normal; color: var(--muted); font-size: 13px; }
.suggest-empty { padding: 10px; color: var(--muted); font-size: 14px; }
.bus-info { margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.modal { position: fixed; inset: 0; background: rgba(6, 28, 66, .55); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal.open { display: flex; }
.modal .panel { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.trend { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 10px; }
.trend .t-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 11.5px; color: var(--muted); }
.trend .t-bar { width: 100%; max-width: 38px; background: var(--navy-2); border-radius: 4px 4px 0 0; min-height: 2px; }
.trend .t-col.today .t-bar { background: var(--yellow); }
.trend .t-val { font-weight: 700; color: var(--ink); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
.side-backdrop { display: none; }
@media (max-width: 860px) {
  .adm-top { padding: 0 10px 0 6px; gap: 6px; padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
  .adm-top .menu-toggle { display: grid; }
  .adm-top .brand .dash-title { display: none; }
  .adm-top .who .meta { display: none; }
  .adm-side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: 270px; max-width: 82vw;
    padding-top: calc(70px + env(safe-area-inset-top)); overflow-y: auto;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .adm-side a { padding: 13px 14px; font-size: 15.5px; }
  .side-open .adm-side { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .35); }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(6, 28, 66, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-open .side-backdrop { opacity: 1; pointer-events: auto; }
  .side-open { overflow: hidden; }
  .adm-main { padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); gap: 14px; }
}

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  /* stop iOS zooming into inputs */
  .input, select.input, textarea.input, .filters .input { font-size: 16px; }
  .btn-sm { min-height: 38px; }

  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head h1 { font-size: 21px; }
  .page-head .actions { margin-left: 0; }
  .page-head .actions > .btn, .page-head .actions > .input { flex: 1 1 auto; }

  .panel { padding: 14px; }
  .filters { gap: 10px; }
  .filters .field { min-width: 0; flex: 1 1 calc(50% - 5px); }
  .filters .field[style*="flex:1"] { flex-basis: 100%; }
  .filters > .btn { flex: 1 1 100%; }
  .filters > a.btn { flex: 1 1 calc(33% - 7px); padding-left: 8px; padding-right: 8px; }

  .kpis { gap: 10px; }
  .kpi { padding: 14px 8px; }
  .kpi .num { font-size: 24px !important; overflow-wrap: anywhere; }
  .kpi .lbl { font-size: 12.5px; }
  .kpi .k-ico { width: 34px; height: 34px; }
  .kpi .k-ico .ico { width: 28px; height: 28px; }
  .bar-row { grid-template-columns: 62px 1fr 40px; }
  .money-card b { font-size: 22px; }
  .trend { height: 120px; gap: 4px; }
  .trend .t-col { font-size: 10.5px; }

  .tabs { display: flex; overflow-x: auto; }
  .tabs a { flex: 1; text-align: center; white-space: nowrap; }

  /* Tables become stacked cards */
  .tbl-wrap { overflow: visible; }
  .panel.has-cards { background: transparent; border: 0; box-shadow: none; padding: 0 !important; }
  .panel.has-cards > h3 { padding: 0 2px 4px !important; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tfoot, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr {
    background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 0 0 10px;
    padding: 4px 14px; box-shadow: var(--shadow);
  }
  .tbl.cards tbody tr:hover td { background: none; }
  .tbl.cards td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 0; border-bottom: 1px dashed var(--line); text-align: right; font-size: 14.5px; min-height: 40px;
  }
  .tbl.cards td::before {
    content: attr(data-label); flex: none; max-width: 45%; text-align: left;
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  }
  .tbl.cards td[data-label=""]::before { display: none; }
  .tbl.cards td[data-label=""] { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  .tbl.cards td:first-child { font-size: 15.5px; }
  .tbl.cards tr td:last-child { border-bottom: 0; }
  .tbl.cards td.num { text-align: right; }
  .tbl.cards td .cell-v { display: block; min-width: 0; text-align: right; }
  .tbl.cards td .cell-v:has(.bar-row) { flex: 1; max-width: 62%; }
  .tbl.cards td .bar-row { width: 100%; }
  .tbl.cards td.empty { justify-content: center; text-align: center; color: var(--muted); }
  .tbl.cards tfoot tr { background: #F6F8FC; }
  .tbl.cards tfoot td { background: none; }

  .pager { justify-content: space-between; }

  /* Modals become bottom sheets */
  .modal { align-items: flex-end; padding: 0; }
  .modal .panel {
    max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    animation: sheet-up .22s ease;
  }
  .modal .row .btn { flex: 1; }
  .modal .row .spacer { display: none; }
  .form-grid { grid-template-columns: 1fr; }

  /* Receipt */
  .receipt { margin: 12px auto; border-radius: 14px; }
  .receipt-head { padding: 16px; flex-wrap: wrap; }
  .receipt-body { padding: 16px; }
  .receipt-foot { padding: 12px 16px 18px; }
  .receipt-foot .btn { flex: 1; }
  .kv { gap: 10px 12px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 380px) {
  .adm-top .brand { font-size: 16px; }
  .adm-top .who .avatar { display: none; }
  .filters .field { flex-basis: 100%; }
  .kpi .num { font-size: 21px !important; }
}

/* ---------- Driver app on phones ---------- */
.sticky-cta {
  position: sticky; bottom: 0; z-index: 5; margin: auto -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(243, 246, 251, 0), #F3F6FB 30%);
}
.app-bar { padding-top: calc(14px + env(safe-area-inset-top)); }
.app-shell { padding-bottom: env(safe-area-inset-bottom); }
@media (max-width: 440px) {
  .app-shell { box-shadow: none; }
  .app-main { padding: 14px 12px; }
  .sticky-cta { margin: auto -12px 0; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 360px) {
  .app-bar h1 { font-size: 16.5px; }
  .brand-row .brand { font-size: 19px; }
  .profile-card { gap: 10px; padding: 12px; }
  .profile-card .bus-img { width: 72px; height: 56px; }
  .profile-card dl { font-size: 13px; }
  .status-card strong { font-size: 20px; }
  .big-check { width: 46px; height: 46px; }
  .cal-grid { gap: 2px; padding: 0 6px 10px; }
  .cal-day { min-height: 38px; font-size: 14px; }
  .cal-dow { font-size: 11px; }
  .method { padding: 12px 10px; gap: 9px; }
  .method .m-ico { width: 22px; height: 22px; }
  .stat-trio b { font-size: 18px; }
  .kv { font-size: 13.5px; }
}

/* =========================================================
   Receipt
   ========================================================= */
.receipt { max-width: 520px; margin: 24px auto; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(11, 43, 95, .12); overflow: hidden; }
.receipt-head { background: var(--navy); color: #fff; padding: 20px 22px; display: flex; align-items: center; gap: 12px; }
.receipt-head .wordmark { font-size: 22px; }
.receipt-head small { display: block; opacity: .8; font-size: 12.5px; }
.receipt-head .paid-stamp { margin-left: auto; border: 2px solid var(--yellow); color: var(--yellow); padding: 4px 10px; border-radius: 8px; font-weight: 800; letter-spacing: .08em; font-size: 13px; transform: rotate(-4deg); }
.receipt-body { padding: 20px 22px; }
.receipt-body .kv { padding: 0; }
.receipt-total { display: flex; justify-content: space-between; align-items: center; background: var(--green-l); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.receipt-total b { font-size: 24px; color: var(--green-d); }
.receipt-days { margin-top: 16px; }
.receipt-days span { display: inline-block; margin: 3px 4px 0 0; }
.receipt-foot { padding: 14px 22px 20px; display: flex; gap: 10px; border-top: 1px dashed var(--line); }
@media print {
  body { background: #fff !important; }
  .no-print, .adm-top, .adm-side, .app-bar, .drawer, .drawer-backdrop { display: none !important; }
  .receipt { box-shadow: none; margin: 0 auto; }
  .app-shell { box-shadow: none; }
}
