/* Component styles. Colours and fonts come from theme.css.
   Layout (Jordan, 2 Nov 2026): navigation in a bar across the top with the
   New Booking button on its right, content in a centred column, soft cards. */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: 80px; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, .big, .price { font-family: var(--font-display); }
a { color: var(--link); }
.loading { color: var(--mute); padding: 40px; }

/* Top bar */
#nav:empty { display: none; }
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--side); color: var(--side-ink);
  display: flex; align-items: center; gap: 4px;
  padding: 0 28px; height: 60px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.nav .logo-wrap { display: flex; align-items: center; margin-right: 22px; }
.nav a { display: inline-flex; align-items: center; height: 60px; padding: 0 11px; color: var(--side-mute); text-decoration: none; font-weight: 500; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; border-top: 3px solid transparent; transition: color .15s ease, border-color .15s ease; }
.nav a:hover { color: var(--side-ink); }
.nav a.on { color: var(--side-ink); font-weight: 600; border-bottom-color: var(--accent); }
.nav .sp { flex: 1; }
.nav .cta { margin: 0 18px 0 8px; }
.nav .cta .btn.solid { padding: 9px 18px; font-size: 15px; box-shadow: 0 2px 10px rgba(77, 255, 143, 0.35); }
.who { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.who .me { display: grid; line-height: 1.2; text-align: right; }
.who small { color: var(--side-mute); font-size: 12px; }
.who b { font-weight: 600; font-size: 14px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.who .linkbtn { color: var(--side-mute); font-size: 13px; white-space: nowrap; }
@media (max-width: 1240px) { .who select { display: none; } .who small { display: none; } }
.who .linkbtn:hover { color: var(--side-ink); }
.who select { border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 6px; padding: 5px 8px; background: rgba(255, 255, 255, 0.06); color: var(--side-ink); font-size: 13px; }
.seg { display: flex; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 12px; font-weight: 600; color: var(--mute); white-space: nowrap; transition: background .15s ease, color .15s ease; }
.seg button.on { background: var(--brown); color: #fbf3e3; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--mute); text-decoration: underline; font-size: 13.5px; text-align: left; }
.linkbtn:hover { color: var(--ink); }

main { padding: 30px 28px 80px; min-width: 0; max-width: 1480px; margin: 0 auto; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.4px; margin: 0; line-height: 1.15; }
.lead { color: var(--mute); margin: 6px 0 0; max-width: 68ch; }
.bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.bar .sp { flex: 1; }
.in { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 9px 11px; min-width: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.in:hover { border-color: var(--mute); }
.in:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(77, 255, 143, 0.35); }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 8px 14px; font-weight: 600; white-space: nowrap; color: var(--ink); transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease; }
.btn:hover { background: var(--row); border-color: var(--mute); }
.btn:active { transform: translateY(1px); }
a.btn { text-decoration: none; display: inline-block; }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.solid:hover { filter: brightness(.95); border-color: var(--accent); }
.btn.danger { color: var(--bad); border-color: transparent; background: none; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 5px 11px; font-size: 14px; }
.btn.busy { opacity: .6; pointer-events: none; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 0; }
.tabs button { border: 0; background: none; padding: 10px 2px 11px; white-space: nowrap; color: var(--mute); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs button i { font-style: normal; margin-left: 6px; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--mute); background: var(--row); border-radius: 10px; padding: 0 7px; font-size: 12.5px; }
.tabs button.alert i { color: #fff; background: var(--bad); }

/* Tables sit on a white card. */
.tw { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; box-shadow: var(--shadow); }
.tabs + .tw { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
table { border-collapse: collapse; width: 100%; min-width: 900px; }
th { text-align: left; font-weight: 600; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after { content: "\2195"; margin-left: 5px; opacity: .35; }
th.sorted-asc::after { content: "\2191"; opacity: 1; color: var(--ink); }
th.sorted-desc::after { content: "\2193"; opacity: 1; color: var(--ink); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.r { cursor: pointer; transition: background .12s ease; }
tr.r:hover td { background: var(--row); }
.veh { font-weight: 600; }
.ref { color: var(--mute); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ref .g { margin-left: 12px; }
.sm2 { color: var(--mute); font-size: 13.5px; }
.rt .ar { color: var(--mute); margin: 0 7px; }
.rt { white-space: normal; }
.rt .ar { white-space: nowrap; }
td.car { min-width: 130px; }
.st + .sm2 { white-space: normal; }
.st, .pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; font-size: 13px; padding: 2px 9px 2px 7px; border-radius: 12px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); }
.st::before, .pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.flag { font-size: 13.5px; font-weight: 600; color: var(--warn); }
.flag.bad { color: var(--bad); }
.flag.ok { color: var(--ok); }
.foot { display: flex; align-items: center; gap: 12px; padding: 16px 0 0; color: var(--mute); font-size: 14px; }
.empty { padding: 60px 16px !important; text-align: center; color: var(--mute); }

/* Loading placeholders */
.skel { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--row) 25%, var(--line) 50%, var(--row) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } * { transition: none !important; } }

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 22px 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; text-align: left; transition: transform .12s ease, box-shadow .15s ease; display: grid; gap: 4px; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(43, 31, 23, 0.12); }
.tile .n { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--mute); font-size: 13.5px; font-weight: 500; }
.tile.hot .n { color: var(--bad); }
.hero { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.hero h1 { font-size: 32px; }
.hero .search { display: flex; gap: 8px; max-width: 640px; }
.hero .search .in { flex: 1; font-size: 16px; padding: 12px 14px; }
.recent { margin-top: 22px; }

.scrim { position: fixed; inset: 0; background: rgba(43, 31, 23, 0.45); z-index: 20; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100%); background: var(--panel); z-index: 21; overflow-y: auto; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(43, 31, 23, 0.18); padding-top: env(safe-area-inset-top, 0px); display: flex; flex-direction: column; animation: slide .18s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.dh { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 20px 26px 16px; display: flex; gap: 10px; align-items: flex-start; z-index: 2; }
.dh h2 { margin: 6px 0 2px; font-size: 24px; font-weight: 700; line-height: 1.15; }
.x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--mute); margin-left: auto; padding: 0 6px; border-radius: 6px; }
.x:hover { color: var(--ink); background: var(--row); }
.sec { padding: 18px 26px; border-bottom: 1px solid var(--line); }
.sec h3 { margin: 0 0 10px; font-size: 12.5px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dfoot { position: sticky; bottom: 0; margin-top: auto; background: var(--panel); border-top: 1px solid var(--line); padding: 14px 26px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; }
.dfoot .btn.danger { margin-left: auto; }
.steps { display: flex; gap: 4px; }
.step { flex: 1; font-size: 13.5px; color: var(--mute); border-top: 4px solid var(--line); padding-top: 7px; border-radius: 2px; }
.step.done { color: var(--ink); border-top-color: var(--brown); }
.step.now { font-weight: 600; border-top-color: var(--accent); }
.step div { font-weight: 400; color: var(--mute); font-size: 13px; min-height: 1em; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.card { background: var(--row); border-radius: var(--radius); padding: 14px 16px; }
.modal .card, .drawer .card { background: var(--bg); }
.card b.t { display: block; font-size: 12.5px; color: var(--mute); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rate { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; }
.rate .rl { color: var(--mute); font-size: 13.5px; }
.rate .big, .price { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.rng { position: relative; height: 4px; background: var(--line); margin: 12px 0 5px; border-radius: 2px; }
.rng i { position: absolute; top: -5px; width: 3px; height: 14px; margin-left: -1.5px; background: var(--ink); }
.rng i.me { background: var(--accent); width: 11px; height: 11px; top: -3.5px; margin-left: -5.5px; outline: 2px solid var(--ink); border-radius: 50%; }
.rends { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 5px 0; display: flex; gap: 12px; }
.hist li span { color: var(--mute); white-space: nowrap; min-width: 100px; font-variant-numeric: tabular-nums; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photos a { display: block; width: 96px; height: 72px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

.modal { position: fixed; z-index: 31; left: 50%; top: 4vh; transform: translateX(-50%); width: min(960px, calc(100% - 20px)); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(43, 31, 23, 0.25); animation: pop .16s ease; }
@keyframes pop { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.modal.narrow { width: min(620px, calc(100% - 20px)); }
.modal .mh { padding: 22px 28px 4px; display: flex; align-items: center; }
.modal .mh h2 { margin: 0; font-size: 24px; font-weight: 700; }
.modal .mb { padding: 12px 28px 22px; display: grid; gap: 14px; }
.modal .mf { padding: 14px 28px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--panel); }
.scrim.m { z-index: 30; }
label.f { display: grid; gap: 4px; font-size: 13.5px; color: var(--mute); font-weight: 500; }
label.f .in { color: var(--ink); width: 100%; }
.ck { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ck input { width: 17px; height: 17px; accent-color: var(--brown); }
.ck .sp { flex: 1; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: grid; gap: 6px; width: max-content; max-width: calc(100% - 28px); }
.toast { background: var(--side); color: var(--side-ink); border-radius: 8px; padding: 10px 16px; font-weight: 500; box-shadow: var(--shadow); animation: pop .16s ease; }
.toast.bad { background: var(--bad); color: #fff; }
.note { background: var(--warn-bg); color: var(--warn); padding: 9px 12px; border-radius: 6px; }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.stat { color: var(--mute); }
.stat b { color: var(--ink); margin-right: 6px; font-variant-numeric: tabular-nums; }

/* Sign-in */
.signin { max-width: 420px; margin: 60px auto; display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; box-shadow: var(--shadow); }
.signin .logo { margin: 0 0 6px; }
.signin p { margin: 0; color: var(--mute); }
.signin code { word-break: break-all; font-size: 13px; }

/* Side-by-side form with the swap button between the two sides. */
.sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; }
.sides .swap { align-self: center; border-radius: 50%; width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }

@media (max-width: 900px) {
  .nav { padding: 0 12px; height: auto; flex-wrap: wrap; gap: 0 4px; }
  .nav .logo-wrap { margin-right: 10px; padding: 10px 0; }
  .logo, .nav a.logo { width: 86px; }
  .nav a { height: 44px; padding: 0 8px; font-size: 14px; }
  .nav .cta { margin: 0 6px; }
  .nav .cta .btn.solid { padding: 7px 12px; font-size: 14px; }
  .who { padding: 8px 0; width: 100%; }
  .who .me { display: none; }
  .who select { display: none; }
  main { padding: 18px 14px 60px; }
  h1 { font-size: 26px; }
  .hero { padding: 18px; }
  .g2 { grid-template-columns: 1fr; }
  .sides { grid-template-columns: 1fr; }
  .sides .swap { justify-self: center; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 12px; }
}

/* Labels, comments and attachments (parallel-run additions). */
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; font-size: 12px; line-height: 18px; padding: 0 7px; border-radius: 9px; background: var(--line); color: var(--ink); white-space: nowrap; }
.cmts { display: grid; gap: 8px; margin-bottom: 10px; }
.cmt { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.cmt.me { border-color: var(--brown); }
.cmt.internal { background: var(--warn-bg); }
.cmt .who { font-size: 12.5px; color: var(--mute); margin-bottom: 3px; display: block; }
.cmt .body { white-space: pre-wrap; }
textarea.in { width: 100%; min-height: 64px; resize: vertical; }
.files { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.files li { display: flex; gap: 8px; align-items: baseline; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .in { flex: 1; }
.drawer:focus, .modal:focus { outline: none; }
tr.r:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.shots { display: grid; gap: 10px; }
.shot .in[type=file] { padding: 6px; }
.sigpad { width: 100%; max-width: 600px; height: 160px; border: 1px solid var(--line); border-radius: 6px; background: #fff; touch-action: none; display: block; }
@media (max-width: 700px) { .g2 { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
