/* Layout: phone-first single column with a bottom tab bar; ≥ 960px gets a right-hand sidebar.
   Palette: mosque-tile turquoise for structure, brass for the one highlight, sage-tinted neutrals. */
@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url(fonts/vazirmatn-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Vazirmatn; font-weight: 500; font-display: swap; src: url(fonts/vazirmatn-arabic-500-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url(fonts/vazirmatn-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Vazirmatn; font-weight: 800; font-display: swap; src: url(fonts/vazirmatn-arabic-800-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Vazirmatn; font-weight: 400 500; font-display: swap; src: url(fonts/vazirmatn-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Vazirmatn; font-weight: 700 800; font-display: swap; src: url(fonts/vazirmatn-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #f1f4f2;
  --surface: #ffffff;
  --surface-2: #e8eeeb;
  --line: #d5dfdb;
  --ink: #142b28;
  --muted: #5b6f6a;
  --brand: #0e5f57;
  --brand-2: #0b4a44;
  --brand-soft: #dcefeb;
  --bar: #0e5f57;
  --on-bar: #ffffff;
  --on-brand: #ffffff;
  --brass: #b9852f;
  --brass-soft: #f6ead2;
  --ok: #2b7a4b;   --ok-soft: #e0f1e6;
  --warn: #a8670f; --warn-soft: #fbecd2;
  --bad: #b3352f;  --bad-soft: #f8e0de;
  --info: #285c8c; --info-soft: #e1ebf5;
  --shadow: 0 1px 2px rgb(20 43 40 / .06), 0 4px 16px rgb(20 43 40 / .06);
  --font: Vazirmatn, Tahoma, 'Segoe UI', sans-serif;
  --r: 12px;
  --gutter: 16px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1614; --surface: #15201e; --surface-2: #1c2a27; --line: #2a3a37; --ink: #e2ebe8; --muted: #93a7a1;
    --brand: #3aa999; --brand-2: #5cc2b3; --brand-soft: #173a35; --on-brand: #06201c; --bar: #12302c; --on-bar: #e2ebe8; --brass: #e2ac55; --brass-soft: #3a2e17;
    --ok: #63c58a; --ok-soft: #173325; --warn: #e9a447; --warn-soft: #3a2b12; --bad: #f07a72; --bad-soft: #3d1b19;
    --info: #79aee0; --info-soft: #172a3c; --shadow: 0 1px 2px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1614; --surface: #15201e; --surface-2: #1c2a27; --line: #2a3a37; --ink: #e2ebe8; --muted: #93a7a1;
  --brand: #3aa999; --brand-2: #5cc2b3; --brand-soft: #173a35; --on-brand: #06201c; --bar: #12302c; --on-bar: #e2ebe8; --brass: #e2ac55; --brass-soft: #3a2e17;
  --ok: #63c58a; --ok-soft: #173325; --warn: #e9a447; --warn-soft: #3a2b12; --bad: #f07a72; --bad-soft: #3d1b19;
  --info: #79aee0; --info-soft: #172a3c; --shadow: 0 1px 2px rgb(0 0 0 / .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.7 var(--font); }
h1, h2, h3 { line-height: 1.35; margin: 0; text-wrap: balance; }
h1 { font-size: 1.45rem; font-weight: 800; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.num, .qty, table td { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2.5px solid var(--brass); outline-offset: 2px; border-radius: 6px; }

/* ---------- boot / login */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter);
  background: radial-gradient(120% 60% at 50% 0%, var(--brand-soft), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.login-head { display: grid; justify-items: center; gap: 6px; text-align: center; margin-bottom: 6px; }
.login-head img { width: 64px; height: 64px; }
.login-head .org { color: var(--muted); font-size: .9rem; }
.login-note { color: var(--muted); font-size: .82rem; text-align: center; }

/* ---------- shell */
.shell { min-height: 100dvh; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px var(--gutter); background: var(--bar); color: var(--on-bar); }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: inherit; min-width: 0; flex: 1; }
.topbar .brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1.5px rgb(255 255 255 / .25); }
.topbar .brand b { display: block; font-size: 1.02rem; font-weight: 800; line-height: 1.2; }
.topbar .brand small { display: block; font-size: .72rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgb(255 255 255 / .12); }
.icon-btn svg { width: 24px; height: 24px; }
.badge-dot { position: absolute; top: 4px; left: 4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--brass); color: #1d1405; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }

.main { padding: 18px var(--gutter) calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); max-width: 1120px; margin-inline: auto; display: grid; gap: 18px; }
.main > * { min-width: 0; }

.bottomnav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--line); }
.bottomnav a, .bottomnav button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 9px; height: var(--nav-h);
  font-size: .72rem; color: var(--muted); border: 0; background: none; cursor: pointer; }
.bottomnav svg { width: 23px; height: 23px; }
.bottomnav .on { color: var(--brand); font-weight: 700; }
.bottomnav .plus span.fab { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -20px; border-radius: 15px;
  background: var(--brass); color: #1d1405; box-shadow: 0 6px 16px rgb(185 133 47 / .35); }
.sidebar { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .sidebar { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; border-inline-start: 0; border-inline-end: 1px solid var(--line);
    background: var(--surface); position: sticky; top: 62px; height: calc(100dvh - 62px); overflow-y: auto; }
  .sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink); }
  .sidebar a:hover { background: var(--surface-2); }
  .sidebar a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
  .sidebar svg { width: 20px; height: 20px; color: var(--muted); }
  .sidebar a.on svg { color: var(--brand); }
  .sidebar .sep { margin: 10px 12px 4px; font-size: .74rem; color: var(--muted); letter-spacing: .02em; }
  .sidebar .cta { margin: 4px 0 12px; justify-content: center; }
  .bottomnav { display: none; }
  .main { padding-bottom: 40px; width: 100%; }
}

