/* Global Muslim Treasury Procurement App
   Palette taken from the GMT seal: deep navy, seal gold, seal red. */
:root {
  --navy: #0b3d52;
  --navy-2: #0f4d66;
  --navy-ink: #072a39;
  --gold: #e0a826;
  --gold-soft: #fbf1d6;
  --red: #c0392b;
  --red-soft: #fbe9e6;
  --green: #2e7d5b;
  --green-soft: #e4f2ec;
  --blue-soft: #e6eff4;
  --ink: #13232c;
  --muted: #5f6f78;
  --line: #d9e1e5;
  --line-soft: #e9eef0;
  --paper: #f5f7f8;
  --card: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(7, 42, 57, .06), 0 4px 14px rgba(7, 42, 57, .05);
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --side-w: 252px;
  --tabbar-h: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.has-modal { overflow: hidden; }
a { color: var(--navy-2); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.low, .neg.low { color: var(--red); font-weight: 600; }
.pos { color: var(--green); }
.num, .row-num, .qty input, .entry-stock, .item-summary b, .count { font-variant-numeric: tabular-nums; }
.neg { color: var(--ink); }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.code { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--navy); background: var(--blue-soft); padding: 1px 6px; border-radius: 4px; }

/* ---------- boot / login ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(224, 168, 38, .16), transparent 60%),
    linear-gradient(180deg, var(--navy) 0, var(--navy) 38vh, var(--paper) 38vh);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(7, 42, 57, .22); padding: 28px 28px 22px; text-align: center;
  border-top: 4px solid var(--gold);
}
.login-seal { display: block; margin: -84px auto 10px; border-radius: 50%; box-shadow: 0 8px 22px rgba(7, 42, 57, .25); background: #fff; }
.wordmark { font-family: var(--display); font-weight: 700; color: var(--navy); font-size: 22px; letter-spacing: .06em; }
.login-sub { margin: 4px 0 22px; color: var(--muted); font-size: 15px; }
.login-card .field { text-align: left; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font: inherit; }
.login-help { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.notice-title { margin: 18px 0 6px; font-size: 18px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--navy); color: #dbe7ec;
  display: flex; flex-direction: column; z-index: 40; overflow-y: auto;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; }
.brand img { border-radius: 50%; background: #fff; }
.brand-name { font-family: var(--display); font-weight: 700; color: #fff; font-size: 15px; letter-spacing: .05em; line-height: 1.2; }
.brand-sub { color: var(--gold); font-size: 13px; font-weight: 600; margin-top: 2px; }
.scope { margin: 0 14px 10px; padding: 10px 12px; background: var(--navy-ink); border-radius: var(--radius-sm); }
.scope-label { display: block; font-size: 12px; color: #9fb7c2; margin-bottom: 4px; }
.scope-name { color: #fff; font-weight: 600; }
.scope select { width: 100%; background: var(--navy-2); color: #fff; border: 1px solid #2a6580; border-radius: 6px; padding: 7px 8px; }
.nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 12px; color: #9fb7c2; padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; color: #dbe7ec; text-decoration: none;
  border-radius: var(--radius-sm); border-left: 3px solid transparent; font-weight: 500;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: rgba(224, 168, 38, .14); color: #fff; border-left-color: var(--gold); }
.nav-link.active .ico { color: var(--gold); }
.me { padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.me-name { color: #fff; font-weight: 600; }
.me-role { font-size: 13px; color: #9fb7c2; }
.me-actions { display: flex; gap: 14px; margin-top: 10px; }
.link-quiet { display: inline-flex; gap: 6px; align-items: center; color: #c9d9e0; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; font-size: 14px; }
.link-quiet .ico { width: 16px; height: 16px; }
.link-quiet:hover { color: #fff; }
.topbar, .tabbar, .scrim { display: none; }

main { margin-left: var(--side-w); padding: 28px 32px 120px; max-width: calc(1180px + var(--side-w)); outline: none; }

/* ---------- page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; font-weight: 700; color: var(--navy-ink); letter-spacing: -.01em; }
.sub { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; }
.loading.small { padding: 10px 0; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.panel { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.panel.narrow { max-width: 560px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-head h2, .panel-title { font-size: 17px; font-weight: 700; color: var(--navy-ink); }
.panel-title { margin-bottom: 10px; }
.panel-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.link { font-size: 14px; font-weight: 600; text-decoration: none; }
.count { font-weight: 700; color: var(--muted); }
.count-red { color: var(--red); }
.more { margin: 8px 0 0; font-size: 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > .panel { margin-bottom: 18px; }
.cols-facts { grid-template-columns: 1.1fr .9fr; }

.actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.action {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.action .ico { width: 26px; height: 26px; color: var(--navy); padding: 9px; box-sizing: content-box; background: var(--blue-soft); border-radius: 50%; }
.action b { display: block; }
.action small { color: var(--muted); font-size: 13px; }
.action:hover { border-color: var(--gold); }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.rows li:last-child .row, .rows li.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 600; }
.row-main small { color: var(--muted); font-size: 13px; }
.row-num { font-weight: 700; white-space: nowrap; }
.row-num small { font-weight: 400; color: var(--muted); }
.row-link:hover b { color: var(--navy-2); text-decoration: underline; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-title { font-weight: 700; color: var(--ink); font-size: 17px; margin: 0 0 4px; }
.empty p { margin: 0 0 12px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-soft); border: 1px solid #f0d58f; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.notice .ico { color: #9a6c00; margin-top: 2px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; min-height: 40px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn .ico { width: 18px; height: 18px; }
.btn:hover { border-color: #b9c6cc; background: #fafbfc; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-accent { background: var(--gold); border-color: #c99317; color: var(--navy-ink); }
.btn-accent:hover { background: #e9b43a; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-quiet { color: var(--red); }
.btn-small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; min-height: 46px; margin-top: 6px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.is-busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 8px; cursor: pointer; color: inherit; display: inline-flex; }

.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; border: 0; padding: 0; min-width: 0; }
.form .field { margin: 0; }
.field > span, .field > legend { font-size: 14px; font-weight: 600; color: #34464f; padding: 0; }
input, select, textarea {
  width: 100%; border: 1px solid #c4d0d6; border-radius: var(--radius-sm); padding: 9px 11px; background: #fff; min-height: 42px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); outline: 2px solid rgba(15, 77, 102, .18); outline-offset: 0; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--navy); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--red); font-size: 14px; margin: 0; min-height: 1em; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.lead-text { margin: 0 0 8px; }
.pw-row { display: flex; gap: 8px; }
.mono-ish { background: var(--paper); padding: 8px 10px; border-radius: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.toolbar select { width: auto; }
.field.inline { margin: 0; }
.field.inline input { min-width: 150px; }
.grow { flex: 1; min-width: 220px; }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; max-width: 360px; }
.search .ico { position: absolute; left: 11px; color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 36px; }

.seg { display: inline-flex; background: #e8edf0; border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg > button, .seg > label > span { border: 0; background: none; padding: 7px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; color: #3b4d56; font-size: 14px; display: block; }
.seg > button.on, .seg > label > input:checked + span { background: #fff; color: var(--navy-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg > label { position: relative; }
.seg > label > input { position: absolute; opacity: 0; pointer-events: none; }
.seg > label > input:focus-visible + span { outline: 3px solid var(--gold); }
.seg-full { display: flex; }
.seg-full > label { flex: 1; text-align: center; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .table-wrap { box-shadow: none; border: 0; border-radius: 0; margin: 0 -20px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 700; color: #4a5c65; background: #f2f5f6; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table small { font-size: 13px; }
.clickable { cursor: pointer; }
.clickable:hover td { background: #f7fafb; }
tr.inactive td { color: #8a989f; }
.table-note { color: var(--muted); font-size: 13px; margin: 8px 2px; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eceff1; color: #4f5f67; }
.tag-low { background: var(--red-soft); color: var(--red); }
.tag-ok { background: var(--green-soft); color: var(--green); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.st-draft { background: #eceff1; color: #4f5f67; }
.st-submitted { background: var(--gold-soft); color: #7c5600; }
.st-partly_received { background: var(--blue-soft); color: var(--navy-2); }
.st-received { background: var(--green-soft); color: var(--green); }
.st-cancelled { background: #f1f1f1; color: #888; text-decoration: line-through; }
.mv { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px; margin-right: 4px; }
.mv-used { background: #eef1f3; color: #44555e; }
.mv-received { background: var(--green-soft); color: var(--green); }
.mv-wasted { background: var(--red-soft); color: var(--red); }
.mv-adjust_in, .mv-adjust_out { background: var(--gold-soft); color: #7c5600; }

/* ---------- entry lists (use / receive / order) ---------- */
.entries { list-style: none; margin: 0 0 16px; padding: 0; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.entry:last-child { border-bottom: 0; }
.entry-main b { display: block; font-weight: 600; }
.entry-main small { color: var(--muted); font-size: 13px; }
.entry-stock { font-size: 14px; text-align: right; white-space: nowrap; }
.entry-stock.done { color: var(--green); display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }
.entry-inputs { display: flex; gap: 8px; align-items: center; }
.qty { display: flex; align-items: center; border: 1px solid #c4d0d6; border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.qty:focus-within { border-color: var(--navy-2); outline: 2px solid rgba(15, 77, 102, .18); }
.qty input { border: 0; width: 84px; text-align: right; font-weight: 700; min-height: 40px; outline: none; }
.qty span { padding: 0 10px 0 4px; color: var(--muted); font-size: 13px; min-width: 42px; }
.entry-note { width: 170px; min-height: 40px; font-size: 14px; }
.entry.has-error .qty { border-color: var(--red); background: var(--red-soft); }
.entry.has-error .qty input { background: var(--red-soft); color: var(--red); }

.sticky-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; box-shadow: 0 -4px 20px rgba(7, 42, 57, .08); margin-bottom: 8px;
}
.sticky-bar > span { margin-right: auto; color: var(--muted); font-weight: 600; }

/* ---------- cards / picks ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow); height: 100%; }
.card:hover { border-color: var(--gold); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pick { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.pick:hover { border-color: var(--gold); }
.pick-code { font-size: 12px; font-weight: 700; color: var(--navy); background: var(--blue-soft); padding: 1px 6px; border-radius: 4px; }

/* ---------- order view ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.facts > div > span:first-child { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.facts select { max-width: 280px; }
.fact-wide { grid-column: 1 / -1; }
.admin-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.admin-row select { width: auto; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 8px; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }
.timeline li.muted::before { background: var(--line); }
.timeline small { display: block; color: var(--muted); font-size: 13px; }

.item-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--paper); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.item-summary span { display: block; font-size: 13px; }
.item-summary b { font-size: 17px; }
.count-box { border: 1px solid var(--line); background: #fbfcfd; border-radius: var(--radius-sm); padding: 12px 14px 14px; margin-bottom: 8px; }
.count-title { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--navy-ink); margin: 0 0 4px; }
.count-title .ico { width: 18px; height: 18px; color: var(--navy-2); }
.count-box .hint { margin-bottom: 10px; }
.count-box .grid2 { margin-bottom: 10px; }
.sub-head { font-size: 15px; margin: 20px 0 4px; color: var(--navy-ink); }

/* ---------- modal & toast ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(7, 32, 44, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s ease-out; }
.modal { background: #fff; border-radius: 14px; width: 100%; min-width: 0; max-width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); outline: none; }
.modal-wide { max-width: min(760px, 100%); }
.modal-body { min-width: 0; }
.grid2 > *, .item-summary > *, .facts > * { min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font-size: 19px; color: var(--navy-ink); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: #fafbfc; border-radius: 0 0 14px 14px; }
.foot-note { margin-right: auto; color: var(--green); font-weight: 600; font-size: 14px; }
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy-ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 500; border-left: 4px solid var(--gold); transition: opacity .3s, transform .3s; }
.toast-err { border-left-color: #ff6b5a; background: #4a1712; }
.toast-warn { border-left-color: var(--gold); background: #3d2f08; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .actions-row { grid-template-columns: repeat(2, 1fr); }
  .cols, .cols-facts { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- phone ---------- */
@media (max-width: 860px) {
  :root { --tabbar-h: 64px; }
  .side { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(7, 32, 44, .4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar img { border-radius: 50%; background: #fff; }
  .topbar-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  main { margin-left: 0; padding: 18px 16px calc(var(--tabbar-h) + 90px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; }
  .tabbar a.active { color: var(--navy); }
  .tabbar a.active .ico { color: var(--navy); stroke-width: 2.2; }
  .page-head h1 { font-size: 23px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .actions-row { gap: 8px; }
  .action { padding: 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .action small { display: none; }
  .panel { padding: 14px 16px; }
  .panel .table-wrap { margin: 0 -16px; }
  .grid2, .facts { grid-template-columns: 1fr; }
  .item-summary { grid-template-columns: 1fr 1fr; }
  .search { max-width: none; }
  .toolbar > select, .field.inline, .field.inline input { width: 100%; }
  .toolbar .seg { width: 100%; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main inputs" "stock inputs"; row-gap: 2px; padding: 10px 12px; }
  .entry-main { grid-area: main; }
  .entry-stock { grid-area: stock; text-align: left; font-size: 13px; }
  .entry-stock.done { justify-content: flex-start; }
  .entry-inputs { grid-area: inputs; flex-direction: column; align-items: flex-end; }
  .entry-note { width: 140px; }
  .qty input { width: 70px; }
  .sticky-bar { bottom: calc(var(--tabbar-h) + 8px); flex-wrap: wrap; }
  .sticky-bar > span { width: 100%; margin: 0; font-size: 14px; }
  .sticky-bar .btn { flex: 1; }
  #toasts { right: 12px; left: 12px; bottom: calc(var(--tabbar-h) + 12px); max-width: none; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
