/* AAA portal. Tokens: blue #1b43a0, blue-deep #0b2663, ink #3a393b, ink-mid #717072, off-white #f7f7f7; strokes not shadows; red only on link hover.
   The portal CSP allows no inline style and no third-party fonts, so Open Sans is used when installed and the system sans otherwise. */
*, *::before, *::after { box-sizing: border-box; }
:root { --blue: #1b43a0; --deep: #0b2663; --ink: #3a393b; --mid: #717072; --off: #f7f7f7; --line: rgba(27,67,160,.16); --line2: rgba(27,67,160,.08); --tint: #dbe1f0; }
body { margin: 0; font: 600 14px/22px 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--off); color: var(--ink); }
a { color: var(--blue); }
a:hover { color: #ef4136; }
[hidden] { display: none !important; }
.sr { position: absolute; left: -9999px; }
.muted { color: var(--mid); }
.sm { font-size: 12px; line-height: 16px; }
.num { font-variant-numeric: tabular-nums; }

/* Login (S1b) */
.aaa-card { max-width: 380px; margin: 12vh auto 0; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.aaa-card h1 { font-size: 1.25rem; margin: 0 0 16px; color: var(--deep); }
.aaa-card label { display: block; margin: 12px 0 4px; font-weight: 700; }
.aaa-card input { width: 100%; padding: 12px; font: inherit; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; }
#aaa-code { letter-spacing: .4em; text-align: center; font-size: 1.4rem; }
.aaa-card button { width: 100%; margin-top: 16px; padding: 12px; font: inherit; font-weight: 700; font-size: 1rem; border: 0; border-radius: 40px; background: var(--blue); color: #fff; cursor: pointer; }
.aaa-card button:disabled { opacity: .6; cursor: default; }
.aaa-card button.aaa-link { background: none; color: var(--blue); margin-top: 8px; }
#aaa-msg { min-height: 1.5em; margin-bottom: 8px; }
#aaa-msg.aaa-err { color: #b42318; }

/* Frame */
.pt-head { background: #fff; border-bottom: 1px solid var(--line2); padding: 16px 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pt-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 16px; color: var(--deep); }
.pt-logo { width: 40px; height: 40px; border-radius: 8px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.pt-user { display: flex; align-items: center; gap: 16px; font-size: 12px; line-height: 16px; color: var(--mid); }
.pt-main { max-width: 1344px; margin: 0 auto; padding: 32px 24px; display: flex; flex-direction: column; gap: 24px; }
.pt-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; color: var(--deep); }
.pt-top p { margin: 4px 0 0; }
h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; color: var(--deep); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card.hl { border-color: var(--blue); }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 20px; min-width: 120px; }
.kpi .lbl { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--mid); }
.kpi .val { font-size: 24px; line-height: 32px; font-weight: 700; color: var(--deep); }

/* Buttons and fields */
.btn-sm { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--line); border-radius: 40px; background: #fff; color: var(--blue); font: 700 12px 'Open Sans', system-ui, sans-serif; padding: 0 16px; cursor: pointer; text-decoration: none; }
.btn-sm.off { color: var(--mid); cursor: default; }
.btn-pill { height: 40px; border: 0; border-radius: 40px; background: var(--blue); color: #fff; font: 700 14px 'Open Sans', system-ui, sans-serif; padding: 0 24px; cursor: pointer; }
.btn-pill.lg { height: 48px; padding: 0 32px; }
.btn-pill:disabled { opacity: .5; cursor: default; }
.btn-ghost { height: 48px; border: 1px solid var(--line); border-radius: 40px; background: #fff; color: var(--blue); font: 700 14px 'Open Sans', system-ui, sans-serif; padding: 0 24px; cursor: pointer; }
.btn-link { margin-left: auto; align-self: center; font-weight: 700; text-decoration: none; padding: 0 8px; }
.sel, .fld { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font: 600 14px 'Open Sans', system-ui, sans-serif; color: var(--ink); background: #fff; }
.fl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 700; }
.fl textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 600 14px 'Open Sans', system-ui, sans-serif; color: var(--ink); resize: vertical; width: 100%; }
.filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; padding: 16px 24px; }
.chk { display: flex; align-items: center; gap: 8px; height: 40px; }
.chk input, .pr-on { width: 18px; height: 18px; accent-color: var(--blue); }

/* Table */
.tblwrap { padding: 0; gap: 0; overflow: hidden; }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 1100px; }
.tbl th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--mid); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--off); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line2); vertical-align: middle; white-space: nowrap; }
.tbl tr:hover td { background: var(--tint); }
.empty { text-align: center; color: var(--mid); padding: 32px 16px; }
.cust { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: transparent; flex: none; }
.dot.on { background: var(--blue); }
.rowlink { text-decoration: none; }
.open { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 40px; background: #fff; color: var(--blue); display: flex; align-items: center; justify-content: center; }
.flags, .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 24px; font-size: 12px; line-height: 16px; color: var(--mid); }
.pgbtns { display: flex; gap: 8px; }

/* Pills */
.pill { display: inline-block; border-radius: 40px; padding: 2px 10px; font-size: 12px; line-height: 16px; font-weight: 700; }
.st-new, .st-noopp { background: var(--off); color: var(--mid); }
.st-sale, .fl-inv { background: #e6f2e9; color: #1e6b34; }
.st-fleet { background: var(--tint); color: var(--blue); }
.st-wip { background: #fff4e0; color: #7a4a00; }
.st-nosale, .fl-unw { background: #fce1df; color: #b3261e; }
.fl-none { background: var(--off); color: var(--mid); border: 1px solid var(--line); }

/* Detail */
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; text-decoration: none; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 24px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--mid); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.veh { display: flex; gap: 16px; flex-wrap: wrap; }
.veh .kv { flex: 1; min-width: 220px; }
.ph { width: 200px; height: 130px; border-radius: 8px; background: var(--tint); display: flex; align-items: center; justify-content: center; color: var(--blue); flex: none; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.when { color: var(--mid); font-size: 12px; }
.segs { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { height: 40px; border: 1px solid var(--line); border-radius: 40px; background: #fff; color: var(--ink); font: 700 14px 'Open Sans', system-ui, sans-serif; padding: 0 16px; cursor: pointer; }
.seg.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.seg:disabled { cursor: default; opacity: .7; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pt-tbl { width: 100%; border-collapse: collapse; }
.pt-tbl th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--mid); padding: 8px; border-bottom: 1px solid var(--line); }
.pt-tbl td { padding: 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.pt-tbl .w32 { width: 32px; }
.pt-tbl .w140 { width: 140px; }
.pr.off .pr-name { color: var(--mid); }
.pr-price { width: 120px; text-align: right; }
.pr-price.bad { border-color: #b3261e; }
.total { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; color: var(--deep); }
.actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.msg { min-height: 1.5em; text-align: right; }
.msg.err { color: #b3261e; }
.banner-unw { background: #fce1df; color: #b3261e; border-radius: 8px; padding: 12px 16px; font-size: 12px; line-height: 16px; }

@media (max-width: 640px) {
  .pt-head { padding: 12px 16px; }
  .pt-main { padding: 16px; }
  .log li { grid-template-columns: 1fr; gap: 0; }
}
