/* Denall Stock. Black and white with the Denall red dot. Built for phones and tablets in a cellar first. */
:root {
  --bg: #f6f6f4; --card: #fff; --ink: #0b0b0d; --ink2: #55565b; --line: #e3e3df; --soft: #efefec;
  --red: #e1251b; --red-soft: #fdecea; --amber: #b86e00; --amber-soft: #fff4e0; --green: #18794e; --green-soft: #e6f4ec;
  --top: #0b0b0d; --top-ink: #fff; --radius: 12px; --tap: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --card: #1b1b1e; --ink: #f2f2f0; --ink2: #a6a6ab; --line: #2e2e33; --soft: #242428; --red: #ff5a4f; --red-soft: #3a1714; --amber: #f0a43a; --amber-soft: #36270f; --green: #4fc48a; --green-soft: #12301f; --top: #000; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body.noscroll { overflow: hidden; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.boot { padding: 2rem; text-align: center; color: var(--ink2); }
.muted { color: var(--ink2); }
.pad { padding: 1rem; }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; color: var(--ink2); word-break: break-all; }
.bad { color: var(--red); }
[hidden] { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; background: var(--top); color: var(--top-ink);
  padding: calc(.5rem + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) .5rem max(16px, env(safe-area-inset-left, 0px)); min-height: 56px; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; text-decoration: none; color: #fff; }
.brand span { color: var(--red); }
.venue { background: #1e1e22; color: #fff; border: 1px solid #333; border-radius: 8px; padding: .45rem .6rem; font: inherit; font-weight: 600; max-width: min(46vw, 320px); }
.venue.one { border: 0; background: none; padding: 0; }
.who { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.who > span { display: flex; flex-direction: column; text-align: right; line-height: 1.15; }
.who small { color: #aaa; font-size: .75rem; }
.qbadge { background: var(--amber); color: #000; border-radius: 99px; padding: .15rem .6rem; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.demo-bar { background: repeating-linear-gradient(45deg, #ffe08a, #ffe08a 12px, #ffd25a 12px, #ffd25a 24px); color: #000; text-align: center; font-weight: 700; padding: .45rem 1rem; font-size: .9rem; }

/* layout */
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.nav { position: sticky; top: 56px; align-self: start; display: flex; flex-direction: column; gap: 2px; padding: 1rem .6rem; height: calc(100vh - 56px); overflow-y: auto; border-right: 1px solid var(--line); background: var(--card); }
.nav a { display: block; padding: .7rem .9rem; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink2); }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--ink); color: var(--bg); }
main { padding: 1.25rem max(16px, env(safe-area-inset-right, 0px)) 6rem max(16px, env(safe-area-inset-left, 0px)); min-width: 0; outline: none; max-width: 1280px; }
@media (max-width: 860px) {
  .layout { display: block; }
  .nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 25; flex-direction: row; height: auto; overflow-x: auto; padding: .35rem max(8px, env(safe-area-inset-left, 0px)) calc(.35rem + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); scrollbar-width: none; }
  .nav a { flex: 0 0 auto; padding: .65rem .8rem; font-size: .88rem; }
  .who > span { display: none; }
  h1 { font-size: 1.35rem; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; min-width: 0; }
.card.narrow { max-width: 760px; }
.card.hl { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1rem; }
.grid2 .card { margin: 0; }
.row2, .row3 { display: grid; gap: .75rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: start; }
.row3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.lead { font-size: 1.15rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap); padding: .55rem 1.1rem; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn.small { min-height: 36px; padding: .3rem .7rem; font-size: .88rem; }
.btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; margin-top: .5rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .count-row:focus-visible, .pick:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.top .btn { border-color: #555; background: transparent; color: #fff; }
.icon { border: 0; background: none; color: var(--ink2); font-size: 1.5rem; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; line-height: 1; }
.icon:hover { background: var(--soft); color: var(--ink); }

/* forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; min-width: 0; }
.field > span { font-weight: 700; font-size: .92rem; }
.field small { color: var(--ink2); font-size: .82rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid #c9c9c4; border-radius: 10px; padding: .6rem .75rem; min-height: var(--tap); width: 100%; min-width: 0; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--ink); flex: none; }
input[type=range] { padding: 0; border: 0; accent-color: var(--red); height: 40px; }
input[type=file] { padding: .5rem; }
textarea { resize: vertical; }
label.row { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
.stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; gap: .4rem; }
.stepper input { text-align: center; font-size: 1.35rem; font-weight: 700; }
.btn.step { padding: 0; font-size: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.chip { min-height: 42px; padding: .4rem .85rem; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.msg { padding: .7rem .9rem; border-radius: 10px; background: var(--soft); margin: .5rem 0 1rem; }
.msg.warn { background: var(--amber-soft); color: var(--ink); border-left: 4px solid var(--amber); }
.msg.bad { background: var(--red-soft); border-left: 4px solid var(--red); }
.total { font-size: 1.15rem; font-weight: 800; margin: .75rem 0; }
.searchbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.searchbar input { flex: 1 1 240px; }
.searchbar .chips { margin: 0; }

/* tabs */
.tabs { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: 2px; scrollbar-width: thin; }
.tab { flex: 0 0 auto; min-height: 42px; display: inline-flex; align-items: center; padding: .45rem .95rem; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; display: flex; flex-direction: column; gap: .15rem; border-top: 4px solid var(--line); min-width: 0; }
.card .stat { background: var(--bg); }
.stat-l { font-size: .82rem; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }
.stat b { font-size: 1.55rem; letter-spacing: -.02em; }
.stat small { color: var(--ink2); font-size: .82rem; }
.stat.green { border-top-color: var(--green); } .stat.green b { color: var(--green); }
.stat.amber { border-top-color: var(--amber); } .stat.amber b { color: var(--amber); }
.stat.red, .stat.warn { border-top-color: var(--red); } .stat.red b, .stat.warn b { color: var(--red); }
.stat.grey b { font-size: 1.05rem; color: var(--ink2); }
td.green { color: var(--green); font-weight: 700; } td.amber { color: var(--amber); font-weight: 700; } td.red { color: var(--red); font-weight: 700; }
.banner { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.banner .btn.primary { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.todo, .plain, .notes { margin: 0; padding-left: 1.1rem; }
.todo li, .plain li { padding: .3rem 0; }
.todo a { font-weight: 700; }
.notes { list-style: none; padding: 0; }
.notes li { border-left: 3px solid var(--line); padding: .3rem .7rem; margin-bottom: .5rem; }
.notes small { display: block; color: var(--ink2); }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.25rem .75rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); padding: .5rem .55rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--soft); }
.tbl tr.bad-row td { background: var(--red-soft); }
.tbl tr.strong td { font-weight: 800; }
.tbl td.empty { color: var(--ink2); text-align: center; padding: 1.25rem; }
.tbl.tight td { padding: .35rem .5rem; }
.tbl.review td:first-child { min-width: 150px; font-weight: 600; }
.tbl.lines td { min-width: 90px; } .tbl.lines td:first-child { min-width: 160px; font-weight: 600; }
.tbl.lines input, .tbl.lines select { min-height: 40px; padding: .35rem .5rem; }
.flag { display: inline-block; background: var(--amber-soft); color: var(--ink); border-radius: 6px; padding: .05rem .45rem; font-size: .75rem; font-weight: 700; margin: 0 .25rem .2rem 0; white-space: nowrap; }
.expl { display: block; color: var(--ink2); font-style: italic; }

/* counting */
.progress { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 1rem; font-weight: 700; font-size: .92rem; }
.progress .bar { flex: 1; height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--green); transition: width .3s; }
.count-list { display: flex; flex-direction: column; gap: 6px; }
.cat { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin: .9rem 0 .2rem; }
.count-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: .6rem; min-height: 64px; width: 100%; text-align: left; padding: .55rem .8rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; touch-action: manipulation; }
.count-row .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 900; }
.count-row.done { border-color: var(--green); }
.count-row.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.count-row .nm { font-weight: 700; display: flex; flex-direction: column; min-width: 0; }
.count-row .nm small { font-weight: 500; color: var(--ink2); }
.count-row .exp { color: var(--ink2); font-size: .85rem; white-space: nowrap; }
.opens { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .5rem; }
.open-row { border: 1.5px dashed var(--line); border-radius: 10px; padding: .6rem .75rem; }
.open-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: space-between; font-weight: 700; }
.open-top .chips { margin: 0; }
.open-body { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; }
.open-body b { white-space: nowrap; min-width: 6.5em; }
.open-body .field { flex: 1; margin: 0; }

