/* ==========================================================================
   Kotamix Concrete - application stylesheet
   Mobile-first. Sidebar becomes an off-canvas drawer under 1000px.
   ========================================================================== */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #16202b;
  --ink-2: #46576a;
  --muted: #7b8a9c;
  --line: #e3e8ee;
  --line-2: #cfd8e2;

  --brand: #1f5fa9;
  --brand-d: #164a83;
  --brand-l: #e8f0f9;
  --green: #17794a;
  --green-l: #e4f4ea;
  --amber: #9a6212;
  --amber-l: #fdf1dc;
  --red: #b3261e;
  --red-l: #fdecea;
  --teal: #0d6a72;
  --teal-l: #e0f2f4;

  --r: 10px;
  --r-s: 7px;
  --sh: 0 1px 2px rgba(20, 32, 45, .06), 0 1px 3px rgba(20, 32, 45, .05);
  --sh-2: 0 4px 14px rgba(20, 32, 45, .09);
  --nav-w: 232px;
  --top-h: 54px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }
p { margin: 0 0 .5em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .tiny { font-size: 12px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12.5px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.nowrap { white-space: nowrap; }
.trunc { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.neg { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.teal { color: var(--teal); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.ic { flex: none; vertical-align: -.18em; }

/* ============================ TOP BAR ============================ */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--brand-d); color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 650; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  background: rgba(255, 255, 255, .16); border-radius: 8px;
}
.brand-logo { height: 26px; flex: none; background: #fff; border-radius: 6px; padding: 2px 6px; }
.login-logo { height: 42px; background: #fff; border-radius: 10px; padding: 4px 10px; }
.brand-text { font-size: 15px; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-switch {
  color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; white-space: nowrap;
}
.lang-switch:hover { background: rgba(255, 255, 255, .15); text-decoration: none; }
.user-chip { display: flex; align-items: center; gap: 7px; padding-left: 6px; min-width: 0; }
.avatar {
  width: 27px; height: 27px; flex: none; border-radius: 50%;
  background: rgba(255, 255, 255, .22); display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
}
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.user-role { font-size: 11px; opacity: .75; white-space: nowrap; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 8px; background: rgba(255, 255, 255, .13); color: #fff; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .26); text-decoration: none; }
.only-mobile { display: grid; }
.only-desktop { display: none; }

/* ============================ SHELL / SIDENAV ============================ */
.shell { padding-top: var(--top-h); min-height: 100vh; }
.sidenav {
  position: fixed; z-index: 55; top: var(--top-h); bottom: 0; left: 0; width: var(--nav-w);
  overflow-y: auto; overscroll-behavior: contain;
  background: #10243a; color: #c6d3e0; padding: 10px 0 24px;
  transform: translateX(-100%); transition: transform .22s ease;
  scrollbar-width: thin;
}
.sidenav.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 20, 30, .45); }
.sidenav-scrim { display: none; }
.sidenav-scrim.on { display: block; position: fixed; z-index: 54; inset: var(--top-h) 0 0 0; background: rgba(10, 20, 30, .45); }
.nav-group { padding: 8px 10px 2px; }
.nav-group + .nav-group { border-top: 1px solid rgba(255, 255, 255, .07); margin-top: 4px; }
.nav-group-title {
  font-size: 10.5px; letter-spacing: .9px; text-transform: uppercase;
  color: #7c90a6; padding: 6px 10px 4px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0;
  border-radius: var(--r-s); color: #c6d3e0; font-size: 13.5px; font-weight: 500;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav-item.on { background: var(--brand); color: #fff; font-weight: 600; }
.nav-item .ic { opacity: .85; }
.nav-item.on .ic { opacity: 1; }

.main { padding: 14px; max-width: 1500px; margin: 0 auto; }
.main.bleed { max-width: none; padding: 0; }

/* ============================ PAGE HEAD ============================ */
.page-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  justify-content: space-between; margin-bottom: 14px;
}
.page-head h1 { font-size: 20px; letter-spacing: -.2px; }
.page-head .sub { margin: 2px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================ FLASH ============================ */
.flash-wrap { display: grid; gap: 8px; margin-bottom: 12px; }
.flash {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border-radius: var(--r); border: 1px solid var(--green-l); background: var(--green-l); color: var(--green);
  font-weight: 550; box-shadow: var(--sh);
}
.flash.err { background: var(--red-l); border-color: #f6c9c5; color: var(--red); }
.flash.warn { background: var(--amber-l); border-color: #f2ddb4; color: var(--amber); }
.flash span { flex: 1; min-width: 0; }
.flash-x { color: inherit; opacity: .6; display: grid; place-items: center; }
.flash-x:hover { opacity: 1; }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border-radius: var(--r-s); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.08); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-danger-ghost { background: #fff; border-color: #e8b4b0; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-l); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(20, 32, 45, .05); }
.btn-link { background: none; border: 0; color: var(--brand); padding: 4px 6px; }
.btn-link:hover { background: var(--brand-l); text-decoration: none; }
.btn.sm, .btn-xs { padding: 5px 9px; font-size: 12.5px; }
.btn.xs { padding: 3px 7px; font-size: 12px; }
.btn-block { width: 100%; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.inline-form { display: inline; }

/* ============================ CARDS ============================ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); padding: 14px; margin-bottom: 12px; min-width: 0;
}
.card > :last-child { margin-bottom: 0; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: -2px 0 12px; flex-wrap: wrap;
}
.card-head h2 { font-size: 14.5px; letter-spacing: .1px; }
.card-head-right { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.grid-1, .grid-2, .grid-3, .grid-doc, .grid-side { display: grid; gap: 12px; }
.grid-doc { grid-template-columns: 1fr; }
.grid-side { grid-template-columns: 1fr; }
.stack { display: grid; gap: 12px; align-content: start; min-width: 0; }

/* ============================ TABLES ============================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 8px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl thead th {
  font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
  font-weight: 700; white-space: nowrap; background: var(--surface-2);
  border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 1;
}
.tbl tbody tr:hover { background: #f8fafc; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.ta-right { text-align: right; white-space: nowrap; }
.tbl.kv th { width: 44%; font-weight: 550; color: var(--ink-2); }
.tbl.kv td { font-weight: 500; }
.tbl.big td, .tbl tr.big th, .tbl tr.big td { font-size: 15px; }
.tbl.sub-row td { border-bottom: 0; padding-top: 0; }
.h-sm td { height: 34px; }
.empty {
  display: grid; place-items: center; gap: 6px; padding: 30px 12px; text-align: center;
  color: var(--muted); font-size: 13px;
}

/* ============================ BADGES ============================ */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  background: #eef1f5; color: var(--ink-2); white-space: nowrap; line-height: 1.5;
}
.badge.ok, .badge.st-paid, .badge.st-completed, .badge.st-returned, .badge.st-delivered,
.badge.st-received, .badge.st-active, .badge.st-confirmed, .badge.st-present, .badge.st-available {
  background: var(--green-l); color: var(--green);
}
.badge.warn, .badge.st-loading, .badge.st-partial, .badge.st-late, .badge.st-pending,
.badge.st-planned, .badge.st-maintenance, .badge.st-leave {
  background: var(--amber-l); color: var(--amber);
}
.badge.err, .badge.st-cancelled, .badge.st-void, .badge.st-failed, .badge.st-overdue,
.badge.st-absent, .badge.st-resigned {
  background: var(--red-l); color: var(--red);
}
.badge.info, .badge.st-confirmed, .badge.st-dispatched, .badge.st-loading, .badge.st-on_delivery {
  background: var(--brand-l); color: var(--brand-d);
}
.badge.neutral, .badge.st-draft, .badge.st-unpaid, .badge.st-off, .badge.st-rest, .badge.st-ordered {
  background: #eef1f5; color: var(--ink-2);
}
.badge.st-dispatched, .badge.st-on_delivery { background: var(--teal-l); color: var(--teal); }
.badge.st-delivered, .badge.st-returned, .badge.st-completed { background: var(--green-l); color: var(--green); }
.badge.st-loading { background: var(--amber-l); color: var(--amber); }
.badge.mix { background: #efe8f8; color: #5a3a8e; }
.badge.role-admin { background: #efe8f8; color: #5a3a8e; }
.badge.role-office { background: var(--brand-l); color: var(--brand-d); }
.badge.role-driver { background: var(--teal-l); color: var(--teal); }
.badge.m-cash { background: var(--green-l); color: var(--green); }
.badge.m-bank { background: var(--brand-l); color: var(--brand-d); }
.badge.m-online { background: #efe8f8; color: #5a3a8e; }

/* ============================ STATS ============================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-link { display: block; text-decoration: none; color: inherit; }
.stat-link:hover { text-decoration: none; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); padding: 11px 12px; height: 100%;
  display: flex; flex-direction: column; gap: 3px;
}
.stat:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stat-label { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat-ic { color: var(--line-2); display: grid; place-items: center; }
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; }
.stat-sub { font-size: 11.5px; color: var(--muted); }
.stat.warn { border-color: #f2ddb4; background: linear-gradient(#fff, var(--amber-l)); }
.stat.warn .stat-value { color: var(--amber); }
.stat.err { border-color: #f6c9c5; background: linear-gradient(#fff, var(--red-l)); }
.stat.err .stat-value { color: var(--red); }
.stat.good { border-color: #bfe2cd; background: linear-gradient(#fff, var(--green-l)); }
.stat.good .stat-value { color: var(--green); }
.stat.brand { background: linear-gradient(#fff, var(--brand-l)); border-color: #c6dcf1; }
.stat.brand .stat-value { color: var(--brand-d); }

/* ============================ FORMS ============================ */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-label i { color: var(--red); font-style: normal; }
.field-hint { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=time], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-s);
  min-height: 38px; -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%237b8a9c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l);
}
input:disabled, select:disabled, textarea:disabled { background: #f1f3f6; color: var(--muted); }
input[type=checkbox] { width: 17px; height: 17px; min-height: 0; accent-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; }
.form-inline-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-inline-row .field { flex: 1 1 150px; }
.form-divider { height: 1px; background: var(--line); margin: 6px 0; border: 0; }
.form-section-title { font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); padding: 12px; margin-bottom: 12px;
}
.filters-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 9px; flex: 1 1 320px; min-width: 0; }
.filters-fields .field-label { font-size: 11px; }
.filters-btns { display: flex; gap: 8px; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: 12.5px; font-weight: 550;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.toolbar-text { font-size: 13px; color: var(--ink-2); }
.toolbar-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 3px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 12px; padding-bottom: 1px; }
.tab {
  padding: 8px 13px; border-radius: var(--r-s) var(--r-s) 0 0; color: var(--ink-2);
  font-size: 13.5px; font-weight: 550; white-space: nowrap; border-bottom: 2px solid transparent;
}
.tab:hover { background: var(--surface); text-decoration: none; }
.tab.on { color: var(--brand-d); border-bottom-color: var(--brand); font-weight: 650; }
.tab b { margin-left: 5px; font-size: 11px; background: #eef1f5; border-radius: 999px; padding: 1px 6px; color: var(--ink-2); }
.tab.on b { background: var(--brand-l); color: var(--brand-d); }
.lang-tabs { margin-bottom: 14px; }

.alert {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: var(--r);
  background: var(--amber-l); color: var(--amber); border: 1px solid #f2ddb4; font-size: 13px; margin-bottom: 12px;
}
.alert.err { background: var(--red-l); color: var(--red); border-color: #f6c9c5; }
.alert.ok { background: var(--green-l); color: var(--green); border-color: #bfe2cd; }

.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.pager-links { display: flex; gap: 4px; }
.pager-b {
  min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center;
  border-radius: var(--r-s); border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  font-size: 12.5px; font-weight: 600;
}
.pager-b:hover { background: var(--surface-2); text-decoration: none; }
.pager-b.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-gap { display: grid; place-items: center; padding: 0 3px; }

/* ============================ DETAIL HEAD ============================ */
.detail-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.detail-no { font-size: 17px; font-weight: 700; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.detail-numbers { display: flex; gap: 20px; flex-wrap: wrap; }
.detail-numbers > div { text-align: right; }
.detail-numbers span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.detail-numbers b { font-size: 16px; font-weight: 700; }
.trip-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }

/* ============================ STEPPER ============================ */
.stepper { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.step { flex: 1 1 0; min-width: 84px; text-align: center; position: relative; padding-top: 2px; }
.step::before {
  content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line-2);
}
.step:first-child::before { display: none; }
.step.done::before { background: var(--green); }
.step-dot {
  position: relative; z-index: 1; display: grid; place-items: center; margin: 0 auto 4px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2);
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.step.done .step-dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.now .step-dot { box-shadow: 0 0 0 4px var(--green-l); }
.step-lbl { font-size: 10.5px; font-weight: 600; color: var(--muted); display: block; line-height: 1.25; }
.step.done .step-lbl, .step.now .step-lbl { color: var(--ink); }

/* ============================ BOARD (delivery board) ============================ */
.board { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 12px; }
.board-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.board-col-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; font-weight: 700;
}
.board-col-head .badge { margin-left: auto; }
.board-col-body { padding: 9px; display: grid; gap: 8px; }
.board-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 14px 6px; }
.trip-chip {
  display: block; border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 10px;
  background: #fff; color: inherit; box-shadow: var(--sh);
}
.trip-chip:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--sh-2); }
.tc-top { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tc-cust { font-weight: 650; font-size: 13px; }
.tc-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.board-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.board-assign { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* ============================ SLOT GRID (schedule) ============================ */
.date-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.date-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.slot-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.slot-head { padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.slot-n { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.slot-chips { padding: 9px; display: grid; gap: 8px; }

/* ============================ BARS / CHARTS ============================ */
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; }
.bar-label { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #eef1f5; border-radius: 999px; height: 9px; overflow: hidden; }
.bar-fill { background: var(--brand); height: 100%; border-radius: 999px; }
.bar-val { font-size: 12px; font-weight: 650; white-space: nowrap; }
.aging-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef1f5; margin: 8px 0 4px; }
.aging-seg { height: 100%; }
.aging-seg.s-current { background: var(--green); }
.aging-seg.s-d1 { background: #e0a92f; }
.aging-seg.s-d2 { background: #d98218; }
.aging-seg.s-d3 { background: #cf5c12; }
.aging-seg.s-d4 { background: var(--red); }
.fuel-bar { position: relative; height: 16px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.fuel-fill { height: 100%; background: linear-gradient(90deg, #3a9b6e, #58bd8b); }
.fuel-bar.low .fuel-fill { background: linear-gradient(90deg, #d98218, #e5a13a); }
.fuel-bar.crit .fuel-fill { background: linear-gradient(90deg, #b3261e, #d9574e); }
.fuel-txt { font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); padding-left: 6px; line-height: 16px; }
.mini-prog { display: flex; align-items: center; gap: 6px; }
.mini-track { flex: 1; height: 6px; background: #eef1f5; border-radius: 999px; overflow: hidden; min-width: 40px; }
.mini-fill { height: 100%; background: var(--brand); }
.mini-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.chart-bar { flex: 1; width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart-lbl { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ============================ FLEET ============================ */
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fleet-card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: #fff; box-shadow: var(--sh); }
.fleet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fleet-reg { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tank-list { display: grid; gap: 8px; }
.tank-row { display: grid; gap: 3px; }
.tank-code { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.method-card { border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; background: #fff; }
.method-card.m-cash { border-left: 4px solid var(--green); }
.method-card.m-bank { border-left: 4px solid var(--brand); }
.method-card.m-online { border-left: 4px solid #7a4fb5; }
.mc-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.mc-amt { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.mc-n { font-size: 11.5px; color: var(--muted); }

/* ============================ DANGER ZONE ============================ */
.danger-zone { border: 1px solid #f0c4c0; background: #fff8f7; border-radius: var(--r); padding: 12px; }
.danger-zone h3 { font-size: 13px; color: var(--red); margin-bottom: 4px; }

/* ============================ LOGIN ============================ */
.login-body, .pay-body {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(160deg, #164a83 0%, #10243a 60%, #0b1927 100%);
}
.login-wrap, .pay-wrap { width: 100%; max-width: 420px; }
.login-card, .pay-card {
  background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 18px 46px rgba(0, 0, 0, .3);
}
.pay-card { max-width: 480px; }
.center { text-align: center; }
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; color: #fff; margin-bottom: 16px; }
.login-brand .brand-mark { width: 40px; height: 40px; background: rgba(255, 255, 255, .18); }
.login-brand .brand-mark.big { width: 46px; height: 46px; }
.login-brand h1 { font-size: 19px; }
.login-brand p { margin: 0; font-size: 12.5px; opacity: .85; width: 100%; }
.login-demo code { display: inline-block; font-family: var(--mono); font-size: 12px; }
.login-brand .brand-text { font-size: 17px; }
.login-form { display: grid; gap: 11px; }
.login-demo {
  margin-top: 14px; padding: 11px 12px; background: var(--surface-2);
  border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 12.5px; color: var(--ink-2);
}
.login-demo b { color: var(--ink); }
.login-foot { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pay-head { text-align: center; margin-bottom: 14px; }
.pay-big { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.pay-amt { font-size: 30px; font-weight: 700; letter-spacing: -.6px; }
.pay-bank { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin: 12px 0; }
.bank-acct { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.bank-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pay-form { display: grid; gap: 11px; }

/* ============================ PRINT DOCUMENTS ============================ */
.print-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--sh);
}
.print-hint { flex: 1; font-size: 11.5px; color: var(--muted); text-align: center; }
.print-sheets { display: grid; gap: 14px; padding: 14px; justify-items: center; }
.print-sheets.a5-2up { grid-template-columns: 1fr; }
.sheet {
  background: #fff; width: 100%; max-width: 800px; padding: 22px;
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--sh);
  font-size: 12.5px; line-height: 1.4; color: #000;
}
.sheet .doc-title { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.sheet .doc-no { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.sheet .doc-co { font-size: 14px; font-weight: 700; }
.sheet .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #555; display: inline-block; min-width: 74px; }
.sheet .sign-line { border-bottom: 1px solid #333; height: 30px; min-width: 150px; }
.sheet .ps-sign { display: flex; gap: 26px; flex-wrap: wrap; }
.sheet .ps-head { font-size: 11px; font-weight: 700; }
.sheet .words { margin-top: 8px; }
.sheet .write-in { display: inline-block; border-bottom: 1px solid #666; min-width: 70px; height: 15px; }
.sheet .dn-strip { height: 4px; background: var(--brand); border-radius: 2px; margin-bottom: 10px; }
.sheet .copy-driver .dn-strip { background: #6b7c8f; }
.sheet .muted { color: #555; }

.doc-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.doc-parties {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 12px 0; padding: 9px 0; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc;
}
.doc-ref { font-size: 11.5px; margin-bottom: 8px; }
.dn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-bottom: 10px; }
.dn-times { width: 100%; border-collapse: collapse; margin-top: 8px; }
.dn-times th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #555; font-weight: 700; padding: 3px 6px 3px 0; width: 22%; }
.dn-times td { border-bottom: 1px solid #ddd; padding: 3px 8px 3px 0; width: 28%; }
.doc-tbl { margin-top: 8px; }
.doc-tbl th, .doc-tbl td { border: 1px solid #ccc; padding: 5px 7px; }
.doc-tbl thead th { background: #f0f0f0; text-transform: uppercase; font-size: 10px; letter-spacing: .4px; }
.doc-total { margin-top: 10px; margin-left: auto; max-width: 320px; }
.doc-total > div { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; font-size: 12.5px; }
.doc-total > div.grand { border-top: 1px solid #999; font-size: 14px; font-weight: 700; padding-top: 5px; }
.doc-foot {
  display: flex; justify-content: space-between; gap: 20px; align-items: flex-end;
  margin-top: 22px; padding-top: 10px; border-top: 1px solid #ccc; flex-wrap: wrap;
}
.grand-row td { font-size: 14px; }

/* ============================ RESPONSIVE ============================ */
@media (min-width: 620px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main { padding: 18px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .dn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .only-mobile { display: none; }
  .only-desktop { display: grid; }
  .sidenav { transform: none; box-shadow: none; }
  .sidenav-scrim { display: none !important; }
  .shell { padding-left: var(--nav-w); }
  .main { padding: 20px 24px 40px; }
  .board { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid-doc { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .grid-side { grid-template-columns: minmax(0, 1fr) 320px; }
  .print-sheets.a5-2up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet.a5 { max-width: 420px; }
}

@media (min-width: 1280px) {
  .board { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ============================ PRINT MEDIA ============================ */
@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  .no-print, .topbar, .sidenav, .sidenav-scrim, .flash-wrap, .page-head, .filters, .toolbar, .pager { display: none !important; }
  .shell { padding: 0 !important; padding-top: 0 !important; }
  .main, .print-sheets { padding: 0; margin: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .sheet {
    box-shadow: none; border: 0; border-radius: 0; max-width: none; width: 100%;
    padding: 0; page-break-after: always; break-after: page;
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  .print-sheets.a5-2up { display: block; }
  .print-sheets.a5-2up .sheet { page-break-after: always; }
  a { color: #000; text-decoration: none; }
  .tbl thead th { position: static; }
  tbody tr { page-break-inside: avoid; }
  .badge { border: 1px solid #999; background: none !important; color: #000 !important; }
}

/* Print-size hints */
@media print {
  .print-a5 .sheet { font-size: 10.5pt; }
  .print-a5 { }
}
