/* Holistic Legacy Accounting - Information Technology Department. All rights reserved. Proprietary and internal (see LICENSE). */
:root {
  --bg: #f4f6f8; --card: #fff; --ink: #1d2733; --muted: #6b7785; --line: #e3e8ee;
  --brand: #0f6e6e; --brand-2: #e7f3f2; --danger: #b42318; --danger-bg: #fdecea; --warn: #b54708; --warn-bg: #fff4e5;
  --ok: #067647; --ok-bg: #e7f6ee; --info: #175cd3; --info-bg: #eaf1fd; --radius: 10px;
  --accent: #c8a24a; --font: Arial, sans-serif;
  font-family: var(--font);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; font-family: var(--font); }
button, input, select, textarea { font-family: inherit; }
a { color: var(--brand); text-decoration: none; }
h2 { margin: 0; font-size: 22px; } h3 { margin: 0 0 12px; font-size: 16px; } h4 { margin: 16px 0 8px; }
.muted { color: var(--muted); } .d-block { display: block; } .nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; font-weight: 500; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; margin-top: 12px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; line-height: 1.2; }
.btn:hover { background: #f0f3f6; } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-outline { color: var(--danger); border-color: #f1b8b2; }
.btn.small { padding: 5px 10px; font-size: 13px; } .btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn.link { border: 0; background: none; color: var(--brand); width: 100%; justify-content: center; }
.icon-btn { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, #0f6e6e 0%, #0b4f5c 100%); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 28px; display: grid; gap: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand .logo { width: 38px; height: 38px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 20px; flex: none; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand.big h1 { margin: 0; font-size: 20px; } .brand.big p { margin: 2px 0 0; color: var(--muted); }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: none; background: #fff; border-inline-end: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: grid; gap: 2px; flex: 1; overflow: auto; align-content: start; }
.sidebar nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--ink); }
.sidebar nav a:hover { background: #f0f3f6; } .sidebar nav a.active { background: var(--brand-2); color: var(--brand); font-weight: 600; }
.sidebar .ic { width: 20px; text-align: center; opacity: .8; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.side-foot .who small { display: block; color: var(--muted); }
.main { flex: 1; min-width: 0; padding: 22px 26px 40px; }
.menu-btn { display: none; margin-bottom: 10px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 620px; }
.table-card { padding: 0; overflow-x: auto; } .table-card > h3 { padding: 16px 16px 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); display: grid; gap: 6px; }
a.stat:hover { border-color: var(--brand); }
.stat small { color: var(--muted); } .stat b { font-size: 24px; font-variant-numeric: tabular-nums; }
.stats.money .stat b { font-size: 20px; }
.stat.warn { background: var(--warn-bg); border-color: #f7d4a8; } .stat.warn b { color: var(--warn); }
.stat.accent { background: var(--brand-2); border-color: #bfe0dd; } .stat.accent b { color: var(--brand); }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 50px; gap: 10px; align-items: center; padding: 5px 0; color: var(--ink); }
.bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bar-row b { text-align: end; }
.bar { height: 10px; background: #eef1f4; border-radius: 6px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafb; font-weight: 600; color: #3d4955; font-size: 13px; white-space: nowrap; }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7fbfb; }
tr.hl td { background: var(--brand-2); }
tfoot td { font-weight: 700; background: #f8fafb; }
td.empty { text-align: center; color: var(--muted); padding: 28px; }
table.perm td, table.perm th { text-align: center; padding: 7px; } table.perm td:first-child, table.perm th:first-child { text-align: start; }
.changes { margin: 0; padding-inline-start: 16px; font-size: 13px; } .changes s { color: var(--muted); }
.chips { max-width: 420px; } .chip { display: inline-block; background: #f0f3f6; border-radius: 12px; padding: 2px 8px; margin: 2px; font-size: 12px; }

/* badges & progress */
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #eef1f4; color: #3d4955; white-space: nowrap; }
.s-in_service { background: var(--ok-bg); color: var(--ok); } .s-in_storage { background: var(--info-bg); color: var(--info); }
.s-under_maintenance { background: var(--warn-bg); color: var(--warn); } .s-lost, .s-scrapped { background: var(--danger-bg); color: var(--danger); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.accent { background: var(--brand-2); color: var(--brand); }
.a-delete, .a-scrap, .a-login_failed, .a-deactivate { background: var(--danger-bg); color: var(--danger); }
.a-create, .a-login { background: var(--ok-bg); color: var(--ok); } .a-update, .a-assign { background: var(--info-bg); color: var(--info); }
.progress { width: 90px; height: 7px; background: #eef1f4; border-radius: 5px; overflow: hidden; } .progress.lg { width: 100%; height: 10px; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--brand); } .progress.full i { background: var(--warn); }

/* key-values & timeline */
.kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 18px; margin-bottom: 8px; }
.kv small { display: block; color: var(--muted); margin-bottom: 3px; } .kv b { font-weight: 600; } .kv.full { grid-column: 1 / -1; }
.big-num { font-size: 20px; color: var(--brand); }
.timeline { display: grid; gap: 0; margin-bottom: 10px; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; padding-inline-start: 0; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-inline-start: -7px; margin-top: 3px; }
.ev-scrapped .tl-dot { background: var(--danger); } .ev-assigned .tl-dot { background: var(--info); } .ev-restored .tl-dot { background: var(--ok); }

/* forms */
.form h3 { margin-top: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.form-grid { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.field { display: grid; gap: 5px; } .field.full, .check.full { grid-column: 1 / -1; }
.field > span { font-weight: 600; font-size: 13px; } .field small { color: var(--muted); font-size: 12px; } .req { color: var(--danger); font-style: normal; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd3cf; border-color: var(--brand); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
input:disabled { background: #f3f5f7; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; } .filters input[name=q] { min-width: 220px; flex: 1; }
.inline { display: flex; gap: 6px; align-items: center; }
.page-head select { width: auto; }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 12px; }

/* modal & toast */
.modal-wrap { position: fixed; inset: 0; height: 100vh; height: 100dvh; background: rgba(15, 25, 35, .45); display: grid; place-items: center; padding: 16px; z-index: 50; overflow: hidden; overscroll-behavior: contain; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: 92vh; max-height: calc(100dvh - 32px); min-height: 0; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head, .modal-foot { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modal-head { border-bottom: 1px solid var(--line); } .modal-head h3 { margin: 0; }
.modal-foot { border-top: 1px solid var(--line); justify-content: flex-start; }
.modal-body { padding: 18px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; } .modal-body .form-grid { margin-bottom: 0; }
#toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; }
[dir=rtl] #toasts { transform: translateX(50%); }
.toast { padding: 10px 18px; border-radius: 8px; background: #1d2733; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.err { background: var(--danger); }
.empty-state { text-align: center; padding: 40px; }
.print-only { display: none; }

/* fleet & requests */
.sec-title { margin: 6px 0 10px; color: var(--muted); font-size: 14px; text-transform: none; }
.stat.danger { background: var(--danger-bg); border-color: #f1b8b2; } .stat.danger b { color: var(--danger); }
.notice { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.notice.warn { background: var(--warn-bg); border-color: #f7d4a8; color: var(--warn); font-weight: 600; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.table-foot { padding: 10px 14px; font-weight: 600; background: #f8fafb; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.tab span { background: #eef1f4; border-radius: 10px; padding: 0 7px; margin-inline-start: 4px; font-size: 12px; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; } .tab.active span { background: rgba(255,255,255,.25); }
.tab.danger:not(.active) { border-color: #f1b8b2; color: var(--danger); }
.rs-pending { background: var(--warn-bg); color: var(--warn); } .rs-approved { background: var(--info-bg); color: var(--info); }
.rs-handed_over { background: var(--brand-2); color: var(--brand); } .rs-returned { background: var(--ok-bg); color: var(--ok); }
.rs-rejected, .rs-cancelled { background: #eef1f4; color: var(--muted); }
.a-approve, .a-handover, .a-trip_in { background: var(--ok-bg); color: var(--ok); } .a-reject, .a-cancel { background: var(--danger-bg); color: var(--danger); }
.a-return, .a-trip_out, .a-odometer, .a-service { background: var(--info-bg); color: var(--info); }
.ev-handed_over .tl-dot, .ev-trip_out .tl-dot { background: var(--warn); } .ev-returned .tl-dot, .ev-trip_in .tl-dot { background: var(--ok); }
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.step { flex: 1; min-width: 140px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.step i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; background: #eef1f4; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.step.done { color: var(--brand); border-color: #bfe0dd; background: var(--brand-2); } .step.done i { background: var(--brand); color: #fff; }
.step.bad { color: var(--danger); border-color: #f1b8b2; background: var(--danger-bg); } .step.bad i { background: var(--danger); color: #fff; }
.print-form-area { display: none; }
.pf-block { page-break-after: always; padding: 10px 0; } .pf-block:last-child { page-break-after: auto; }
.pf-block h2 { text-align: center; margin-bottom: 14px; } .pf-block h3 { margin: 18px 0 8px; }
.pf-table th { width: 32%; background: #f3f3f3; } .pf-table th, .pf-table td { border: 1px solid #999; padding: 7px 10px; }
.pf-decl { margin: 18px 0 40px; line-height: 1.8; }
.pf-sign { display: flex; justify-content: space-between; gap: 40px; } .pf-sign div { flex: 1; text-align: center; }
.pf-sign span { display: block; border-bottom: 1px solid #333; height: 50px; margin-bottom: 6px; }

/* v3: navigation groups, letterhead, documents, forms */
.nav-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 12px 4px; }
.logo-img { object-fit: contain; background: #fff; padding: 2px; border: 1px solid var(--line); }
.brand .logo-img { width: 38px; height: 38px; border-radius: 9px; }
.lh-wrap { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; }
.lh-wrap > tbody > tr > td { min-width: 0; overflow-wrap: anywhere; }
.lh-wrap > thead > tr > td, .lh-wrap > tbody > tr > td, .lh-wrap > tfoot > tr > td { padding: 0; border: 0; background: none; }
.lh-only { display: none; }
.lh-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 3px solid var(--brand); margin-bottom: 14px; }
.lh-head .lh-ar, .lh-head .lh-en { flex: 1; display: grid; gap: 3px; } .lh-head .lh-en { text-align: left; } .lh-head .lh-ar { text-align: right; }
.lh-head b { font-size: 17px; color: var(--brand); } .lh-head small { color: #555; font-size: 11px; }
.lh-head.lh-center { flex-direction: column; text-align: center; } .lh-head.lh-center .lh-ar, .lh-head.lh-center .lh-en { text-align: center; } .lh-head.lh-center .lh-mid { order: -1; }
.lh-head.lh-start .lh-mid { order: -1; }
.lh-logo { max-height: 70px; max-width: 180px; object-fit: contain; }
.lh-foot { border-top: 2px solid var(--accent); padding-top: 6px; margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 11px; color: #444; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 0 10px; }
.table-card > .card-head { padding: 14px 16px 6px; } .table-card > .card-head h3 { padding: 0; margin: 0; }
.paper { max-width: 900px; margin: 0 auto; }
.preview-paper { border: 1px dashed #ccc; padding: 20px; background: #fff; } .preview-body { min-height: 120px; }
.logo-box { height: 110px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px; margin-bottom: 10px; background: #fafafa; }
.logo-box img { max-height: 100px; max-width: 90%; }
.logo-lg { width: 90px; height: 90px; border-radius: 12px; font-size: 40px; } .company-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; } .company-head h2, .company-head h3 { margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
table.lines { margin-bottom: 8px; } table.lines td { padding: 6px; border-bottom: 1px solid var(--line); } table.lines input, table.lines select { min-width: 90px; }
.chip.big { padding: 6px 12px; font-size: 13px; background: var(--brand-2); color: var(--brand); } .chip.big.danger { background: var(--danger-bg); color: var(--danger); }
ul.plain { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.report { background: #fbfbf8; border: 1px solid var(--line); border-radius: 8px; padding: 12px; line-height: 1.8; }
.list-row.link { color: var(--ink); } .list-row.link:hover { background: #f7fbfb; }
.my-card { border-color: var(--brand); } .my-card .stats { margin-bottom: 6px; }
.alert-card { border-color: #f7d4a8; }
.ts-requested, .ps-submitted { background: var(--warn-bg); color: var(--warn); } .ts-approved, .ps-approved, .ps-ordered { background: var(--info-bg); color: var(--info); }
.ts-out { background: var(--brand-2); color: var(--brand); } .ts-returned, .ps-received, .pay-paid { background: var(--ok-bg); color: var(--ok); }
.ts-rejected, .ts-cancelled, .ps-rejected, .ps-cancelled { background: #eef1f4; color: var(--muted); } .pay-unpaid { background: var(--danger-bg); color: var(--danger); } .pay-partial { background: var(--warn-bg); color: var(--warn); }
.a-upload, .a-order, .a-receive, .a-fuel { background: var(--info-bg); color: var(--info); } .a-clearance { background: var(--danger-bg); color: var(--danger); }
.ev-fuel .tl-dot { background: var(--accent); }
.pf-table.grid th { width: auto; } .pf-table.grid td, .pf-table.grid th { text-align: start; }
.print-area { display: none; }
.notice.full { grid-column: 1 / -1; margin: 0; }
.form-grid.full { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40; transform: translateX(-110%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  [dir=rtl] .sidebar { transform: translateX(110%); }
  .sidebar.open { transform: none !important; }
  .menu-btn { display: inline-flex; }
  .main { padding: 14px; }
}
@media print {
  .sidebar, .menu-btn, .page-head .row, .filters, .pager, .no-print, #toasts { display: none !important; }
  .main { padding: 0; } body { background: #fff; }
  .card { border: 0; padding: 0 0 12px; break-inside: avoid; }
  .print-only { display: block; } th { background: #eee !important; }
  tr.hl td { background: none; }
  body.print-form #view > *:not(.print-area) { display: none !important; }
  body.print-form .print-area { display: block; }
  .lh-only { display: table-header-group; } tfoot.lh-only { display: table-footer-group; }
  .lh-wrap { width: 100%; }
  .card.paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .no-print, .card-head .btn { display: none !important; }
  a { color: inherit; }
}
#openBox { margin-bottom: 16px; }

input[type=color] { height: 40px; padding: 3px; cursor: pointer; }

/* v4: bell, notifications, activity, reports */
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 6px; }
.topbar .menu-btn { margin: 0; margin-inline-end: auto; }
.bell { position: relative; font-size: 20px; text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.bell:hover { background: #fff; }
.bell-count { position: absolute; top: -2px; inset-inline-end: -4px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 6px; min-width: 18px; text-align: center; }
.nav-count { position: static; margin-inline-start: auto; }
.notif { display: flex; gap: 10px; align-items: flex-start; padding: 12px 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif:last-child { border-bottom: 0; } .notif:hover { background: #f7fbfb; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; margin-top: 6px; flex: none; }
.notif.unread { font-weight: 600; } .notif.unread .notif-dot { background: var(--brand); }
.toast.info { background: var(--brand); }
.k-page { background: #eef1f4; color: #3d4955; } .k-action { background: var(--info-bg); color: var(--info); } .k-file, .k-export { background: var(--warn-bg); color: var(--warn); }
a.tab { display: inline-block; text-decoration: none; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 6px; color: var(--ink); }
.report-card:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.report-card .ric { font-size: 26px; }
.small-text { font-size: 12px; max-width: 380px; }
@media print { .topbar { display: none !important; } .report-table { font-size: 11px; } .report-table th, .report-table td { padding: 5px 6px; } }

/* v5: signatures, policies, misc */
.sign-box { display: flex; gap: 14px; align-items: center; background: #fafbfc; border: 1px dashed var(--line); border-radius: 8px; padding: 10px; }
.sign-box > div { flex: 1; }
.sig-img { max-height: 70px; max-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.sig-current { margin: 8px 0 12px; min-height: 40px; }
.sig-pad { width: 100%; max-width: 520px; height: auto; aspect-ratio: 52 / 18; background: #fff; border: 2px dashed #b9c3cf; border-radius: 8px; touch-action: none; display: block; margin: 6px 0 10px; cursor: crosshair; }
.sig-list { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; }
.sig { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: grid; justify-items: center; gap: 2px; min-width: 170px; background: #fff; }
.sig img { max-height: 60px; max-width: 200px; }
.sig small { color: var(--muted); font-size: 11px; }
.policy-text { white-space: pre-wrap; line-height: 2; margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fcfcfa; }
.todo-card { border-color: var(--accent); }
.chip.bad { background: var(--danger-bg); color: var(--danger); }
.pad { padding: 8px 16px; display: block; }
.low-row td { background: #fff8ef; }
.ls-requested, .fs-pending_ack, .ms2-requested { background: var(--warn-bg); color: var(--warn); }
.ls-active, .fs-acknowledged, .ms2-approved, .ms2-in_progress { background: var(--info-bg); color: var(--info); }
.ls-returned, .fs-settled, .ms2-completed, .mv-in { background: var(--ok-bg); color: var(--ok); }
.fs-disputed, .fs-unassigned, .mv-out { background: var(--danger-bg); color: var(--danger); }
.ls-rejected, .ls-cancelled, .fs-company_paid, .fs-cancelled, .ms2-rejected, .ms2-cancelled, .mv-adjust { background: #eef1f4; color: var(--muted); }
.ps-with_accountant { background: var(--info-bg); color: var(--info); } .ps-paid { background: var(--brand-2); color: var(--brand); }
@media print { .sig { border: 0; } .sign-box { display: none; } }
/* v5.1: KPIs & vehicle evaluation */
.kpi-card .card-head .row { flex-wrap: wrap; gap: 6px; }
.kpi-sec { margin: 14px 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stats.kpis { margin-bottom: 4px; }
.stat.kpi b { font-size: 21px; }
.kdelta { font-size: 12px; font-variant-numeric: tabular-nums; }
.kdelta.good { color: #1f7a3e; } .kdelta.bad { color: var(--danger); } .kdelta.flat { color: var(--muted); }
.score { display: inline-block; width: 70px; height: 8px; background: #edf0f2; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-inline-end: 6px; }
.score i { display: block; height: 100%; }
.score i.g1 { background: #1f7a3e; } .score i.g2 { background: #4f9d69; } .score i.g3 { background: #d8962c; } .score i.g4 { background: #c0392b; }
.badge.ve-excellent { background: #dff3e6; color: #1f7a3e; } .badge.ve-good { background: #e8f4ec; color: #2f7d4b; }
.badge.ve-review { background: var(--warn-bg); color: var(--warn); } .badge.ve-replace { background: var(--danger-bg); color: var(--danger); } .badge.ve-na { background: #eef0f2; color: var(--muted); }
.row.wrap { flex-wrap: wrap; gap: 6px; }
@media (max-width: 900px) { .stat.kpi b { font-size: 18px; } .kpi-card .card-head { flex-direction: column; align-items: flex-start; gap: 8px; } }
@media print { .kpi-card .btn { display: none !important; } }
.table-scroll { overflow-x: auto; max-width: 100%; }
.eval-table td.reasons { min-width: 220px; }
.eval-table td:first-child { min-width: 110px; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .stat { padding: 10px 12px; } .stat b { font-size: 18px; } }
@media print { .table-scroll { overflow: visible; } }

/* ===== v6.0 theme variables, simplified screens ([CSS-V6]) ===== */
h1, h2, h3, h4 { color: var(--heading, inherit); font-family: var(--font-h, var(--font)); }
.modal h3, .modal h4 { color: inherit; }
.sidebar { background: var(--sb-bg, #fff); color: var(--sb-ink, var(--ink)); }
.sidebar nav a, .side-foot, .brand b { color: var(--sb-ink, var(--ink)); }
.sidebar .brand small, .side-foot .who small, .nav-group { color: var(--sb-ink, var(--muted)); opacity: .75; }
.sidebar nav a:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.sidebar nav a.active { background: var(--sb-active, var(--brand-2)); color: var(--sb-active-ink, var(--brand)); }
.side-foot { border-top-color: color-mix(in srgb, currentColor 18%, transparent); }
.brand .logo-img { height: var(--logo-h, 40px); width: auto; max-width: 170px; object-fit: contain; border-radius: 6px; background: none; }
.topbar { padding: 6px 12px; border-radius: 10px; background: var(--tb-bg, transparent); color: var(--tb-ink, var(--ink)); min-height: 44px; }
.topbar .menu-btn { margin-inline-end: 0; } .topbar .bell { color: var(--tb-ink, var(--ink)); }
.tb-brand { margin-inline-end: auto; display: flex; align-items: center; gap: 10px; } .tb-logo { height: 30px; width: auto; object-fit: contain; }
.nav-more { margin-top: 8px; border-top: 1px dashed color-mix(in srgb, currentColor 22%, transparent); padding-top: 6px; }
.nav-more summary { cursor: pointer; padding: 8px 12px; opacity: .8; list-style: none; } .nav-more[open] summary { margin-bottom: 4px; }
.lh-head { background: var(--p-hbg, transparent); color: var(--p-hink, inherit); border-bottom-color: var(--p-line, var(--brand)); font-family: var(--font-p, var(--font)); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.lh-head.lh-split, .lh-head { padding: 10px 12px; }
.lh-head b { color: var(--p-hink, var(--brand)); } .lh-head small { color: var(--p-hink, #555); opacity: .85; }
.lh-foot { border-top-color: var(--p-line, var(--accent)); color: var(--p-fink, #444); font-family: var(--font-p, var(--font)); }
.preview-paper { font-family: var(--font-p, var(--font)); color: var(--p-ink, inherit); }
@media print { body { color: var(--p-ink, var(--ink)); font-family: var(--font-p, var(--font)); } }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .grid3 > .card { margin-bottom: 0; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } }
.kind-pick { display: flex; gap: 10px; margin-bottom: 14px; } .kind-pick .btn { flex: 1; font-size: 16px; padding: 14px 8px; }
.logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .logo-slot { display: grid; gap: 6px; align-content: start; }
@media (max-width: 800px) { .logo-grid { grid-template-columns: 1fr; } }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.color-f input[type=color] { width: 54px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; z-index: 5; }
.odo-prev { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); margin-top: 6px; }
details.plain { margin: 10px 0; } details.plain > summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
.row.wrap { flex-wrap: wrap; }

/* phones: forms open as a full-height sheet; header and Save bar stay visible, only the middle scrolls */
@media (max-width: 640px) {
  .modal-wrap { padding: 0; place-items: stretch; }
  .modal { max-width: none; width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .modal-head { flex: 0 0 auto; } .modal-foot { flex: 0 0 auto; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); background: #fff; }
  .modal-body { padding: 14px; }
}