/* ---------- page header */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: .88rem; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .88rem; justify-self: start; }
.back svg { width: 18px; height: 18px; }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card > h2 a { font-size: .82rem; font-weight: 500; }
.section { display: grid; gap: 10px; }
.section > h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section > h2 a { font-size: .82rem; font-weight: 500; }
.grid-2 { display: grid; gap: 18px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.empty { color: var(--muted); font-size: .9rem; padding: 18px 8px; text-align: center; }

/* stat strip on the dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.stat { display: grid; gap: 2px; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.stat b { font-size: 1.5rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat.alert { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.stat.alert b { color: var(--bad); }
.stat.warn b { color: var(--warn); }

/* rows */
.list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); color: var(--ink); min-width: 0; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; display: block; overflow-wrap: anywhere; }
.row .meta { color: var(--muted); font-size: .8rem; display: block; overflow-wrap: anywhere; }
.row .end { text-align: left; flex-shrink: 0; display: grid; justify-items: end; gap: 3px; }
.qty { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.qty small { font-weight: 500; font-size: .76rem; color: var(--muted); margin-inline-start: 3px; }
.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex-shrink: 0;
  display: grid; place-items: center; color: var(--muted); }
.thumb svg { width: 22px; height: 22px; }

/* item cards in the catalogue */
.items { display: grid; gap: 10px; }
@media (min-width: 760px) { .items { grid-template-columns: 1fr 1fr; } }
.item-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); min-width: 0; }
.item-card:hover { border-color: var(--brand); }

