/* Kickstart Moto Co. admin. Mobile first: staff add bikes from their phones in the showroom. */
:root {
  --ink: #14181A; --text: #16191B; --muted: #5E6461; --line: #E2DACB; --paper: #F2EEE6; --paper-2: #E8E1D3; --card: #fff;
  /* --red is the primary action colour (kept from the first theme): racing green now */
  --red: #1F5A43; --red-dark: #184A37; --danger: #A63A32; --brass: #D6BD84; --brass-soft: #F3EAD6;
  --ok: #1F5A43; --ok-bg: #E1ECE4; --warn: #9A5B13; --warn-bg: #F8EEDD;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--text); font: 500 15px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
body.signed-in { padding-bottom: 76px; }
a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.15; }
img { display: block; max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.loading { padding: 40px 0; color: var(--muted); text-align: center; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid transparent; border-radius: 10px; font: 800 15px/1 var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); box-shadow: 0 8px 20px -6px rgba(31, 90, 67, .5); }
.btn-line { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-danger-line { background: #fff; border-color: #E9C3BE; color: var(--danger); }
.btn-block { width: 100%; }

/* header + nav */
.ah { position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; }
.ah-in { display: flex; align-items: center; gap: 12px; max-width: 1100px; height: 58px; margin: 0 auto; padding: 0 16px; }
.logo { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.logo-k { font: 400 22px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; transform: skewX(-8deg); }
.logo-tag { padding: 3px 6px 2px; background: var(--brass); color: var(--ink); font: 800 9.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; transform: skewX(-8deg); }
@media (max-width: 380px) { .logo-tag { display: none; } }
.ah-tag { padding: 3px 8px; border: 1px solid #3A4245; border-radius: 6px; color: #C6CCC9; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ah-right { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 14px; }
.ah-right a { color: #C6CCC9; text-decoration: none; }
.ah-right button { padding: 8px 12px; border: 1px solid #3A4245; border-radius: 8px; background: transparent; color: #fff; font: 600 14px var(--body); cursor: pointer; }
.ah-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* phones: bottom tab bar */
.ah-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); }
.ah-nav[hidden] { display: none; }
.ah-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.ah-nav a[aria-current] { color: var(--red); }
.ah-nav .ah-add { color: var(--ink); }
@media (max-width: 559px) { .ah-right a { display: none; } }
@media (min-width: 900px) {
  body.signed-in { padding-bottom: 0; }
  .ah-nav { position: static; display: flex; gap: 4px; margin-left: 20px; padding: 0; background: none; border: 0; }
  .ah-nav a { flex-direction: row; gap: 8px; padding: 8px 12px; border-radius: 8px; color: #C6CCC9; font-size: 15px; }
  .ah-nav svg { width: 18px; height: 18px; }
  .ah-nav a:hover { color: #fff; background: #263033; }
  .ah-nav a[aria-current] { color: #fff; background: #263033; }
  .ah-nav .ah-add { color: #fff; }
}

/* layout */
.am { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font: 400 30px/1.05 var(--display); text-transform: uppercase; }
.page-head p { margin: 6px 0 0; }
.page-head .btn { flex: none; }
@media (max-width: 559px) { .page-head > .btn { display: none; } }
.linkbtn { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.back { display: inline-block; margin-bottom: 6px; color: var(--muted); font-size: 14px; text-decoration: none; }
.panel { margin-bottom: 16px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.panel h2 { margin-bottom: 14px; font: 400 18px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.panel h2.mt { margin-top: 24px; }
.notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: var(--brass-soft); color: #5C4613; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice a { font-weight: 600; }
.empty { padding: 32px 16px; background: var(--card); border: 1px dashed #CDC4B3; border-radius: 14px; color: var(--muted); text-align: center; }

/* login */
.login { max-width: 400px; margin: 40px auto; padding: 28px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.login h1 { font: 400 30px/1 var(--display); text-transform: uppercase; }
.login p { margin: 10px 0 18px; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 800px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
a.kpi:hover { border-color: var(--ink); }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi b { font: 400 34px/1.1 var(--display); }
.kpi small { color: var(--muted); font-size: 12.5px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dash-grid > * { min-width: 0; }
@media (min-width: 860px) { .dash-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } .dash-grid .panel { margin: 0; } }
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr; grid-template-areas: "label bar" ". n"; column-gap: 12px; padding: 6px 4px; border-radius: 8px; text-decoration: none; }
.bar-row:hover { background: var(--paper); }
.bar-label { grid-area: label; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { grid-area: bar; display: flex; align-self: center; height: 12px; background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.bar i, .legend i { display: block; background: var(--ink); }
.bar i.sold, .legend i.sold { background: var(--brass); }
.bar-n { grid-area: n; color: var(--muted); font-size: 12.5px; }
.bar-n b { color: var(--text); }
.legend { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend i.sold { margin-left: 12px; }
.store-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.store-split div { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--paper); border-radius: 12px; font-size: 13.5px; color: var(--muted); }
.store-split b { color: var(--text); font: 400 18px/1.2 var(--display); text-transform: uppercase; }
.store-split strong { color: var(--text); }
.minis { display: grid; gap: 4px; }
.mini { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 10px; text-decoration: none; }
.mini:hover { background: var(--paper); }
.mini img, .mini .nophoto { flex: none; width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: #DCD4C4; }
.mini > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.mini b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.mini small { color: var(--muted); font-size: 12.5px; }

/* status pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.pill-available { background: var(--ok-bg); color: var(--ok); }
.pill-booked { background: var(--brass-soft); color: #6B5223; }
.pill-sold { background: #F6E4E1; color: var(--danger); }

/* bike list */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input { flex: 1 1 260px; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: 15px var(--body); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 12px; }
.seg button, .seg label span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 14px var(--body); cursor: pointer; }
.seg button span { color: inherit; opacity: .7; font-weight: 500; }
.seg button[aria-pressed] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.rows { display: grid; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.row-main { display: flex; align-items: center; gap: 12px; flex: 1 1 320px; min-width: 0; text-decoration: none; }
.row-main img, .row-main .nophoto { flex: none; width: 96px; height: 72px; border-radius: 10px; object-fit: cover; background: #DCD4C4; }
.row-main .nophoto { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.row.is-sold .row-main img { filter: grayscale(1); opacity: .7; }
.row-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.row-text b { font-size: 15.5px; }
.row-text b small { color: var(--muted); font-weight: 500; }
.row-text > small { color: var(--muted); font-size: 13px; }
.row-text em { color: var(--warn); font-style: normal; font-weight: 600; }
.row-price { font: 400 19px/1.3 var(--display); }
.row-price small { color: var(--muted); font: 500 12.5px var(--body); }
.row-side { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1 1 260px; }
@media (min-width: 760px) { .row-side { flex: 0 0 auto; flex-direction: column; align-items: flex-end; } }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-actions button, .row-actions a { min-height: 36px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: 600 13.5px/33px var(--body); text-decoration: none; cursor: pointer; }
.row-actions button[data-act="sold"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.row-actions button:disabled { opacity: .5; }

/* form */
.fields { display: grid; gap: 14px; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; }
.field > span em { color: var(--muted); font-style: normal; font-weight: 400; }
.field small { color: var(--muted); font-size: 12.5px; min-height: 1em; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: 16px/1.3 var(--body); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.panel > .field { margin-top: 14px; }
.seg-form { align-self: flex-start; }
.seg-form label { position: relative; }
.seg-form input { position: absolute; opacity: 0; }
.seg-form input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-form input:focus-visible + span { outline: 3px solid var(--red); }
.check { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--ok-bg); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ok); }
.check b { display: block; color: var(--ok); }
/* on/off switch (reel) */
.switch { position: relative; display: flex; align-items: flex-start; gap: 14px; margin-top: 16px; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { flex: none; position: relative; width: 46px; height: 28px; border-radius: 14px; background: #d6cfc4; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: linear-gradient(90deg, #f58529, #dd2a7b 55%, #8134af); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--red); outline-offset: 2px; }
.switch span:last-child { color: var(--muted); font-size: 13.5px; }
.switch b { display: block; color: var(--text); font-size: 15px; }
[data-reel] .field { margin-top: 12px; }
.has-reel { color: #c13584; font-weight: 600; }
.form-error { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #F6E4E1; color: var(--danger); font-weight: 600; }
.savebar { position: sticky; bottom: 76px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -4px 20px rgba(20,18,16,.08); }
@media (min-width: 900px) { .savebar { bottom: 12px; } }
.save-status { margin-left: auto; color: var(--muted); font-size: 13.5px; text-align: right; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ph { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #DCD4C4; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-local img { opacity: .85; }
.ph-cover, .ph-new { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ph-new { top: auto; bottom: 42px; background: var(--brass); color: var(--ink); }
.ph-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.ph-tools button, .ph-del { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.ph-tools button:disabled { opacity: .35; cursor: default; }
.ph-del { position: absolute; top: 6px; right: 6px; border: 0; border-radius: 8px; background: var(--danger); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ph-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px dashed #CDC4B3; background: #FBF9F5; color: var(--muted); cursor: pointer; }
.ph-add:hover { border-color: var(--ink); color: var(--ink); }
.ph-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ph-add span { font: 400 34px/1 var(--display); }
.ph-add small { font-weight: 600; }

/* dialog + toast */
.dlg { width: min(420px, calc(100% - 32px)); padding: 22px; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(20,18,16,.55); }
.dlg h2 { font: 400 24px/1 var(--display); text-transform: uppercase; }
.dlg .field { margin: 14px 0 8px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 168px; z-index: 100; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* insights */
.ins-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ins-head h2 { margin: 0; }
.demo-note { padding: 3px 9px; border-radius: 999px; background: var(--brass-soft); color: #6B5223; font-size: 12px; font-weight: 700; cursor: help; }
.ins-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 800px) { .ins-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ins-kpis div { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; background: var(--paper); }
.ins-kpis span { color: var(--muted); font-size: 13px; font-weight: 600; }
.ins-kpis b { font: 400 32px/1.1 var(--display); }
.ins-kpis small { color: var(--muted); font-size: 12px; }
.ins-kpis em { font-size: 12.5px; font-style: normal; font-weight: 800; }
em.up { color: var(--ok); }
em.down { color: var(--danger); }
.chart { display: flex; gap: 6px; height: 160px; margin-top: 18px; }
.chart .col { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart .track { display: flex; flex: 1; align-items: flex-end; justify-content: center; width: 100%; }
.chart .v { position: relative; width: 100%; max-width: 34px; min-height: 2px; overflow: hidden; border-radius: 6px 6px 3px 3px; background: #CFE0D5; }
.chart .e { position: absolute; left: 0; right: 0; bottom: 0; background: var(--red); }
.chart .today .v { background: #B5D0C0; }
.chart small { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.chart .today small { color: var(--ink); }
.insights .legend i { background: #CFE0D5; }
.insights .legend i.enq { margin-left: 12px; background: var(--red); }
.mini-stat > span:nth-child(2) { flex: 1; }
.mini-stat small { white-space: normal; }
.mbar { display: block; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 6px; background: var(--paper-2); }
.mbar i { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.flag { color: var(--danger); font-weight: 700; }
.flag-age { color: var(--warn); }
.has-score { color: var(--ok); font-weight: 700; }
.mini .code { color: var(--muted); font-size: 12px; font-weight: 600; }

/* health check form */
.hc-headrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 6px; }
.hc-headrow h2 { margin: 0; }
.hc-live { padding: 4px 11px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 13px; font-weight: 700; }
.hc-live b { font: 400 18px/1 var(--display); }
.hc-list { display: grid; gap: 10px; margin-top: 14px; }
.hc-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
@media (min-width: 760px) { .hc-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .hc-note { grid-column: 1 / -1; } }
.hc-label b { display: block; font-size: 15px; }
.hc-label small { color: var(--muted); font-size: 12.5px; }
.hc-note { width: 100%; min-height: 40px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: 15px/1.3 var(--body); }
.hc-note:focus { border-color: var(--ink); outline: none; }
.hc-item .seg-form input[value="good"]:checked + span { background: var(--ok); color: #fff; }
.hc-item .seg-form input[value="fair"]:checked + span { background: var(--brass); color: var(--ink); }
.hc-item .seg-form input[value="fix"]:checked + span { background: var(--danger); color: #fff; }
