/* Shift & Shine — workshop app. System fonts only (strict CSP). */
:root {
  --navy: #0f172a;
  --navy-2: #1e293b;
  --orange: #f26522;
  --orange-ink: #c2410c;
  --orange-soft: #fff1e8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; }
a { color: var(--orange-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; color: var(--ink-2); }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* top bar */
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 1.25rem; padding: 0 1.25rem; min-height: 56px; flex-wrap: wrap; border-bottom: 3px solid var(--orange); }
.brand { font-weight: 700; letter-spacing: .02em; color: #fff; display: flex; align-items: baseline; gap: .5rem; }
.brand span { color: var(--orange); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.nav a { color: #cbd5e1; padding: .5rem .75rem; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav a.admin { color: #fdba74; }
.userbox { display: flex; align-items: center; gap: .75rem; color: #cbd5e1; font-size: .9rem; }
.userbox button { background: transparent; border: 1px solid #475569; color: #e2e8f0; border-radius: 8px; padding: .3rem .7rem; cursor: pointer; font: inherit; }

main.page { max-width: 1200px; margin: 0 auto; padding: 1.25rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .sub { color: var(--muted); margin-top: .15rem; }

/* cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--radius); padding: .9rem 1rem; display: block; color: var(--ink); }
.tile:hover { text-decoration: none; border-color: var(--line-2); }
.tile .n { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: .9rem; }

/* definition list for record pages */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 500; }

/* tables */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .5rem .6rem; border-bottom: 2px solid var(--line); }
table.list td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tbody tr:hover { background: #f8fafc; }
table.list tr.total td { font-weight: 700; border-top: 2px solid var(--line-2); }

/* forms */
.input, select.input, textarea.input { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); }
textarea.input { min-height: 4rem; }
.input:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(242,101,34,.18); }
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; color: var(--ink-2); }
.field .help { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.field .error, .errorlist { color: var(--bad); font-size: .85rem; list-style: none; padding: 0; margin: .25rem 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.searchbar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.searchbar .input { font-size: 1.05rem; padding: .7rem .9rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-weight: 600; border-radius: 8px; padding: .55rem 1rem; border: 1px solid transparent; cursor: pointer; background: var(--navy); color: #fff; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn.primary { background: var(--orange); }
.btn.light { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn.danger { background: #fff; color: var(--bad); border-color: #fca5a5; }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* pills & messages */
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: #e2e8f0; color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.orange { background: var(--orange-soft); color: var(--orange-ink); }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; background: var(--info-soft); color: var(--info); }
.messages li.success { background: var(--ok-soft); color: var(--ok); }
.messages li.error { background: var(--bad-soft); color: var(--bad); }
.messages li.warning { background: var(--warn-soft); color: var(--warn); }
.notice { padding: .8rem 1rem; border-radius: 8px; background: var(--warn-soft); color: var(--warn); margin-bottom: 1rem; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* admin panel side menu */
.panel { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: start; }
.panel-nav { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; position: sticky; top: 1rem; }
.panel-nav a { display: block; padding: .5rem .7rem; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.panel-nav a.active, .panel-nav a:hover { background: var(--orange-soft); color: var(--orange-ink); text-decoration: none; }
@media (max-width: 800px) { .panel { grid-template-columns: 1fr; } .panel-nav { position: static; } }

/* auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--navy); }
.auth .box { background: #fff; border-radius: 14px; padding: 2rem; width: 100%; max-width: 420px; border-top: 5px solid var(--orange); }
.auth .box h1 { font-size: 1.35rem; }
.auth .box .btn { width: 100%; justify-content: center; padding: .75rem; font-size: 1.05rem; }
.qr { max-width: 220px; margin: .5rem auto 1rem; }
.qr svg { width: 100%; height: auto; }

/* tablet PIN screen: large targets */
.tablet .names { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.tablet .names label { display: block; padding: 1rem; border: 2px solid var(--line-2); border-radius: 12px; text-align: center; font-size: 1.15rem; font-weight: 600; cursor: pointer; }
.tablet .names input { position: absolute; opacity: 0; }
.tablet .names input:checked + span { color: var(--orange-ink); }
.tablet .names label:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.tablet .input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; }

/* review list */
.review-item { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .6rem; background: #fff; }
.review-item.done { border-left: 4px solid var(--ok); }
.review-item.open { border-left: 4px solid var(--warn); }
.review-item .opts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.review-item .opts button { font: inherit; border: 1px solid var(--line-2); background: #fff; padding: .35rem .8rem; border-radius: 8px; cursor: pointer; }
.review-item .opts button.chosen { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.review-item .opts button.suggested::after { content: " (suggested)"; color: var(--muted); font-weight: 400; }

.pagination { display: flex; gap: .5rem; align-items: center; margin-top: .75rem; }
.htmx-request .spinner { display: inline; }
.spinner { display: none; color: var(--muted); font-size: .85rem; }
.eyebrow { color: var(--muted); font-size: .8rem; letter-spacing: .08em; margin: 0 0 .25rem; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }

/* ---------- phase 2 ---------- */
.topsearch input { background: var(--navy-2); border: 1px solid #334155; color: #fff; border-radius: 8px; padding: .45rem .7rem; font: inherit; width: 14rem; }
.topsearch input::placeholder { color: #94a3b8; }
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: .75rem; overflow-x: auto; align-items: start; }
.board .col { background: #e2e8f0; border-radius: var(--radius); padding: .6rem; min-height: 8rem; }
.board .col h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); display: flex; justify-content: space-between; }
.jobcard { display: block; background: #fff; border-radius: 8px; padding: .6rem .7rem; margin-top: .5rem; border-left: 4px solid var(--line-2); color: var(--ink); }
.jobcard:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.jobcard .plate { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.jobcard .meta { color: var(--muted); font-size: .82rem; }
.jobcard.late { border-left-color: var(--bad); }
.col-received .jobcard { border-left-color: #94a3b8; }
.col-awaiting_approval .jobcard { border-left-color: var(--warn); }
.col-in_progress .jobcard { border-left-color: var(--info); }
.col-waiting_parts .jobcard { border-left-color: var(--orange); }
.col-ready .jobcard { border-left-color: var(--ok); }
.state { font-size: .75rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; white-space: nowrap; }
.state-approved, .state-flagged { background: var(--ok-soft); color: var(--ok); }
.state-waiting { background: var(--warn-soft); color: var(--warn); }
.state-not_quoted, .state-changed { background: var(--orange-soft); color: var(--orange-ink); }
.state-declined, .state-cancelled { background: #e2e8f0; color: var(--muted); }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.status-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.status-big { font-size: 1rem; padding: .3rem .8rem; }
details.inline-form summary { cursor: pointer; font-weight: 600; color: var(--orange-ink); }
.kind-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.decision { display: flex; gap: .75rem; }
.decision label { font-weight: 500; }
.totals td { padding: .25rem .6rem; }
.totals .grand td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--line-2); }
.bigbtn { font-size: 1.1rem; padding: .9rem 1.2rem; }
.tabletlist a { display: block; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; background: #fff; color: var(--ink); font-size: 1.1rem; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.photos a { display: block; color: var(--ink); }
.photos img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
