/* LOCA Car Rental back office — Loca eSIM admin framework, palette C (docs/DESIGN.md, boards A1–A7). */
:root {
  --navy: #082F5E;
  --brand: #0B4F9E;
  --brand-2: #2E9BF0;
  --haze: #8FD3FF;
  --brand-soft: #e8f0ff;
  --bg: #f5f6fa;
  --surface: #fff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #eaecf3;
  --green: #12b76a;
  --green-soft: #e7f8f0;
  --amber: #f79009;
  --amber-ink: #b54708;
  --amber-soft: #fef4e6;
  --red: #f04438;
  --red-soft: #fdecea;
  --grey-soft: #eef2f7;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 20px -10px rgba(16,24,40,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Lao", sans-serif;
  color: var(--ink); -webkit-font-smoothing: antialiased; font-size: 14px;
}
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.logo { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.logo span { color: var(--brand); }
.logo em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; margin-left: 4px; }

/* ---- A1 login: two cards side by side on navy, stacked below 900px ---- */
.login-screen { min-height: 100vh; background: var(--navy); display: flex; align-items: center; justify-content: center; padding: 40px 16px; gap: 24px; flex-wrap: wrap; }
.login-card {
  width: 380px; max-width: 100%; background: var(--surface); border-radius: 20px; padding: 32px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 14px;
}
.login-card .logo { text-align: center; }
.login-card .login-sub { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: -6px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label, .field label, label.field { font-size: 13px; font-weight: 600; color: var(--ink-2); display: block; }
.login-form input, .field input, .field select, .field textarea {
  width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); outline: none; background: var(--surface);
}
.login-form input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-2); }
.login-foot { font-size: 12px; color: var(--ink-3); text-align: center; }
.login-foot.split { display: flex; justify-content: space-between; gap: 10px; text-align: left; }
.login-foot button { color: var(--brand); font-weight: 600; font-size: 12px; padding: 0; white-space: nowrap; }
.login-foot button:hover { color: var(--brand-2); }
.login-note { font-size: 12.5px; color: var(--ink-2); background: var(--amber-soft); border-radius: 10px; padding: 8px 12px; }
.login-err { color: var(--red); font-size: 13px; text-align: center; min-height: 16px; }
@media (max-width: 899px) { .login-screen { flex-direction: column; align-items: center; padding: 24px 16px; } }

