/* Colin the Mechanic – dark workshop look with KTM orange */
:root {
  --bg: #0f0f10;
  --card: #1a1a1c;
  --card-2: #222225;
  --line: #2e2e32;
  --text: #f2f2f2;
  --muted: #a8a8ad;
  --soft: #c8c8cc;
  --orange: #ff6a13;
  --orange-text: #ff8a3d;
  --wa: #25D366;
  --danger: #ff6b6b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: Barlow, system-ui, sans-serif; font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--orange-text); text-decoration: none; }
.wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--danger); }
.cond { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* Brand */
.brand { display: table; margin: 0 auto; text-align: center; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; text-transform: uppercase; }
.brand span { display: block; width: max-content; margin: 0 auto; white-space: nowrap; letter-spacing: 0; }
.brand-colin { font-weight: 800; font-size: min(132px, 30vw); line-height: .86; color: var(--text); }
.brand-mech { font-weight: 700; font-size: min(46px, 10.5vw); line-height: 1.05; color: var(--orange); }
.brand-small .brand-colin { font-size: 72px; }
.brand-small .brand-mech { font-size: 25px; }

/* Top bar */
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 0 8px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.bar-title { flex: 1; min-width: 0; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title em { font-style: normal; color: var(--orange); }
.icon-btn { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--card); color: var(--text); border: 0; cursor: pointer; }
.icon-btn.orange { background: var(--orange); color: var(--bg); }

/* Main page */
.home-head { padding: 22px 0 18px; }
.drawer-btn { display: flex; align-items: center; justify-content: center; min-height: 92px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--orange); color: var(--orange-text); font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 46px; text-transform: uppercase; letter-spacing: 2px; }
.section-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; margin: 14px 0 6px 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.archive-btn { display: flex; align-items: center; justify-content: center; min-height: 68px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--text); font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 28px; white-space: nowrap; text-transform: uppercase; }
.archive-btn.empty { color: #6d6d72; border-style: dashed; }
.menu-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 16px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: var(--bg); font-size: 12px; font-weight: 700; }
.home-foot { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.platform { font-size: 12px; color: #8a8a8f; text-align: center; }
.version { font-size: 12px; color: #8a8a8f; text-align: center; cursor: default; }

/* Drawer tiles */
.drawer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.pager a { min-width: 44px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--card); color: var(--soft); border: 1px solid var(--line); font-weight: 700; }
.pager a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; padding: 8px 6px; border-radius: var(--radius); background: var(--card); border-top: 4px solid var(--line); color: var(--text); text-align: center; position: relative; }
.t-stale { position: absolute; top: -7px; right: -3px; z-index: 1; background: #ffcf5c; color: #0f0f10; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 4px; }
.tile .t-bike { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--soft); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .t-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 50px; line-height: 1; }
.tile .t-owner { font-size: 12px; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.free { background: transparent; border: 1px dashed #333337; border-top: 4px solid #2a2a2e; }
.tile.free .t-num { color: #4a4a4f; }
.tile .t-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 18px 0 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 4px; vertical-align: 0; }

/* Bike page */
.bike-head { text-align: center; padding: 4px 0 6px; }
.bike-head .b-name { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--soft); }
.bike-head .b-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 72px; line-height: .95; }
.bike-head .b-owner { font-size: 15px; color: var(--muted); }
.section { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.status-grid input { position: absolute; opacity: 0; pointer-events: none; }
.status-grid label { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; cursor: pointer; text-align: center; padding: 4px; }
.status-grid input:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; }
.status-grid label { color: var(--c, var(--text)); }
.status-grid input:checked + label { background: var(--c, var(--orange)); border-color: var(--c, var(--orange)); color: var(--bg); }
.status-grid legend { grid-column: 1 / -1; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; padding: 3px 8px; border-radius: 4px; border: 1px solid currentColor; }

/* Forms */
label { font-size: 14px; color: var(--soft); }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  padding: 8px 12px; font-family: inherit; font-size: 16px; }
textarea { min-height: 72px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: transparent; }
input.pin { text-align: center; font-size: 30px; letter-spacing: 14px; font-family: 'Barlow Condensed', sans-serif; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--orange); }
fieldset { border: 0; padding: 0; margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--bg); font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 21px; text-transform: uppercase; letter-spacing: 1px; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #0f0f10; font-weight: 700; }
.btn-ghost { background: transparent; }
.btn-small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn-big { min-height: 50px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: #4a2a2a; background: transparent; }
.save-bar { position: sticky; bottom: 0; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(15,15,16,0) 0, var(--bg) 18px); margin-top: 10px; }

/* Cards and lists */
.card { background: var(--card); border-radius: var(--radius); padding: 10px 12px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list-item { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--radius); padding: 8px 12px; color: var(--text); min-height: 52px; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 700; }
.list-item .li-sub { font-size: 13px; color: var(--muted); }
.list-item.unread { border-left: 4px solid var(--orange); }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-item { background: var(--card); border-radius: var(--radius); padding: 8px 12px; }
.tl-when { font-size: 12px; color: var(--muted); }
.tl-note { white-space: pre-line; margin-top: 4px; }
.tl-media { margin-top: 8px; max-width: 100%; border-radius: 8px; display: block; }
.details { background: var(--card); border-radius: var(--radius); }
.details summary { padding: 10px 12px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: '+'; color: var(--muted); font-size: 20px; }
.details[open] summary::after { content: '–'; }
.details .details-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; }
.msg .m-when { font-size: 11px; color: var(--muted); margin-top: 2px; }
.msg.from-client { align-self: flex-start; background: #2a1d10; border: 1px solid #5a3a1a; border-bottom-left-radius: 3px; }
.msg.from-client .m-when { color: #e0c58a; }
.msg.from-mechanic { align-self: flex-end; background: var(--card-2); border-bottom-right-radius: 3px; }
.msg .m-body { white-space: pre-line; }

/* Payments */
.pay-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-total { display: flex; justify-content: space-between; font-weight: 700; padding-top: 8px; }

/* Flash */
.flash { background: #13301f; border: 1px solid #2c6b45; color: #c9f5da; border-radius: var(--radius); padding: 10px 12px; margin: 4px 0; }
.flash a { color: #8ff0b6; font-weight: 700; }
.flash .btn { margin-top: 8px; }

/* Login */
.login-box { margin: auto 0; padding: 40px 0; display: flex; flex-direction: column; gap: 28px; }

/* Client page */
.client-hero { padding: 18px 0 4px; }
.job-card { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-top: 10px; }
.job-card .jc-top { padding: 10px 12px; border-top: 4px solid var(--line); }
.job-card .jc-bike { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1.05; }
.job-card .jc-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.job-card .jc-meta strong { color: var(--text); }
.job-card .jc-note { padding: 0 12px 10px; white-space: pre-line; }
.progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.progress span { height: 6px; border-radius: 3px; background: #3a3a3d; }
.progress-labels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-top: 4px; text-align: center; }
.slot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.slot-grid input { position: absolute; opacity: 0; pointer-events: none; }
.slot-grid label { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); font-weight: 600; cursor: pointer; }
.slot-grid input:checked + label { background: var(--orange); color: var(--bg); border-color: var(--orange); }
.slot-grid input:disabled + label { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.slot-grid input:focus-visible + label { outline: 2px solid var(--text); }
.foot-line { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 0 6px; }
@media print { body { background: #fff; color: #000; } .bar .icon-btn, .bar .btn { display: none; } .invoice { background: #fff; color: #000; } .invoice .muted { color: #444; } }
