/* GC shop counter app. Built for someone who isn't comfortable with computers:
   big text, big buttons, one thing per screen, plain words. Brand colour comes from Settings. */
:root {
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --brand-tint: #e8eefc;
  --ink: #111111;
  --ink-2: #333333;
  --muted: #5c5c5c;
  --line: #d9d9d9;
  --bg: #f4f4f5;
  --card: #ffffff;
  --ok: #0f7b3e;
  --ok-tint: #e3f6ea;
  --warn: #9a5b00;
  --warn-tint: #fff1d6;
  --bad: #c01818;
  --bad-tint: #fde6e6;
  --radius: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 20px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); }
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 6px; }
h2 { font-size: 26px; line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 21px; margin: 0 0 8px; }
p { margin: 0 0 14px; }
.mono { font-family: var(--mono); letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.right { text-align: right; }
.loading, .empty { padding: 40px 0; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 24px; margin-bottom: 6px; }

/* ── Top bar ─────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--brand);
  color: var(--brand-ink);
  min-height: 72px;
}
.top .name { font-weight: 800; font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .name small { display: block; font-weight: 500; font-size: 15px; opacity: 0.85; }
.top .btn { background: rgba(255, 255, 255, 0.16); color: var(--brand-ink); border-color: transparent; min-height: 52px; }
.top .btn:hover { background: rgba(255, 255, 255, 0.28); }
.top .btn.help { background: #fff; color: var(--brand); }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 12px 24px;
  font: 700 20px/1.2 var(--font);
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  touch-action: manipulation;
}
.btn:hover { border-color: var(--brand); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tile:focus-visible, .pick:focus-visible {
  outline: 4px solid #ffbf47;
  outline-offset: 2px;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.big { min-height: 84px; font-size: 24px; padding: 16px 32px; width: 100%; }
.btn.sm { min-height: 44px; font-size: 17px; padding: 8px 16px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn:disabled { opacity: 0.5; cursor: wait; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.back { margin-bottom: 18px; }

/* ── Home tiles ──────────────────────────────────────── */

.greet { margin-bottom: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 170px;
  padding: 22px 24px;
  border-radius: 20px;
  background: #fff;
  border: 3px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.tile:hover { border-color: var(--brand); }
.tile .t { font-size: 32px; font-weight: 800; line-height: 1.1; }
.tile .d { font-size: 19px; color: var(--muted); }
.tile .n { font-size: 20px; font-weight: 700; color: var(--brand); }
.tile.main { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tile.main .d, .tile.main .n { color: var(--brand-ink); opacity: 0.9; }
.tile .icon { font-size: 40px; line-height: 1; }

/* ── Cards / panels ──────────────────────────────────── */

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.step { color: var(--muted); font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.question { font-size: 32px; font-weight: 800; margin: 0 0 20px; line-height: 1.2; }

/* Big choice buttons (mopeds, people, payment) */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 20px;
  min-height: 96px;
  border-radius: var(--radius);
  border: 3px solid var(--line);
  background: #fff;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.pick:hover { border-color: var(--brand); }
.pick.on { border-color: var(--brand); background: var(--brand-tint); }
.pick .t { font-size: 24px; font-weight: 800; line-height: 1.15; }
.pick .d { font-size: 18px; color: var(--muted); }
.pick .p { font-size: 22px; font-weight: 700; margin-top: 4px; }
.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.2); vertical-align: -4px; margin-right: 8px; }

/* Quantity stepper for accessories */
.qty { display: flex; align-items: center; gap: 10px; }
.qty button { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 32px; font-weight: 700; cursor: pointer; }
.qty b { min-width: 36px; text-align: center; font-size: 26px; }
.line { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 2px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .what { flex: 1; min-width: 0; }
.line .what .t { font-weight: 700; }
.line .what .d { color: var(--muted); font-size: 17px; }
.total { font-size: 30px; font-weight: 800; text-align: right; padding-top: 12px; }

/* ── Forms ───────────────────────────────────────────── */

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 16px; margin-top: 4px; }
input, select, textarea {
  width: 100%;
  font: 22px/1.3 var(--font);
  padding: 14px 16px;
  min-height: 62px;
  border: 2px solid #b5b5b5;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 120px; }
input[type='checkbox'] { width: 28px; height: 28px; min-height: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* ── Messages ────────────────────────────────────────── */

.alert { padding: 16px 18px; border-radius: 12px; margin-bottom: 18px; border: 2px solid; }
.alert.err { background: var(--bad-tint); border-color: var(--bad); color: #7d0f0f; }
.alert.ok { background: var(--ok-tint); border-color: var(--ok); color: #0b4f29; }
.alert.warn { background: var(--warn-tint); border-color: #e0a641; color: #5c3800; }
.done-box { text-align: center; padding: 30px 20px; }
.done-box .tick { font-size: 72px; line-height: 1; color: var(--ok); }
.done-box .say { font-size: 30px; font-weight: 800; margin: 14px 0 8px; line-height: 1.25; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 16px; font-weight: 700; background: #eee; white-space: nowrap; }
.b-available, .b-ok { background: var(--ok-tint); color: var(--ok); }
.b-incoming, .b-pending, .b-service { background: var(--warn-tint); color: var(--warn); }
.b-sold, .b-off { background: #eee; color: #555; }
.b-rental { background: var(--brand-tint); color: var(--brand); }
.b-error, .b-out, .b-undone, .b-written_off { background: var(--bad-tint); color: var(--bad); }

/* ── Toasts + modals (shared toolkit) ────────────────── */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(520px, calc(100vw - 32px)); }
.toast { padding: 16px 18px; border-radius: 12px; background: #111; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.toast.err { background: var(--bad); }
.toast-x { background: none; border: 0; color: #fff; font-size: 18px; margin-left: 10px; cursor: pointer; }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: min(640px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 2px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 24px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 22px; border-top: 2px solid var(--line); flex-wrap: wrap; }

/* ── Sign in ─────────────────────────────────────────── */

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; border-radius: 20px; padding: 32px; width: min(520px, 100%); border: 2px solid var(--line); }
.auth-card .brand { font-size: 30px; font-weight: 800; color: var(--brand); margin-bottom: 20px; }
.auth-card .btn { width: 100%; }

/* ── Lists (calls, today's sales, stock) ─────────────── */

.list > .item { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.item .head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.item .who { font-size: 26px; font-weight: 800; }
.item .meta { color: var(--muted); font-size: 18px; }
.item .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.phone { font-size: 26px; font-weight: 800; color: var(--brand); text-decoration: none; }

table.t { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line); }
table.t th, table.t td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { background: #fafafa; font-size: 16px; color: var(--muted); }
table.t tr:last-child td { border-bottom: 0; }

/* ── Admin: smaller and denser, for Bodhi / Emma ─────── */

.admin { font-size: 16px; }
.admin h1 { font-size: 28px; }
.admin h2 { font-size: 21px; }
.admin .btn { min-height: 42px; font-size: 16px; padding: 8px 16px; border-radius: 10px; }
.admin input, .admin select, .admin textarea { font-size: 16px; min-height: 42px; padding: 8px 10px; border-radius: 8px; }
.admin .field > span { font-size: 15px; }
.admin .field small { font-size: 13px; }
.admin table.t th, .admin table.t td { padding: 8px 10px; font-size: 15px; }
.admin .card { padding: 16px 18px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.err-text { color: var(--bad); font-size: 14px; }

@media (max-width: 700px) {
  body { font-size: 19px; }
  .page { padding: 18px 14px 60px; }
  .top { padding: 8px 12px; }
  .top .btn { padding: 8px 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .question { font-size: 27px; }
  .tile { min-height: 130px; }
}

/* Rental guide */
.guide-p { font-size: 20px; line-height: 1.45; margin: 0 0 16px; }
.guide-list { font-size: 20px; line-height: 1.45; margin: 0 0 18px; padding-left: 26px; }
.guide-list li { margin-bottom: 8px; }
.guide-table { margin-bottom: 18px; }
.guide-table td { font-size: 18px; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; }
.steps li { counter-increment: s; position: relative; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px 78px; margin-bottom: 12px; min-height: 76px; }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 16px; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.steps .t { font-size: 22px; font-weight: 800; line-height: 1.2; }
.steps .d { font-size: 19px; line-height: 1.45; margin-top: 4px; }
@media (max-width: 700px) {
  .steps li { padding-left: 66px; }
  .steps li::before { left: 12px; width: 40px; height: 40px; font-size: 20px; }
  .guide-table td, .guide-table th { font-size: 16px; padding: 10px; }
}

/* Bike photos (issue #15): thumbnails on hand-over and check-in */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.photos a { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line, #ddd); background: #f3f3f3; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
