:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1c2330; --muted: #667085; --line: #e3e6eb; --accent: #1f5fd1; --accent-ink: #fff;
  --ok: #17794a; --ok-bg: #e5f5ec; --bad: #b42318; --bad-bg: #fdecea; --warn: #8a5a00; --warn-bg: #fff3d6;
}
* { box-sizing: border-box; }
html { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; } h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h1 small { font-weight: 400; color: var(--muted); font-size: 1rem; }
main { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.top { display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; background: #172033; color: #fff; flex-wrap: wrap; }
.top .brand { color: #fff; font-weight: 700; }
.top nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
.top nav a { color: #c9d2e3; padding: .3rem .6rem; border-radius: 6px; }
.top nav a.on, .top nav a:hover { background: #2a3650; color: #fff; text-decoration: none; }
.who { display: flex; gap: .6rem; align-items: center; margin: 0; color: #c9d2e3; }
.who .link { color: #fff; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin: 0 0 1rem; }
.narrow { max-width: 520px; } .scroll { overflow-x: auto; }
.center-card { margin: 8vh auto 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.row.left { justify-content: flex-start; align-items: flex-end; } .row h1, .row h2 { margin: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.grow { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
tfoot th { border-top: 2px solid var(--line); border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.dim td { color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .wrap { word-break: break-word; max-width: 520px; }
input, select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid #c5cbd6; border-radius: 6px; background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { display: block; margin: 0 0 .8rem; } .field > span { display: block; font-weight: 600; margin-bottom: .2rem; font-size: .9rem; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.row.left .field { margin-bottom: 0; } .row.left .field input, .row.left .field select { width: auto; }
.field small, fieldset small { display: block; color: var(--muted); margin-top: .2rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 .8rem; padding: .6rem .8rem; } legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.check { display: block; margin: .25rem 0; } .days { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0; } form.card.inline { margin-bottom: 1rem; }
.btn { display: inline-block; font: inherit; padding: .45rem .9rem; border-radius: 6px; border: 1px solid #c5cbd6; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f0f2f5; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { background: #184eae; }
.btn.danger { color: var(--bad); border-color: #e9b4ae; } .btn.small { padding: .2rem .55rem; font-size: .85rem; } .btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.flash { padding: .6rem .8rem; border-radius: 8px; margin: 0 0 1rem; } .flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.err { background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-block; font-size: .78rem; padding: .05rem .45rem; border-radius: 99px; background: #eceff3; color: #475467; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.bad { background: var(--bad-bg); color: var(--bad); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1.1rem; min-width: 170px; color: var(--ink); }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; } .stat span { color: var(--muted); } .stat.bad b { color: var(--bad); }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; background: #e3e6eb; }
.punch { display: flex; gap: .5rem; align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; } .tile { color: var(--ink); margin: 0; } .tile:hover { border-color: var(--accent); text-decoration: none; } .tile p { margin: 0; }
table.grid td { vertical-align: top; min-width: 112px; } table.grid th { white-space: nowrap; }
.shift { background: #e8f0fe; border-radius: 6px; padding: .2rem .35rem; margin: 0 0 .25rem; font-size: .85rem; display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.shift small { color: var(--muted); flex-basis: 100%; } .shift .x { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; } .shift .x:hover { color: var(--bad); }
input.money { width: 6.5rem; text-align: right; }
.progress { list-style: none; padding: 0; margin: .5rem 0 0; } .progress li { padding: .25rem 0; } .progress li.bad { color: var(--bad); }
.receipt { width: 100%; max-height: 75vh; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; } iframe.receipt { height: 70vh; }

/* Kiosk */
body.bare { background: #101826; min-height: 100vh; } body.bare main { max-width: none; padding: 1rem; } body.bare .card { color: var(--ink); }
.kiosk { color: #fff; max-width: 1100px; margin: 0 auto; }
.kiosk .muted { color: #9fb0cc; }
.kiosk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: 1.15rem; }
.kiosk-clock { text-align: right; } #clock { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.kiosk-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 1.5rem; align-items: start; }
.cam { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camwarn { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; background: #3a1512; color: #ffd9d4; font-size: 1.1rem; } .camwarn[hidden] { display: none; }
.pin { height: 3.4rem; background: #1c273b; border-radius: 10px; font-size: 2.4rem; letter-spacing: .5rem; text-align: center; line-height: 3.4rem; margin-bottom: .8rem; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.keys button { font: inherit; font-size: 1.7rem; padding: .85rem 0; border-radius: 10px; border: 0; background: #26334d; color: #fff; cursor: pointer; } .keys button:active { background: #38496b; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.actions .btn { font-size: 1.35rem; font-weight: 700; padding: 1.1rem 0; border: 0; color: #fff; } .btn.in { background: #17794a; } .btn.in:hover { background: #12613b; } .btn.out { background: #b42318; } .btn.out:hover { background: #931c13; }
.result { position: fixed; inset: auto 0 0 0; padding: 1.3rem 2rem; display: flex; gap: 1.2rem; align-items: center; justify-content: center; font-size: 1.2rem; } .result[hidden] { display: none; }
.result.good { background: #17794a; } .result.bad { background: #b42318; } .rtitle { font-size: 1.7rem; font-weight: 700; }
.result img { width: 110px; border-radius: 8px; transform: scaleX(-1); }
@media (max-width: 760px) { .kiosk-body { grid-template-columns: 1fr; } .cam { max-height: 34vh; } th, td { padding: .4rem .4rem; } }
@media print { .top, .noprint, .flash { display: none !important; } html { background: #fff; font-size: 12px; } .card { border: 0; padding: 0; } main { padding: 0; max-width: none; } a { color: inherit; } }

/* Phones */
.btn.big { padding: .8rem 1.1rem; font-size: 1.05rem; font-weight: 600; text-align: center; }
#pk-login { margin-bottom: .8rem; } #pk-login:not([hidden]) + #pk-msg + form { border-top: 1px solid var(--line); padding-top: .8rem; }
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; } /* stops iOS zooming the page on focus */
  main { padding: .75rem .6rem 3rem; } .card { padding: .8rem; }
  .upload .row.left { align-items: stretch; flex-direction: column; } .upload .field select { width: 100%; } .upload .btn.big { width: 100%; }
  .row.left .field { flex: 1 1 45%; } .row.left .field input, .row.left .field select { width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; margin-bottom: .6rem; }
  table.stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .15rem 0; text-align: right; }
  table.stack td[data-l]::before { content: attr(data-l); color: var(--muted); text-align: left; flex-shrink: 0; }
  table.stack td:empty { display: none; }
  table.stack td.lead { font-weight: 600; } table.stack td .btn { width: 100%; text-align: center; margin-top: .3rem; }
}

/* Receipt items */
.items { list-style: none; margin: .3rem 0 0; padding: 0; font-size: .85rem; font-weight: 400; }
.items li { display: flex; gap: .5rem; align-items: baseline; padding: .1rem 0; border-top: 1px dashed var(--line); } .items li span:first-child { flex: 1; text-align: left; }
.itemedit td { padding: .2rem .3rem .2rem 0; border: 0; } .itemedit input:not(.money), .itemedit select { width: 100%; }
.toggle { display: inline-flex; border: 1px solid #c5cbd6; border-radius: 6px; overflow: hidden; vertical-align: middle; }
.toggle a { padding: .45rem .8rem; color: var(--ink); background: #fff; } .toggle a.on { background: var(--accent); color: #fff; } .toggle a:hover { text-decoration: none; }
@media (max-width: 640px) { table.stack td.lead { flex-wrap: wrap; } .items { flex-basis: 100%; } }
@media (max-width: 640px) { .top { gap: .4rem .8rem; } .top nav { order: 3; flex-basis: 100%; } .top .who { margin-left: auto; } }
.shift.draft { background: #fff; border: 1px dashed #9db4e8; }