/* ---- buttons ---- */
.btn {
  background: var(--navy); color: #fff; font-weight: 700; padding: 0 18px; min-height: 46px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #0a3a73; color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { background: var(--navy); }
.btn.ghost { background: var(--surface); color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn.ghost:disabled:hover { background: var(--surface); }
.btn.soft { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.soft:hover { background: var(--bg); color: var(--ink); }
.btn.soft:disabled:hover { background: var(--surface); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn.xs { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { background: var(--red-soft); color: var(--red); border: 0; }
.btn.danger:hover { background: #fbd5d1; color: var(--red); }
.link { color: var(--brand); font-weight: 600; cursor: pointer; }
.link:hover { color: var(--brand-2); }

/* ---- shell: 230px sidebar + main ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: 0 0 230px; background: var(--surface); border-right: 1px solid var(--line);
  padding: 24px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-sect { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 14px 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.sidebar nav a:hover { background: var(--bg); color: var(--ink-2); }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); }
.sidebar nav a .badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--amber-soft); color: var(--amber-ink); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.side-foot #whoami { color: var(--ink-2); word-break: break-word; }
.side-foot #whoami b { display: block; color: var(--ink); }
.side-foot button { color: var(--red); font-weight: 600; font-size: 13px; text-align: left; padding: 0; }

.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 60px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13px; font-weight: 600; }
.crumb a { color: var(--brand); }
h2.section { font-size: 16px; margin: 4px 0 0; }
h2.section + .sub, .sub { color: var(--ink-3); font-size: 13px; }

/* ---- stat cards (A2) ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
.stat:hover { color: inherit; }
.stat .s-label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.stat .s-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.stat .s-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.stat .s-sub.bad { color: var(--red); }
.stat .s-sub.good { color: var(--green); }
.stat .s-sub.warn { color: var(--amber-ink); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
.grid-2 > div { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.panel { background: var(--surface); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.panel h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.panel h3 .spacer { flex: 1; }
.panel h3 .h-actions { display: flex; gap: 6px; font-weight: 400; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { word-break: break-word; }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.warn-text { color: var(--amber-ink); font-weight: 600; }
.bad-text { color: var(--red); font-weight: 600; }
.good-text { color: var(--green); font-weight: 700; }
.spacer { flex: 1; }
.row-list { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.row-list .row { display: flex; justify-content: space-between; gap: 12px; }
.row-list .row.total { font-size: 14px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }
.row-list .row.note { font-size: 13px; color: var(--ink-2); }
.attn { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink); padding: 8px 0; border-bottom: 1px solid var(--line); }
.attn:last-child { border-bottom: 0; }
.attn:hover { color: var(--ink); background: #fafbff; }
.attn b.amber { color: var(--amber-ink); }
.attn b.red { color: var(--red); }
.attn b.green { color: var(--green); }
.banner { padding: 12px 16px; border-radius: 12px; background: var(--amber-soft); color: #8a5a00; font-size: 13.5px; }
.banner.ok { background: var(--green-soft); color: #05603a; }

/* revenue bars (pure CSS) */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.chart .bar { background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .bar-wrap:hover .bar { background: var(--brand-2); }
.chart .tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; padding: 5px 8px; border-radius: 7px; white-space: nowrap; z-index: 5; margin-bottom: 4px; }
.chart .bar-wrap:hover .tip { display: block; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); }
.chart-x span { flex: 1; text-align: center; }

/* ---- tabs, toolbar, tables (A3) ---- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { padding: 9px 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.tab:hover { background: var(--bg); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab .n { margin-left: 6px; opacity: .85; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtabs a { padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--brand); }
.subtabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 10px 14px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface); outline: none; font-size: 14px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand-2); }
.toolbar input[type="search"] { min-width: 280px; }
.toolbar input[type="date"] { padding: 8px 10px; }
.toolbar .spacer { flex: 1; }
.toolbar label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.toolbar details { font-size: 13px; }
.toolbar details summary { cursor: pointer; color: var(--brand); font-weight: 600; list-style: none; padding: 10px 0; }
.toolbar details[open] summary { margin-bottom: 8px; }
.toolbar details .more { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar b.range { font-size: 14px; min-width: 190px; text-align: center; }

.tbl-wrap { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow-x: auto; }
.panel .tbl-wrap { box-shadow: none; border-radius: 0; margin: 0 -20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
th.num { text-align: right; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.nowrap, th.nowrap { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr:hover { background: #fafbff; }
tr.overdue td { background: #fff7f6; }
td a.ref { font-weight: 600; }
td .sub { display: block; font-size: 12px; color: var(--ink-3); }
td input, td select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; width: 100%; min-width: 70px; }
td textarea { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; width: 100%; min-width: 140px; font-family: ui-monospace, Menlo, monospace; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 4px; font-size: 13px; color: var(--ink-2); }
.empty-note { text-align: center; color: var(--ink-3); padding: 40px; font-size: 14px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions.left { justify-content: flex-start; }

/* ---- status pills (mapping fixed by docs/DESIGN.md) ---- */
.pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; display: inline-block; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); vertical-align: middle; }
.pill.blue { background: var(--brand-soft); color: var(--brand); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber-ink); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.grey { background: var(--grey-soft); color: var(--ink-2); }

/* ---- booking detail (A4) ---- */
.timeline { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.timeline .t-row { display: flex; gap: 12px; }
.timeline .t-when { width: 118px; flex: none; color: var(--ink-3); white-space: nowrap; }
.timeline .t-what b { font-weight: 700; }
.timeline .t-row.note .t-what b { color: var(--amber-ink); }
.big { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.thumbs.wide { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.thumb { border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; font-size: 10.5px; text-align: center; background: var(--brand-soft); min-height: 48px; display: flex; flex-direction: column; justify-content: center; gap: 2px; color: var(--brand); overflow: hidden; }
.thumb b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb span { color: var(--ink-3); }
.thumb.ok { cursor: pointer; }
.thumb.ok:hover { border-color: var(--brand-2); background: #dbeafe; }
.thumb.na { background: var(--bg); color: var(--ink-3); }
.insp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.insp { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.insp.empty { border-style: dashed; color: var(--ink-3); }
.insp .i-title { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.insp .i-meta { font-size: 12px; color: var(--ink-2); }
.doc-rows { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.doc-rows .row { display: flex; justify-content: space-between; gap: 10px; }
.doc-rows .row.click { cursor: pointer; }
.doc-rows .row.click:hover span:first-child { color: var(--brand); }
.doc-list a, .doc-list .row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.doc-list a:last-child, .doc-list .row:last-child { border-bottom: 0; }
.doc-list b { font-weight: 700; color: var(--brand); }
.doc-list .sub, .big .sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.nowrap { white-space: nowrap; }
.doc-list .row b.muted { color: var(--ink-3); }
.doc-view { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; }

/* ---- planner (A5): 220px unit column + day columns ---- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.planner { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow-x: auto; padding: 8px 0; }
.pl-grid { min-width: 980px; display: grid; grid-template-columns: 220px 1fr; font-size: 12.5px; }
.pl-grid.month { min-width: 1400px; }
.pl-head { padding: 10px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.pl-days { display: grid; border-bottom: 1px solid var(--line); }
.pl-day { padding: 10px 4px; text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.pl-day.today { color: var(--brand); background: #f5f9ff; }
.pl-group { grid-column: 1 / -1; padding: 8px 16px; font-size: 11px; font-weight: 700; color: var(--ink-2); background: #fafbff; border-bottom: 1px solid var(--line); }
.pl-label { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; min-height: 50px; }
.pl-label .sub { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.pl-label.unassigned { font-weight: 400; color: var(--ink-3); }
.pl-track { position: relative; border-bottom: 1px solid var(--line); min-height: 50px; display: grid; }
.pl-cell { border-left: 1px solid #f3f4f8; }
.pl-cell.today { background: #f5f9ff; }
.pl-bar { position: absolute; top: 10px; height: 30px; border-radius: 8px; padding: 0 10px; font-size: 12px; font-weight: 600; display: block; line-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; z-index: 1; } /* T23 (T21-11): block + line-height so the ellipsis works on a clipped label */
.pl-bar.pb-navy { background: var(--brand); color: #fff; }
.pl-bar.pb-haze { background: var(--haze); color: #0b1c33; }
.pl-bar.pb-amber { background: var(--amber-soft); border: 1px solid var(--amber); color: #8a5a00; }
.pl-bar.pb-red { background: var(--red); color: #fff; }
.pl-bar.pb-grey { background: #e4e7ec; color: var(--ink-2); }
.pl-bar.buffer { background: #e4e7ec; border-radius: 0 8px 8px 0; cursor: default; padding: 0; z-index: 0; }
.pl-bar.downtime { background: #e4e7ec; color: var(--ink-2); cursor: default; }
.pl-bar:hover { filter: brightness(.96); }

/* ---- fleet (A7): rate tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; font-size: 12.5px; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.tile .t-label { color: var(--ink-3); font-size: 11px; }
.tile b { display: block; }

/* ---- forms & modal ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.field.wide { grid-column: 1 / -1; }
.field textarea { min-height: 80px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-top: 4px; display: block; }
.field.check { display: flex; align-items: center; gap: 8px; padding-top: 22px; }
.field.check input { width: auto; margin: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.form-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 16px; }
.hours-grid { display: grid; grid-template-columns: 60px 1fr 1fr 70px; gap: 6px 8px; align-items: center; font-size: 13px; }
.hours-grid input[type="time"] { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); }

.modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(9,18,36,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto; padding: 20px 22px; box-shadow: 0 20px 60px -20px rgba(9,18,36,.45); }
.modal.wide { max-width: 1040px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.modal-head h3 { font-size: 16px; }
.modal-x { font-size: 20px; color: var(--ink-3); padding: 4px 8px; line-height: 1; }
.secret-box { background: var(--amber-soft); border-radius: 12px; padding: 14px; font-size: 13.5px; margin: 10px 0; }
.secret-box code { font-size: 16px; font-weight: 800; letter-spacing: .04em; user-select: all; }

.settings-group { display: flex; flex-direction: column; }
.setting-row { display: grid; grid-template-columns: 260px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.setting-row:last-child { border-bottom: 0; }
.setting-row .key { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; font-weight: 600; padding-top: 8px; word-break: break-all; }
.setting-row .key .sub { display: block; font-family: inherit; font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.setting-row input, .setting-row textarea { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13px; }
.setting-row textarea { min-height: 60px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.setting-row .dirty { border-color: var(--amber); }
pre.json { font-size: 11.5px; white-space: pre-wrap; word-break: break-all; max-width: 420px; color: var(--ink-2); }
details summary { cursor: pointer; color: var(--brand); font-size: 12.5px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600; padding: 12px 18px; border-radius: 99px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 400; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }
.loading { color: var(--ink-3); padding: 30px; text-align: center; }

/* 1024px: the shell keeps the sidebar; cards and grids narrow */
@media (max-width: 1100px) {
  .main { padding: 24px 20px 50px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar input[type="search"] { min-width: 200px; }
  .insp-cols { grid-template-columns: 1fr; }
}

/* tablet (768) and phone: sidebar becomes a top bar */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 50; flex-direction: row; align-items: center; padding: 10px 12px; gap: 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .logo { display: none; }
  .sidebar nav { flex-direction: row; gap: 2px; }
  .nav-sect { display: none; }
  .sidebar nav a { padding: 8px 10px; white-space: nowrap; font-size: 13px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; }
  .side-foot #whoami { display: none; }
  .main { padding: 18px 16px 50px; }
  .kv { grid-template-columns: 120px 1fr; }
  .setting-row { grid-template-columns: 1fr; }
  .toolbar input[type="search"] { min-width: 0; width: 100%; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Sprint 2 (T20): planner drag, claims evidence, fleet inline status ---------- */
.pl-bar.draggable { cursor: grab; touch-action: none; }
.pl-bar.draggable.dragging { opacity: .45; cursor: grabbing; }
.pl-ghost { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 50; opacity: .9; box-shadow: var(--shadow); max-width: 320px; }
.pl-track.drop-ok { outline: 2px dashed var(--brand-2); outline-offset: -2px; background: #f3f9ff; }
.pl-track.drop-over { background: var(--brand-soft); outline-style: solid; }
.pairs { display: flex; flex-direction: column; gap: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair .ph { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); min-width: 0; }
.pair .ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: zoom-in; }
.pair .ph-empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-3); font-size: 12px; }
.pair .cap { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.status-sel { padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; background: var(--surface); }
.status-sel.green { background: var(--green-soft); color: #027a48; }
.status-sel.blue { background: var(--brand-soft); color: var(--brand); }
.status-sel.amber { background: var(--amber-soft); color: var(--amber-ink); }
.status-sel.grey { background: var(--grey-soft); color: var(--ink-2); }
td .status-sel + .status-sel, td .pill + .status-sel { margin-left: 6px; }

/* ---------- T23 (T21-11): back-office cosmetics from the Sprint 2 QA ---------- */
/* the deposit pill carries an amount: let it wrap instead of clipping ("Charged 3,000,0…") */
td .pill.dep, .pill.wrap { white-space: normal; line-height: 1.3; max-width: 170px; }
/* inline status select on the fleet table: wide enough for "Maintenance" */
td .status-sel { min-width: 128px; }
/* planner under 1200 px: the grid keeps its 7 day columns and scrolls inside the card */
@media (max-width: 1199px) {
  .pl-grid { min-width: 1100px; }
  .pl-grid.month { min-width: 1500px; }
}

/* ---------- T25 (QA T24-02): bookings table at 1024 px, tiny planner bars ---------- */
/* the rail repeats under the total; shown only when the Rail column is hidden */
.bk-table .rail-sub { display: none; }
@media (max-width: 1199px) {
  /* eight columns in the ~754 px a 1024 px window leaves next to the sidebar */
  .bk-table table { font-size: 13px; }
  .bk-table th, .bk-table td { padding: 10px 8px; }
  .bk-table th { white-space: normal; }
  .bk-table td .pill { white-space: normal; line-height: 1.3; }
  .bk-table th:first-child, .bk-table td:first-child { padding-left: 14px; }
  .bk-table .col-rail { display: none; }
  .bk-table .rail-sub { display: block; }
  .bk-table td.col-dates { white-space: normal; }
  .bk-table td .pill.dep { max-width: 130px; }
}
/* a 2-minute booking still shows as a chip; its label goes on a bar under ~44 px, where it
   could only show a clipped character or two. The query measures the content box (bar width
   minus the 2 x 10 px padding, border-box). */
.pl-bar { min-width: 28px; }
.pl-bar.buffer { min-width: 0; }
.pl-bar:not(.buffer) { container-type: inline-size; }
@container (max-width: 24px) { .pl-lbl { display: none; } }
