/* Group Comms Store — Sime UI (redesign, Nov 2026)
   Same look as the Group Comms Store request site: Sime navy + orange, white cards,
   photo tiles, top bar on desktop, bottom tab bar + bottom sheets on phones.
   Type: Geologica (Sime brand typeface, self-hosted so it works offline). */

/* ---------- fonts ---------- */
@font-face { font-family: "Geologica"; src: url("/static/fonts/Geologica-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Geologica"; src: url("/static/fonts/Geologica-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geologica"; src: url("/static/fonts/Geologica-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Geologica"; src: url("/static/fonts/Geologica-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geologica"; src: url("/static/fonts/Geologica-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --navy: #17385B;
  --navy-2: #0F2A47;
  --navy-soft: #E8EEF5;
  --orange: #E86A24;
  --orange-2: #D35C19;
  --orange-soft: #FDEEE4;
  --ink: #0F1B2A;
  --text: #2B3A4B;
  --mute: #66768A;
  --line: #E3E8EF;
  --line-2: #D4DCE6;
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --green: #1F7A4D;
  --green-soft: #E3F4EA;
  --amber: #A15C00;
  --amber-soft: #FFF2D9;
  --red: #B42318;
  --red-soft: #FDE8E7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 42, .05), 0 6px 18px -8px rgba(15, 27, 42, .12);
  --shadow-lg: 0 24px 60px -18px rgba(15, 27, 42, .35);
  --font: "Geologica", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bnav-h: 0px;
  /* names the screen code already uses inline */
  --blue: var(--navy); --blue-dark: var(--navy-2); --blue-soft: var(--navy-soft);
  --orange-dark: var(--orange-2); --body: var(--text); --mute2: #93A1AA;
  --ok: var(--green); --ok-bg: var(--green-soft); --warn: var(--amber); --warn-bg: var(--amber-soft);
  --bad: var(--red); --bad-bg: var(--red-soft); --line-strong: var(--line-2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font: 400 15px/1.5 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--navy); }
img { max-width: 100%; }
svg { display: block; }
h1, h2, h3 { color: var(--navy); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; background: var(--bg); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(232, 106, 36, .55); outline-offset: 2px; }
::selection { background: rgba(232, 106, 36, .22); }
.ic { width: 18px; height: 18px; flex: none; }

.boot { min-height: 100vh; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--mute); }
.boot-mark { width: 46px; height: 46px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.topbar::before { content: ""; display: block; height: 3px; background: var(--orange); }
.top-in { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 14px; flex: none; color: var(--ink); text-decoration: none; }
.brand .logo { height: 32px; width: auto; display: block; }
.brand .name { padding-left: 14px; border-left: 1px solid var(--line-2); color: var(--mute); font-weight: 500; font-size: 15px; white-space: nowrap; }
.tabs { display: flex; gap: 4px; align-items: center; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 10px; border: 0; background: none; color: var(--mute); font-weight: 500; font-size: 14.5px; white-space: nowrap; transition: background .15s, color .15s; }
.tab:hover { background: var(--bg); color: var(--navy); }
.tab.on { background: var(--navy); color: #fff; }
.tab .ic { width: 18px; height: 18px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.badge:empty { display: none; }
.tab.on .badge { background: #fff; color: var(--navy); }
.userbox { display: flex; align-items: center; gap: 10px; flex: none; }
.uchip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 500; font-size: 14px; }
.uchip .who { display: flex; flex-direction: column; line-height: 1.2; }
.uchip .who small { color: var(--mute); font-size: 12px; font-weight: 400; }
.uchip .av, .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--mute); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn:hover { border-color: var(--line-2); color: var(--navy); }
.icon-btn.logout { background: var(--navy); border-color: var(--navy); color: #fff; }
.icon-btn.logout:hover { background: var(--navy-2); }
.icon-btn .ic { width: 20px; height: 20px; }
.setpass { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- bottom tab bar + "More" sheet (phones) ---------- */
.bnav { display: none; }
.sheet-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(15, 27, 42, .42); display: flex; align-items: flex-end; animation: fade .15s ease; }
.sheet { width: 100%; background: #fff; border-radius: 20px 20px 0 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up .22s cubic-bezier(.2, .8, .2, 1); max-height: 88vh; overflow-y: auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 12px; }
.sheet .me { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet .me b { display: block; color: var(--ink); }
.sheet .me small { color: var(--mute); }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 10px; border: 0; background: none; border-radius: 12px; text-align: left; font-weight: 500; font-size: 16px; color: var(--ink); }
.sheet-item:hover, .sheet-item:active { background: var(--bg); }
.sheet-item .ic { width: 22px; height: 22px; color: var(--navy); }
.sheet-item.on { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.sheet-item.danger, .sheet-item.danger .ic { color: var(--red); }
.sheet-item .badge { margin-left: auto; }
@media (min-width: 861px) {
  /* on desktop the account menu drops down from the top right */
  .sheet-wrap { background: transparent; align-items: flex-start; justify-content: flex-end; animation: none; }
  .sheet { width: 300px; margin: 70px 24px 0 0; border-radius: 16px; padding: 10px; border: 1px solid var(--line); animation: rise .16s ease; }
  .sheet .grab { display: none; }
  .sheet .me { padding: 8px 8px 12px; }
  .sheet-item { font-size: 15px; padding: 11px 10px; }
}

/* ---------- page ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 80px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { color: var(--orange); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.hint { color: var(--mute); font-size: 13.5px; }
.sub { color: var(--mute); font-size: 13px; }
.muted { color: var(--mute); }
.spacer { flex: 1; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.padded { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.scroll-x { overflow-x: auto; }

/* ---------- KPI cards (dashboard) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stat { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px 15px; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.stat .k-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--mute); font-weight: 500; font-size: 14px; }
.stat .k-l .ic { width: 18px; height: 18px; color: var(--orange); }
.stat > span { color: var(--mute); font-weight: 500; font-size: 14px; }
.stat b { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1.15; margin-top: 4px; letter-spacing: -.02em; }
.stat b.warn { color: #B5651D; } .stat b.bad { color: var(--red); } .stat b.ok { color: var(--green); } .stat b.muted { color: var(--mute); }
.stat small { font-size: 13px; color: var(--mute); }
.stat b.money { font-size: 25px; white-space: nowrap; padding: 4px 0 3px; }
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 10px 26px -14px rgba(15, 27, 42, .3); }
.stat .go { display: none; }
.stat.urgent { border-color: #F6C9AE; background: linear-gradient(180deg, #FFF8F3, #fff 60%); }
.stat.urgent::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--orange); }
.stat.urgent b { color: var(--orange); }

/* chart + bars */
.chart14 { padding: 18px 20px 14px; display: flex; gap: 6px; align-items: flex-end; height: 210px; }
.chart14 .c { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart14 .c b { font-size: 11px; font-weight: 600; color: var(--ink); min-height: 14px; }
.chart14 .c i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--navy); transition: background .15s; }
.chart14 .c i.zero { background: var(--line); }
.chart14 .c.today i { background: var(--orange); }
.chart14 .c:hover i:not(.zero) { background: #2C5A8C; }
.chart14 .c span { font-size: 10.5px; color: var(--mute); white-space: nowrap; }
.bars { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.bars .b-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.bars .b-top span { font-weight: 600; color: var(--ink); }
.bars .b-top b { color: var(--navy); font-size: 16px; }
.bar, .track { height: 8px; border-radius: 4px; background: #EDF1F6; overflow: hidden; }
.bar i, .track i { display: block; height: 100%; border-radius: 4px; background: var(--navy); }
.bar i.out { background: #D8B1AE; }
.bar i.or { background: var(--orange); }
[data-nav] { cursor: pointer; }
.bars div[data-nav] { border-radius: 10px; padding: 6px 8px; margin: -6px -8px; transition: background .12s ease; }
.bars div[data-nav]:hover, .li[data-nav]:hover { background: #FAFBFD; }
tr[data-nav] { transition: background .12s ease; }
tr[data-nav]:hover td { background: #FAFBFD; }

/* lists inside cards */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 20px; border-top: 1px solid var(--line); }
.row:first-child { border-top: none; }
.row .name { font-weight: 600; min-width: 0; flex: 1 1 220px; color: var(--ink); }
.row .row-main { flex: 1; min-width: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .t { font-weight: 600; color: var(--ink); }
.li .s { color: var(--mute); font-size: 13px; }
.li .grow { flex: 1; min-width: 0; }
.li .end { margin-left: auto; flex: none; display: flex; align-items: center; gap: 10px; }
.act-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--navy-soft); color: var(--navy); }
.act-ic .ic { width: 17px; height: 17px; }
.act-ic.take { background: var(--orange-soft); color: var(--orange); }
.act-ic.restock { background: var(--green-soft); color: var(--green); }
.act-ic.adjust { background: var(--amber-soft); color: var(--amber); }
.act-ic.reverse { background: var(--red-soft); color: var(--red); }
.av2 { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; vertical-align: middle; }

/* ---------- tags / pills ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.neutral { background: #EEF1F5; color: var(--mute); }
.tag.navy { background: var(--navy-soft); color: var(--navy); }
.tag.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; background: var(--navy); color: #fff; font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.accent, .btn.primary.accent { background: var(--orange); color: #fff; }
.btn.accent:hover, .btn.primary.accent:hover { background: var(--orange-2); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.danger { background: #fff; color: var(--red); border-color: #F2C4C0; }
.btn.danger:hover { background: var(--red-soft); }
.btn.soft { background: var(--orange-soft); color: var(--orange-2); }
.btn.soft:hover { background: #FBE0CE; }
.btn.tiny { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.big { min-height: 50px; font-size: 16px; width: 100%; }
a.btn { color: #fff; }
a.btn.ghost { color: var(--navy); }

/* ---------- fields ---------- */
.field, input:not([type]), input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 15px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(23, 56, 91, .12); }
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2366768A' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input::placeholder, textarea::placeholder { color: var(--mute2); }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
input.invalid { border-color: var(--red); background: #FFFAF9; }
label.lbl, .lbl { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
label.lbl .hint, .lbl .hint { font-weight: 400; font-size: 12.5px; }
fieldset { border: none; padding: 0; margin: 0; }
legend { padding: 0; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; display: block; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.err { color: var(--red); font-size: 13.5px; font-weight: 500; min-height: 18px; }
.searchbox { position: relative; display: flex; align-items: center; min-width: 0; }
.searchbox .ic { position: absolute; left: 13px; color: var(--mute); pointer-events: none; }
.searchbox input { padding-left: 40px; }

/* switches: every checkbox in the app is drawn as a switch */
input[type=checkbox] { appearance: none; -webkit-appearance: none; position: relative; width: 40px !important; height: 24px !important; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 12px; background: var(--line-2); cursor: pointer; flex: none; transition: background .15s; vertical-align: middle; box-shadow: none; }
input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
input[type=checkbox]:checked { background: var(--navy); }
input[type=checkbox]:checked::after { transform: translateX(16px); }
input[type=checkbox]:focus-visible { outline: 3px solid rgba(232, 106, 36, .55); outline-offset: 2px; }

/* chips / segmented filters */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: 14px; color: var(--text); white-space: nowrap; }
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--mute); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFD; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .r, .table th.r { text-align: right; }
.table td .sub { margin-top: 1px; }
.card > .table:first-child th:first-child, .card > .scroll-x:first-child .table th:first-child { border-top-left-radius: var(--radius); }
.thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: linear-gradient(135deg, #EDF2F8, #E2E9F2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--navy); flex: none; vertical-align: middle; }
.thumb .ic { width: 20px; height: 20px; opacity: .6; }
.namecell { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.namecell b { color: var(--ink); }

/* ---------- store (take items): photo tiles ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .searchbox { flex: 1 1 260px; max-width: 420px; }
.catnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.catnav::-webkit-scrollbar { display: none; }
.catnav .chip { flex: none; }
.cat-sec { scroll-margin-top: 90px; }
.cat-h { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; flex-wrap: wrap; }
.cat-h h2 { font-size: 18px; }
.cat-h .line { flex: 1; height: 1px; background: var(--line); min-width: 30px; }
.cat-h .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.prod { display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.prod:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(15, 27, 42, .35); }
.prod.sel { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 106, 36, .16); }
.prod .ph { position: relative; aspect-ratio: 4 / 3; width: 100%; background: linear-gradient(135deg, #EDF2F8, #E2E9F2); display: flex; align-items: center; justify-content: center; color: var(--navy); overflow: hidden; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod .ph > .ic { width: 44px; height: 44px; opacity: .45; }
.prod .ph .tag { position: absolute; top: 10px; left: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.prod .ph .incart { position: absolute; top: 10px; right: 10px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px; background: var(--orange); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(211, 92, 25, .35); }
.prod .bd { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.prod .nm { font-weight: 600; color: var(--ink); font-size: 15.5px; line-height: 1.3; }
.prod .meta { color: var(--mute); font-size: 13px; }
.prod .ft { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.prod .qty { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1; white-space: nowrap; }
.prod .ft { flex-wrap: wrap; }
.prod .qty small { font-size: 12.5px; font-weight: 500; color: var(--mute); margin-left: 3px; }
.prod .qty.low { color: #B5651D; } .prod .qty.out { color: var(--red); }
.prod .adm { display: flex; gap: 6px; padding: 0 15px 15px; flex-wrap: wrap; }
.prod .adm .btn { flex: 1; }
.cat-empty { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; flex: none; }
.step-btn { width: 36px; height: 36px; border: 0; background: none; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; }
.step-btn:hover:not(:disabled) { background: var(--bg); }
.step-btn .ic { width: 16px; height: 16px; }
.step-count { min-width: 38px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-weight: 600; color: var(--navy); }

/* take bar (desktop: sticky bottom bar; phone: compact bar + sheet) */
.actionbar { position: sticky; bottom: 14px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px 12px 18px; background: var(--navy); color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); }
.actionbar .ab-count { display: flex; align-items: center; gap: 12px; font-weight: 500; color: #C9D6E5; }
.actionbar .ab-count b { color: #fff; font-size: 17px; display: block; line-height: 1.2; }
.actionbar .ab-count .ic { width: 26px; height: 26px; color: #fff; }
.actionbar .ab-fields { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.actionbar .ab-fields input { min-width: 170px; max-width: 240px; border-color: transparent; }
.actionbar .btn.accent { min-height: 44px; padding: 0 22px; }
.actionbar .btn.accent:disabled { background: #3A5676; color: #A9BBCD; opacity: 1; }
.take-lines { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.take-lines .li { padding: 10px 14px; }

/* ---------- requests ---------- */
.rq { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.rq.done { background: #FBFCFD; }
.rq-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 14px 18px; }
.rq-h .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rq-h .who b { color: var(--ink); font-size: 15.5px; }
.rq-h .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rq-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; padding: 0 18px 12px; color: var(--text); font-size: 13.5px; }
.rq-meta span { display: inline-flex; align-items: center; gap: 6px; }
.rq-meta .ic { width: 15px; height: 15px; color: var(--mute); }
.rq-purpose { margin: 0 18px 12px; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--text); }
.rq-lines { border-top: 1px solid var(--line); }
.rq-lines .row { padding: 10px 18px; }
.rq-foot { padding: 10px 18px 14px; border-top: 1px solid var(--line); }
.aprow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.aprow .stepper input { width: 64px; height: 36px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; font-weight: 600; color: var(--navy); padding: 0; min-height: 0; -moz-appearance: textfield; box-shadow: none; }
.aprow .stepper input::-webkit-outer-spin-button, .aprow .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- settings ---------- */
.set-card { padding: 22px; }
.set-card .set-h { margin-bottom: 16px; }
.set-card .set-h b { font-size: 16.5px; color: var(--navy); font-weight: 600; }
.set-card .form-row + .form-row, .set-card .form-row + div, .set-card div + .form-row { margin-top: 14px; }
.set-card > div > div + div:not(.form-row):not(.err) { margin-top: 0; }
.set-sec { margin: 18px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.optrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.optrow:last-of-type { border-bottom: none; }
.cred { font: 600 20px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; color: var(--navy); background: var(--navy-soft); padding: 12px 14px; border-radius: 12px; user-select: all; overflow-wrap: anywhere; }

/* ---------- modal (centred on desktop, bottom sheet on phones) ---------- */
#modal-root:empty { display: none; }
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 27, 42, .42); animation: fade .15s ease; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { width: min(680px, 100%); }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 12px; }
.modal-h h2 { font-size: 19px; flex: 1; min-width: 0; padding-top: 4px; }
.modal-b { padding: 4px 22px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-b > div:empty { display: none; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.modal .foot .btn { margin-left: 0 !important; }
.x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--mute); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.x:hover { background: var(--bg); color: var(--ink); }
.x .ic { width: 20px; height: 20px; }

/* ---------- toasts ---------- */
#toast-root { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: rise .2s ease; }
.toast.bad { background: var(--red); }
.toast .ico { display: inline-flex; }
.toast .ico .ic { width: 18px; height: 18px; }

/* ---------- sign in ---------- */
/* Light, store-themed page: a shelf of item photos + a floating sign-in card
   (deliberately unlike the Media Monitor's dark split-screen sign-in). */
.login { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(900px 520px at 0% 0%, #FFF1E7, rgba(255, 241, 231, 0) 70%), radial-gradient(800px 600px at 100% 100%, #E7EEF7, rgba(231, 238, 247, 0) 70%), var(--bg); }
.lg-top { padding: 0 24px; }
.lg-top-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 76px; }
.lg-top .brand .name { display: block; }
.lg-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 56px; align-items: center; }
.lg-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow); }
.lg-pill .ic { width: 16px; height: 16px; color: var(--orange); }
.lg-intro h1 { font-size: 52px; line-height: 1.05; letter-spacing: -.025em; margin: 22px 0 14px; color: var(--navy); }
.lg-intro h1 em { font-style: normal; color: var(--orange); }
.lg-intro .lead { font-size: 17px; color: var(--mute); max-width: 480px; }
.lg-shelf { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 600px; }
.lg-shelf:empty { display: none; }
.lg-tile { position: relative; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 28px -16px rgba(15, 27, 42, .35); }
.lg-tile:nth-child(3n+2) { transform: translateY(18px); }
.lg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-tile .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #EDF2F8, #E2E9F2); color: var(--navy); }
.lg-tile .ph .ic { width: 38px; height: 38px; opacity: .5; }
.lg-tile .cap { position: absolute; left: 8px; right: 8px; bottom: 8px; background: rgba(255, 255, 255, .94); border-radius: 10px; padding: 6px 9px; font-size: 11.5px; color: var(--mute); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-tile .cap b { display: block; color: var(--ink); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lg-card { background: #fff; border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(15, 27, 42, .35); padding: 30px 30px 26px; position: relative; overflow: hidden; }
.lg-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--navy) 0 70%, var(--orange) 70% 100%); }
.lg-card .formcard { display: grid; gap: 16px; }
.lg-card-h { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.lg-badge { width: 48px; height: 48px; border-radius: 14px; background: var(--orange-soft); color: var(--orange); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.lg-badge .ic { width: 24px; height: 24px; }
.lg-card-h h2 { font-size: 24px; font-weight: 700; }
.lg-card-h p { color: var(--mute); font-size: 14px; margin-top: 2px; }
.lg-card .err:not(:empty) { background: var(--red-soft); padding: 10px 14px; border-radius: 10px; }
.lg-card .err:empty { min-height: 0; margin: -8px 0; }
.lg-card .btn.big .ic { width: 18px; height: 18px; }
.req-link { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 13px 12px; border-radius: 12px; background: var(--bg); color: var(--navy); font-weight: 600; text-decoration: none; font-size: 14px; text-align: center; }
.req-link span { color: var(--mute); font-weight: 400; }
.req-link .ic { width: 16px; height: 16px; color: var(--orange); }
.req-link:hover { background: var(--orange-soft); }
.lg-foot { text-align: center; color: var(--mute); font-size: 13px; padding: 0 24px 22px; }

/* ---------- misc ---------- */
.empty { padding: 36px 20px; text-align: center; color: var(--mute); }
.card > .empty, .empty.boxed { border: 0; }
#view > .empty, .wrap > .empty, #lowwrap > .empty, #histwrap > .empty, #uwrap > .empty, #masterwrap > .empty, #dash > .empty { background: #fff; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty .ic { width: 40px; height: 40px; color: var(--line-2); margin: 0 auto 10px; }

/* image zoom */
#zimg-ov { position: fixed; inset: 0; z-index: 220; display: none; align-items: center; justify-content: center; background: rgba(15, 27, 42, .62); backdrop-filter: blur(3px); padding: 22px; }
#zimg-ov .zimg-card { position: relative; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); max-width: 780px; width: 100%; overflow: hidden; }
#zimg-ov .zimg-im { background: #F0F2F4; display: flex; align-items: center; justify-content: center; min-height: 240px; max-height: 66vh; }
#zimg-ov .zimg-im img { max-width: 100%; max-height: 66vh; object-fit: contain; }
#zimg-ov .zimg-cap { padding: 14px 18px; font-size: 15px; font-weight: 600; color: var(--navy); border-top: 1px solid var(--line); }
#zimg-ov .zimg-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: var(--navy); font-size: 15px; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
#zimg-ov .zimg-x:hover { background: var(--orange); color: #fff; }
img.imgzoom { cursor: zoom-in; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- smaller screens ---------- */
@media (max-width: 1500px) { .brand .name { display: none; } }
@media (max-width: 1320px) { .uchip .who { display: none; } .uchip { padding: 3px; } }
@media (max-width: 1180px) and (min-width: 861px) { .tab .ic { display: none; } .tab { padding: 9px 11px; } }
@media (max-width: 1020px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .lg-main { grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 560px; padding-top: 8px; }
  .lg-card { order: -1; padding: 24px 20px 20px; }
  .lg-intro h1 { font-size: 32px; margin: 16px 0 8px; }
  .lg-intro .lead { font-size: 15px; }
  .lg-shelf { display: flex; overflow-x: auto; scrollbar-width: none; gap: 10px; margin: 18px -24px 0; padding: 0 24px 6px; max-width: none; }
  .lg-shelf::-webkit-scrollbar { display: none; }
  .lg-tile { flex: none; width: 128px; }
  .lg-tile:nth-child(3n+2) { transform: none; }
  .lg-top-in { min-height: 64px; }
  .lg-req .t { display: none; }
  .lg-req { padding: 0 12px; }
}

/* phones and small tablets: bottom tab bar, sheets, tables as cards */
@media (max-width: 860px) {
  :root { --bnav-h: calc(64px + env(safe-area-inset-bottom)); }
  .top-in { padding: 8px 16px; min-height: 56px; gap: 12px; }
  .brand .logo { height: 28px; }
  .brand .name { display: block; font-size: 14px; padding-left: 12px; }
  .topbar .tabs { display: none; }
  .userbox { margin-left: auto; }
  .userbox .icon-btn.logout { display: none; }
  .setpass .txt { display: none; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px env(safe-area-inset-bottom); }
  .bnav button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 7px; border: 0; background: none; color: var(--mute); font-size: 11.5px; font-weight: 500; position: relative; border-radius: 12px; }
  .bnav button .ic { width: 23px; height: 23px; }
  .bnav button span.l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bnav button.on { color: var(--navy); font-weight: 600; }
  .bnav button.on::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange); }
  .bnav .badge { position: absolute; top: 2px; left: calc(50% + 6px); height: 18px; min-width: 18px; font-size: 11px; padding: 0 5px; }
  .wrap { padding: 20px 14px calc(var(--bnav-h) + 28px); gap: 14px; }
  h1 { font-size: 25px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-head .acts { width: 100%; }
  .page-head .acts .searchbox, .page-head .acts input[type=search] { flex: 1; max-width: none !important; }
  .card-head, .row, .li { padding-left: 16px; padding-right: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 26px; }
  .stat b.money { font-size: 19px; }
  .stat .k-l { font-size: 13px; }
  .chart14 { height: 180px; padding: 14px 12px 10px; gap: 3px; }
  .chart14 .c b { font-size: 9.5px; }
  .chart14 .c span { font-size: 9px; overflow: visible; }
  .chart14 .c:nth-child(odd) span { visibility: hidden; }
  .bars { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .prod .bd { padding: 10px 12px 12px; }
  .prod .nm { font-size: 14.5px; }
  .prod .qty { font-size: 20px; }
  .prod .ft { flex-direction: column; align-items: stretch; gap: 8px; }
  .prod .stepper { width: 100%; }
  .prod .step-btn { flex: 1; height: 40px; }
  .prod .step-count { flex: 1.2; height: 40px; }
  .prod .adm { padding: 0 12px 12px; }
  .prod .adm .btn { min-height: 36px; padding: 0 6px; font-size: 12.5px; }
  .actionbar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--bnav-h) + 10px); padding: 10px 10px 10px 16px; flex-wrap: nowrap; }
  .actionbar .ab-fields input, .actionbar .ab-fields label { display: none; }
  .actionbar .ab-fields { flex: none; }
  .actionbar.empty-cart { display: none; }
  .cat-h h2 { font-size: 16px; }
  .rq-h, .rq-meta, .rq-lines .row, .rq-foot { padding-left: 14px; padding-right: 14px; }
  .rq-purpose { margin-left: 14px; margin-right: 14px; }
  .rq-h .acts { width: 100%; }
  .rq-h .acts .btn { flex: 1; }
  .set-card { padding: 18px 16px; }
  /* tables turn into stacked cards */
  .table.resp thead { display: none; }
  .table.resp, .table.resp tbody, .table.resp tr, .table.resp td { display: block; width: 100%; }
  .table.resp tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.resp tbody tr:last-child { border-bottom: 0; }
  .table.resp td { border: 0; padding: 4px 0; display: flow-root; text-align: right; min-height: 26px; }
  .table.resp td::before { content: attr(data-label); float: left; margin-right: 14px; color: var(--mute); font-size: 13px; font-weight: 500; text-align: left; line-height: 1.6; }
  .table.resp td[data-label=""]::before { display: none; }
  .table.resp td:first-child { text-align: left; padding-bottom: 8px; font-size: 15px; }
  .table.resp td:first-child::before { display: none; }
  .table.resp td:last-child:not(:first-child) { padding-top: 8px; }
  .table.resp td:last-child:not(:first-child) .btn { margin: 3px 0 3px 4px; }
  .table.resp td:empty, .table.resp td.ph-hide { display: none; }
  .table.resp td .sub { text-align: right; }
  .table.resp td:first-child .sub { text-align: left; }
  .table.resp .namecell { min-width: 0; }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; animation: up .24s cubic-bezier(.2, .8, .2, 1); }
  .modal .foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .modal .foot .btn { flex: 1 1 auto; }
  .modal-h { padding: 18px 18px 10px; }
  .modal-b { padding: 4px 18px 16px; }
  .modal .foot { padding-left: 18px; padding-right: 18px; }
  #toast-root { top: 12px; }
  .lg-top { padding: 0 16px; }
  .lg-main { padding: 4px 16px 28px; }
  .lg-shelf { margin: 16px -16px 0; padding: 0 16px 6px; }
  .lg-intro h1 { font-size: 29px; }
  .lg-card-h h2 { font-size: 21px; }
}
@media (max-width: 380px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .bnav button { font-size: 10.5px; }
}