/* product picker */
.picker { position: relative; margin-bottom: .5rem; }
.pick-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; max-height: 50vh; overflow-y: auto; }
.pick { display: flex; flex-direction: column; text-align: left; padding: .6rem .8rem; min-height: var(--tap); border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.pick:hover { background: var(--soft); }
.pick small { color: var(--ink2); }
.chosen-p { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: var(--soft); border-radius: 10px; padding: .5rem .8rem; margin-bottom: .5rem; font-size: 1.1rem; }
.part { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 140px) 40px; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.part b { overflow-wrap: anywhere; }

/* staff home */
.big-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .9rem; }
.bigbtn { display: flex; flex-direction: column; gap: .3rem; padding: 1.4rem 1.2rem; min-height: 120px; border-radius: 16px; background: var(--card); border: 2px solid var(--ink); text-decoration: none; }
.bigbtn b { font-size: 1.35rem; }
.bigbtn small { color: var(--ink2); }
.bigbtn:active { background: var(--soft); }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: 18px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .85rem 1rem .5rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-body { padding: 1rem; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.modal-foot .btn { flex: 1 1 auto; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; z-index: 60; background: var(--ink); color: var(--bg); padding: .75rem 1.1rem; border-radius: 12px; font-weight: 700; max-width: calc(100% - 32px); transition: .25s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); color: #fff; }

/* login */
body.login { display: grid; place-items: center; min-height: 100vh; background: var(--top); padding: 16px; }
.login-card { background: var(--card); width: 100%; max-width: 400px; border-radius: 18px; padding: 2rem 1.5rem; }
.login-card .brand { color: var(--ink); font-size: 2rem; display: block; margin-bottom: 1rem; }
.login-card h1 { font-size: 1.4rem; }
.login-card .sub { color: var(--ink2); margin: .2rem 0 1.25rem; }
.login-card form { display: flex; flex-direction: column; gap: .5rem; }
.login-card label { font-weight: 700; font-size: .92rem; }
.login-card .btn { margin-top: .75rem; }
.login-card .small { margin-top: 1rem; text-align: center; }

.login-card .codes, .login-card .secret { font: 700 1.15rem/1.7 ui-monospace, Menlo, Consolas, monospace; background: var(--soft); border-radius: 10px; padding: .75rem 1rem; text-align: center; letter-spacing: .06em; word-break: break-all; }
.login-card .secret { word-break: normal; word-spacing: .2em; }
.login-card .steps { padding-left: 1.2rem; margin: .5rem 0; }
.login-card input[name=ss_code] { font-size: 1.5rem; text-align: center; letter-spacing: .2em; }

/* printing a stocktake: just the figures */
@media print {
  .top, .nav, .demo-bar, .actions, .chips, .tabs, .qbadge, .toast, .modal-back { display: none !important; }
  .layout { display: block; } main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, .stat { border: 1px solid #999; break-inside: avoid; box-shadow: none; }
  .table-wrap { overflow: visible; } .tbl { font-size: 9pt; } .tbl tr { break-inside: avoid; }
}