/* warehouse tiles */
.wh-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.wh { display: grid; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.wh:hover { border-color: var(--brand); }
.wh b { font-size: 1rem; }
.wh .meta { color: var(--muted); font-size: .8rem; }
.wh .pills { display: flex; flex-wrap: wrap; gap: 4px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700;
  white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.brass { background: var(--brass-soft); color: var(--brass); }
.delta-in { color: var(--ok); } .delta-out { color: var(--bad); } .delta-adj { color: var(--info); }

/* item detail */
.item-hero { display: grid; gap: 14px; }
@media (min-width: 760px) { .item-hero { grid-template-columns: 220px 1fr; align-items: start; } }
.item-photo { aspect-ratio: 1; max-width: 100%; width: 100%; border-radius: var(--r); object-fit: cover; background: var(--surface-2);
  display: grid; place-items: center; color: var(--muted); }
.item-photo svg { width: 48px; height: 48px; }
@media (max-width: 759px) { .item-photo.noimg { display: none; } }
.stock { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stock div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.stock div.main-stock { background: var(--brand-soft); }
.stock b { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stock div.main-stock b { color: var(--brand); font-size: 1.7rem; }
.stock span { font-size: .76rem; color: var(--muted); }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.action { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 700; font-size: .86rem; }
.action svg { width: 24px; height: 24px; }
.action.in svg { color: var(--ok); } .action.out svg { color: var(--bad); } .action.loan svg { color: var(--warn); }
.action.transfer svg { color: var(--info); } .action.adjust svg { color: var(--muted); }
.action:hover { border-color: var(--brand); }
dl.specs { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .9rem; }
dl.specs dt { color: var(--muted); }
dl.specs dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- forms */
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .field > .label { font-size: .85rem; font-weight: 700; }
.field .hint { font-size: .76rem; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); outline: none; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.ltr { direction: ltr; text-align: right; }
.with-unit { display: flex; align-items: stretch; }
.with-unit .input { border-start-end-radius: 0; border-end-end-radius: 0; font-size: 1.25rem; font-weight: 700; }
.with-unit span { display: grid; place-items: center; padding: 0 14px; border: 1.5px solid var(--line); border-inline-start: 0;
  border-radius: 0 10px 10px 0; border-start-start-radius: 0; border-end-start-radius: 0; border-start-end-radius: 10px; border-end-end-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-size: .88rem; white-space: nowrap; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: .86rem; }
.chip.on, .chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .92rem; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.checks { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
details.more summary { cursor: pointer; color: var(--brand); font-size: .88rem; font-weight: 700; padding: 4px 0; }
details.more[open] summary { margin-bottom: 10px; }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 8px 12px; border-radius: 10px; font-size: .88rem; }
.callout { padding: 10px 12px; border-radius: 10px; background: var(--brass-soft); color: var(--ink); font-size: .86rem; }
.callout.info { background: var(--info-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 11px;
  border: 1.5px solid transparent; background: var(--brand); color: var(--on-brand); font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-2); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.brass { background: var(--brass); color: #1d1405; }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: .84rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* filter bar */
.filters { display: grid; gap: 8px; }
.searchbox { position: relative; }
.searchbox svg { position: absolute; inset-inline-start: 12px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.searchbox .input { padding-inline-start: 40px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-row select.input { width: auto; min-height: 38px; padding: 4px 10px; font-size: .86rem; flex-shrink: 0; }
.filter-row .chip { flex-shrink: 0; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; }
.tabs a, .tabs button { flex: 1; text-align: center; padding: 7px 12px; border-radius: 9px; color: var(--muted); border: 0; background: none;
  cursor: pointer; white-space: nowrap; font-size: .88rem; }
.tabs .on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }

/* ---------- sheet (bottom drawer on phones, dialog on desktop) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(8 20 18 / .45); display: grid; align-items: end; justify-items: center;
  animation: fade .15s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 8px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px)); animation: rise .2s ease-out; }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head .icon-btn { color: var(--muted); }
.sheet-head .icon-btn:hover { background: var(--surface-2); }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 18px; }
  .sheet::before { display: none; }
}
@keyframes rise { from { transform: translateY(24px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }

/* toasts */
#toasts { position: fixed; z-index: 80; inset-inline: 0; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding-inline: var(--gutter); }
.toast { pointer-events: auto; max-width: 480px; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: .9rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / .2); display: flex; gap: 12px; align-items: center; }
.toast.err { background: var(--bad); color: #fff; }
.toast a { color: var(--brass); font-weight: 700; }
@media (min-width: 960px) { #toasts { bottom: 24px; } }

/* tables (reports) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .84rem; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--surface-2); font-weight: 700; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }

/* notifications */
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 12px; color: var(--ink); align-items: flex-start; }
.notif.unread { background: var(--brand-soft); }
.notif .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); }
.notif .ico svg { width: 20px; height: 20px; }
.notif .ico.bad { background: var(--bad-soft); color: var(--bad); }
.notif .ico.warn { background: var(--warn-soft); color: var(--warn); }
.notif .ico.info { background: var(--info-soft); color: var(--info); }
.notif .ico.ok { background: var(--ok-soft); color: var(--ok); }
.notif .when { font-size: .74rem; color: var(--muted); }

.announce { border-inline-start: 4px solid var(--brass); }
.announce .body { white-space: pre-line; margin-top: 6px; }
.announce .meta { color: var(--muted); font-size: .78rem; margin-top: 8px; }

.more-menu { display: grid; gap: 2px; }
.more-menu a, .more-menu button { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-radius: 10px; color: var(--ink);
  background: none; border: 0; cursor: pointer; text-align: right; width: 100%; }
.more-menu a:hover, .more-menu button:hover { background: var(--surface-2); }
.more-menu svg { width: 22px; height: 22px; color: var(--brand); }


/* ---------- public landing (login + equipment request) */
.public { min-height: 100dvh; background: radial-gradient(120% 50% at 50% 0%, var(--brand-soft), transparent 70%), var(--bg); }
.public-head { display: flex; align-items: center; gap: 12px; padding: 16px var(--gutter); max-width: 1000px; margin-inline: auto; }
.public-head img { width: 48px; height: 48px; }
.public-head b { display: block; font-size: 1.1rem; font-weight: 800; }
.public-head small { color: var(--muted); }
.public-main { display: grid; gap: 16px; padding: 8px var(--gutter) 40px; max-width: 1000px; margin-inline: auto; }
.gate { display: grid; gap: 16px; align-items: start; }
@media (min-width: 760px) { .gate { grid-template-columns: 1fr 1fr; } }
.gate h1, .gate h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; }
.gate h1 svg, .gate h2 svg { width: 24px; height: 24px; color: var(--brand); }
.gate-request { display: grid; gap: 12px; border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }
.gate-request p { color: var(--muted); font-size: .92rem; }
.login-note { color: var(--muted); font-size: .8rem; text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.done-card { display: grid; gap: 10px; text-align: center; justify-items: center; }
.done-card h1 { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.done-card h1 svg { width: 28px; height: 28px; }
.tracking { font-size: 2.2rem; font-weight: 800; letter-spacing: .12em; color: var(--brand); }

/* ---------- long forms */
fieldset.card { margin: 0; min-width: 0; }
fieldset legend { font-weight: 800; font-size: 1rem; padding: 0 6px; color: var(--brand); }
.perm-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom, 0px)); z-index: 5; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
@media (min-width: 960px) { .sticky-actions { bottom: 12px; } }
.custom-row .icon-btn { color: var(--muted); flex-shrink: 0; }
.photo-row { display: flex; gap: 10px; align-items: center; }
.photo-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.gallery figure { margin: 0; display: grid; gap: 4px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.gallery figcaption { font-size: .78rem; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--brand); cursor: pointer; font-size: .78rem; padding: 0; }
.danger-text { color: var(--bad) !important; }

/* ---------- exit item picker */
.picked { display: grid; gap: 8px; }
.picked-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1.5px solid var(--brand); background: var(--brand-soft); border-radius: 12px; }
.picked-row .grow { flex: 1; min-width: 0; display: grid; }
.picked-row .icon-btn { color: var(--muted); flex-shrink: 0; width: 34px; }
.picked-row .meta { color: var(--muted); font-size: .78rem; }
.qty-in { width: 128px; flex-shrink: 0; }
.qty-in .input { font-size: 1rem; min-height: 40px; }
.pick-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0 8px; }
.row.pick { cursor: pointer; }
.row.pick input { width: 22px; height: 22px; accent-color: var(--brand); flex-shrink: 0; }

/* ---------- exit / ticket detail */
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.timeline .meta { color: var(--muted); font-size: .78rem; }
.ev-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.ev-ico svg { width: 17px; height: 17px; }
.timeline li.ok .ev-ico { background: var(--ok-soft); color: var(--ok); }
.timeline li.info .ev-ico { background: var(--info-soft); color: var(--info); }
.timeline li.warn .ev-ico { background: var(--warn-soft); color: var(--warn); }
.timeline li.brand .ev-ico { background: var(--brand-soft); color: var(--brand); }
.ready-card { border: 2px solid var(--ok); }
.ready-card h2 { display: flex; gap: 8px; align-items: center; color: var(--ok); }
.ready-card h2 svg { width: 22px; height: 22px; }
ul.plain { margin: 0; padding-inline-start: 18px; }

/* ---------- receipt (printable) */
.receipt { background: #fff; color: #111; border: 1px solid #ccc; border-radius: 6px; padding: 28px; max-width: 720px; width: 100%; margin-inline: auto; }
.receipt header { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 2px solid #0e5f57; padding-bottom: 12px; margin-bottom: 16px; }
.receipt header .org { display: flex; gap: 10px; align-items: center; }
.receipt header img { width: 48px; height: 48px; }
.receipt header small { display: block; color: #555; }
.receipt h1 { font-size: 1.25rem; }
.receipt table { font-size: .92rem; }
.receipt th, .receipt td { white-space: normal; border: 1px solid #ccc; color: #111; }
.receipt th { background: #f1f4f2; width: 30%; position: static; }
.receipt .sign { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 36px; text-align: center; font-size: .85rem; }
.receipt .sign div { border-top: 1px dashed #888; padding-top: 8px; min-height: 60px; }
.print-title { display: none; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #111; font-size: 12px; }
  .topbar, .sidebar, .bottomnav, .no-print, .sticky-actions, .actions-bar, #toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .card, .table-wrap { box-shadow: none; border-color: #bbb; background: #fff; color: #111; }
  .receipt { border: 0; padding: 0; }
  .print-title { display: block; margin-bottom: 8px; }
  th { background: #eee !important; color: #111; }
  td { color: #111; }
  table { font-size: 10px; }
  th, td { white-space: normal; }
}

/* رابط ساده: کارهای اصلی در دسترس، اطلاعات تکمیلی جمع‌شونده. */
.required-label { font-size: .67rem; color: var(--brand); background: var(--brand-soft); padding: 2px 6px; border-radius: 5px; margin-inline-start: 8px; font-weight: 400; }
.start-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 18px 0 24px; }
.start-card { display: flex; align-items: center; gap: 14px; padding: 24px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); min-height: 124px; }
.start-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.start-card b { display: block; font-size: 1.05rem; margin-bottom: 8px; }
.start-card small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.9; }
.start-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.start-card > svg { width: 18px; height: 18px; margin-inline-start: auto; flex-shrink: 0; }
.simple-status { display: flex; flex-wrap: wrap; gap: 12px; }
.simple-status a { padding: 12px 16px; background: var(--surface-2); border-radius: 10px; color: var(--ink); }
.simple-status b { color: var(--brand); font-size: 1.15rem; margin-inline-end: 8px; }
.optional-block { border: 1px solid var(--line); border-radius: 14px; margin: 14px 0; background: var(--surface); }
.optional-block > summary { cursor: pointer; padding: 18px 20px; font-weight: 600; color: var(--brand); }
.optional-content { padding: 0 18px 18px; }
.item-optional .card { box-shadow: none; border-radius: 10px; }
.simple-item-basic { max-width: 760px; }
#itemf > .optional-block { max-width: 760px; }
.filter-details { margin-top: 6px; }
.form-error { line-height: 2; }
.field label { display: block; }
@media (min-width: 960px) { .sidebar { gap: 9px; padding-top: 24px; } .sidebar a { padding: 14px 12px; } }
@media (max-width: 600px) { .start-grid { grid-template-columns: 1fr; gap: 10px; } .start-card { min-height: 94px; padding: 18px 16px; } .simple-status { gap: 8px; } .simple-status a { flex: 1 1 100%; } .optional-block > summary { padding: 16px; } }
@media print { .start-grid { display: none; } }
