@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F2F3F0;
  --surface: #FFFFFF;
  --ink: #15202B;
  --ink-2: #4A5561;
  --ink-3: #6B7682;
  --line: #DCE0E3;
  --line-2: #ECEEEF;
  --brand: #1F4E6B;
  --brand-2: #173C53;
  --brand-soft: #E3EDF3;
  --item: #2563A8;  --item-soft: #E1ECF8;
  --svc: #B45309;   --svc-soft: #FCEBD7;
  --f1-bg: #FBE3F4; --f1-line: #E3A3D3; --f1: #8A1F6E;
  --f2-bg: #E5EFD7; --f2-line: #AFC98A; --f2: #3F5E17;
  --danger: #B42318; --danger-soft: #FDECEA;
  --warn: #8A5300;  --warn-soft: #FCEFC9;
  --ok: #1E7A45;    --ok-soft: #DDF1E4;
  --new: #6D28D9;   --new-soft: #EDE5FB;
  --st-assigned: #6D4C9F; --st-assigned-bg: #EEE8F7;
  --st-in_progress: #1D5F9E; --st-in_progress-bg: #E1ECF8;
  --st-purchased: #1E7A45; --st-purchased-bg: #DDF1E4;
  --st-delivered: #35603F; --st-delivered-bg: #E3EEE5;
  --st-cancelled: #6B7280; --st-cancelled-bg: #ECEDEF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.6; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--brand); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 15px; height: 15px; }
.wrap { max-width: 780px; margin: 0 auto; }

/* ---------- buttons ---------- */
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.iconbtn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: inherit;
  display: grid; place-items: center; cursor: pointer; position: relative; }
.badge-dot { position: absolute; top: 6px; inset-inline-end: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--brand); }
.login form { width: 100%; max-width: 360px; background: var(--surface); border-radius: 20px; padding: 28px 22px;
  display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login h1 { margin: 0; font-size: 22px; }
.login p { margin: 0; }
.mark { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: var(--brand); color: #fff;
  display: grid; place-items: center; }
.mark svg { width: 30px; height: 30px; }
.field input, .field select, .field textarea, input.inp, select.inp, textarea.inp {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px;
  background: var(--surface); outline: none;
}
textarea.inp, .field textarea { padding: 10px 12px; min-height: 80px; resize: vertical; }
.inp:focus, .field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.err { color: var(--danger); min-height: 1.4em; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 600; }

/* ---------- header & tabs ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff;
  padding: 10px 16px 0; padding-top: calc(10px + env(safe-area-inset-top)); }
.top-row { display: flex; align-items: center; gap: 8px; }
.top-row h1 { margin: 0; font-size: 19px; font-weight: 800; flex: 1; min-width: 0; }
.top-row .sub { font-size: 12px; opacity: .85; font-weight: 500; display: block; }
.search { margin-top: 8px; display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px;
  padding: 0 12px; color: var(--ink-2); }
.search input { flex: 1; border: 0; outline: 0; min-height: 44px; background: transparent; color: var(--ink); }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 8px -16px 0; padding: 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; color: rgba(255,255,255,.8);
  text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.on { color: #fff; border-bottom-color: #fff; }
.tab .cnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: rgba(255,255,255,.2);
  font-size: 11px; display: grid; place-items: center; }
.tab .cnt.red { background: var(--danger); }
.subtop { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; display: flex; align-items: center;
  gap: 6px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); }
.subtop .back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; border: 0; background: transparent;
  color: #fff; font-weight: 700; cursor: pointer; padding: 0 6px; }
.subtop h1 { font-size: 16px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- filters ---------- */
.filters { padding: 10px 16px 2px; display: flex; flex-direction: column; gap: 8px; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.toolrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolrow .grow { flex: 1; }
.combos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.combos select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 6px; font-size: 13px; }
.combos select.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.chip.c-f1:not(.on) { background: var(--f1-bg); border-color: var(--f1-line); color: var(--f1); }
.chip.c-f2:not(.on) { background: var(--f2-bg); border-color: var(--f2-line); color: var(--f2); }
.chip.c-new:not(.on) { background: var(--new-soft); border-color: #CDB8F5; color: var(--new); }
.chip.c-red:not(.on) { color: var(--danger); }
.active-bar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; padding-inline-start: 10px; }
.active-bar .txt { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); border-radius: 8px;
  padding: 2px 8px; font-weight: 700; border: 0; cursor: pointer; font-size: 12.5px; }
.count-line { padding: 4px 16px 0; font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; }

/* ---------- cards ---------- */
.list { padding: 8px 16px 120px; display: flex; flex-direction: column; gap: 8px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px 10px 12px; padding-inline-start: 16px; box-shadow: var(--shadow); cursor: pointer; overflow: hidden; }
.card::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--item); }
.card.svc::before { background: var(--svc); }
.card.f1 { background: var(--f1-bg); border-color: var(--f1-line); }
.card.f2 { background: var(--f2-bg); border-color: var(--f2-line); }
.card.sel { outline: 3px solid var(--brand); outline-offset: -1px; }
.card.cancelled { opacity: .7; }
.card .c-head { padding-inline-end: 92px; }
.flags { position: absolute; top: 8px; inset-inline-end: 8px; display: flex; gap: 5px; }
.panel { scroll-margin-top: 72px; }
.c-head { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12.5px; }
.num { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 22px; }
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 6px; font-weight: 700; font-size: 12px;
  border: 0; cursor: pointer; line-height: 1.7; white-space: nowrap; }
.tag.item { background: var(--item-soft); color: var(--item); }
.tag.svc { background: var(--svc-soft); color: var(--svc); }
.tag.code { background: var(--line-2); color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.tag.code.rep { background: var(--danger); color: #fff; }
.tag.new { background: var(--new); color: #fff; }
.tag.urgent { background: var(--danger); color: #fff; }
.tag.overdue { background: var(--danger-soft); color: var(--danger); }
.tag.creq { background: var(--warn-soft); color: var(--warn); }
.tag.st-assigned { background: var(--st-assigned-bg); color: var(--st-assigned); }
.tag.st-in_progress { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.tag.st-purchased { background: var(--st-purchased-bg); color: var(--st-purchased); }
.tag.st-delivered { background: var(--st-delivered-bg); color: var(--st-delivered); }
.tag.st-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.tag.st-none { background: transparent; color: var(--ink-3); border: 1px dashed var(--line); }
.sp { flex: 1; }
.fbtn { min-width: 40px; height: 32px; border-radius: 9px; font-size: 12px; font-weight: 800; cursor: pointer; padding: 0 8px; }
.fbtn.f1 { border: 1.5px solid var(--f1-line); background: transparent; color: var(--f1); }
.fbtn.f2 { border: 1.5px solid var(--f2-line); background: transparent; color: var(--f2); }
.fbtn.f1.on { background: var(--f1); border-color: var(--f1); color: #fff; }
.fbtn.f2.on { background: var(--f2); border-color: var(--f2); color: #fff; }
.desc { margin: 4px 0 2px; font-weight: 700; font-size: 15px; line-height: 1.55; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 4px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.lnk { border: 0; background: transparent; padding: 2px 5px; border-radius: 6px; cursor: pointer; color: var(--ink-2);
  font-size: 12.5px; display: inline-flex; align-items: center; gap: 3px; }
.lnk:hover, .lnk.on { background: var(--brand-soft); color: var(--brand); }
.lnk b { color: var(--ink); font-weight: 600; }
.remarks { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.c-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.hbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--brand); }
.hbtn:disabled { color: var(--ink-3); opacity: .55; cursor: default; }
.notep { font-size: 12px; color: var(--ink-2); background: rgba(255,255,255,.7); border: 1px dashed var(--line); border-radius: 8px;
  padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--ink-3); display: inline-grid; place-items: center; flex: none; background: var(--surface); }
.chk.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chk svg { width: 14px; height: 14px; stroke-width: 3; }
.more { height: 40px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty p { margin: 4px 0; }
.sec-title { padding: 14px 16px 2px; font-weight: 800; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }

/* doc cards */
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; box-shadow: var(--shadow); }
.dcard h3 { margin: 0; font-size: 15px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bars { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line-2); margin-top: 8px; }
.bars span { display: block; height: 100%; }

/* ---------- pages ---------- */
.page { padding: 12px 16px 120px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel h2 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.panel.f1 { background: var(--f1-bg); border-color: var(--f1-line); }
.panel.f2 { background: var(--f2-bg); border-color: var(--f2-line); }
.d-title { margin: 0; font-size: 18px; line-height: 1.6; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
.kv > div { padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; overflow-wrap: anywhere; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--ink-2); font-size: 12.5px; padding-inline-end: 8px; direction: ltr; text-align: right; }
.kv .v { font-weight: 600; unicode-bidi: plaintext; text-align: right; }
.kv .v.e { color: #9AA3AC; font-weight: 400; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.toggle { min-height: 46px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); display: flex; align-items: center;
  justify-content: center; gap: 8px; font-weight: 800; cursor: pointer; }
.toggle.t1 { color: var(--f1); } .toggle.t2 { color: var(--f2); }
.toggle.t1.on { background: var(--f1); border-color: var(--f1); color: #fff; }
.toggle.t2.on { background: var(--f2); border-color: var(--f2); color: #fff; }
.state { font-size: 13px; color: var(--ink-2); flex: 1; }
.state.ok { color: var(--ok); } .state.bad { color: var(--danger); }
.row { display: flex; align-items: center; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.stat .l { font-size: 12px; color: var(--ink-2); }
.stat .n { font-size: 15px; font-weight: 800; }
.stat .n small { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.up { color: var(--danger); } .down { color: var(--ok); }
.tbl-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.tbl th, .tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
.tbl th { font-size: 12px; color: var(--ink-2); font-weight: 700; position: sticky; top: 0; background: var(--surface); }
.tbl td.num-c { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.assign-box { background: var(--bg); border-radius: 10px; padding: 10px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.photos { display: flex; gap: 6px; flex-wrap: wrap; }
.photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid var(--line); }
.timeline { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.timeline div { display: flex; gap: 8px; }
.timeline .t { color: var(--ink-3); font-size: 12px; min-width: 92px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.msg { max-width: 86%; background: var(--bg); border-radius: 12px; padding: 7px 10px; align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--brand-soft); }
.msg .who { font-size: 12px; font-weight: 700; color: var(--brand); display: flex; justify-content: space-between; gap: 10px; }
.msg .who span { color: var(--ink-3); font-weight: 500; }
.msg .tx { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg .mention { color: var(--brand); font-weight: 700; }
.composer { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; position: relative; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: 0; }
.mention-pop { position: absolute; bottom: 100%; inset-inline-start: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); margin-bottom: 6px; max-height: 200px; overflow-y: auto; min-width: 200px; z-index: 5; }
.mention-pop button { display: block; width: 100%; text-align: start; border: 0; background: transparent; padding: 10px 14px; cursor: pointer; }
.mention-pop button:hover { background: var(--brand-soft); }
.pending-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pending-photos span { position: relative; }
.pending-photos img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }
.pending-photos button { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; cursor: pointer; font-size: 12px; }

/* notifications */
.notif { display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.notif.unread { border-color: var(--brand); background: #F5F9FC; }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; margin-top: 8px; flex: none; }
.notif.unread .dot { background: var(--brand); }
.notif.urgent.unread .dot { background: var(--danger); }
.notif .tx { white-space: pre-wrap; font-size: 13.5px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notif .t { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* reports */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; cursor: pointer; }
.tile .n { font-size: 22px; font-weight: 800; }
.tile .l { font-size: 12px; color: var(--ink-2); }
.tile.red .n { color: var(--danger); } .tile.new .n { color: var(--new); }
.alert { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.alert.high { background: var(--danger-soft); color: #7A1A12; }
.alert.mid { background: var(--warn-soft); color: #5E3A00; }
.alert.low { background: var(--brand-soft); color: var(--brand-2); }
.hbar { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.hbar .lab { width: 110px; flex: none; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { flex: 1; height: 14px; background: var(--line-2); border-radius: 4px; overflow: hidden; display: flex; }
.hbar .track span { display: block; height: 100%; }
.hbar .val { width: 64px; text-align: left; font-variant-numeric: tabular-nums; flex: none; }
.vchart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.vchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.vchart .bars2 { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.vchart .bars2 span { width: 30%; border-radius: 3px 3px 0 0; min-height: 2px; }
.vchart .x { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 4px; vertical-align: middle; }

/* sheets */
.sheet { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet-card h2 { margin: 0; font-size: 17px; }
.sheet-card p { margin: 0; }
.menu-item { min-height: 50px; border: 0; background: transparent; text-align: start; padding: 0 6px; cursor: pointer; font-size: 15.5px;
  border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.menu-item:last-child { border-bottom: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; }
.opt.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.opt.red.on { background: var(--danger); border-color: var(--danger); }
.btns2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checklist { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.checklist label { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-bottom: 1px solid var(--line-2); font-size: 14px; cursor: pointer; }
.checklist input { width: 18px; height: 18px; accent-color: var(--brand); }
.imgview { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 60; display: grid; place-items: center; }
.imgview img { max-width: 100%; max-height: 100%; }

/* selection bar */
.selbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: var(--brand-2); color: #fff;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.18); }
.selbar .in { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.selbar .r1 { display: flex; align-items: center; gap: 8px; }
.selbar .r1 b { flex: 1; }
.selbar .acts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.selbar .acts button { flex: none; min-height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; padding: 0 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }
.selbar .ghostw { border: 0; background: transparent; color: #fff; min-height: 36px; cursor: pointer; font-weight: 600; text-decoration: underline; }

.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #15202B;
  color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 80; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.selbar:not([hidden]) ~ .toast { bottom: 140px; }

.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.user-row:last-child { border-bottom: 0; }
.user-row .who { flex: 1; min-width: 160px; }
.user-row .who b { display: block; }
.st-pill { font-size: 12px; padding: 1px 8px; border-radius: 6px; font-weight: 700; }
.st-pill.pending { background: var(--warn-soft); color: var(--warn); }
.st-pill.active { background: var(--ok-soft); color: var(--ok); }
.st-pill.disabled, .st-pill.rejected { background: var(--line-2); color: var(--ink-2); }
.pw { font-family: ui-monospace, monospace; background: var(--bg); padding: 1px 8px; border-radius: 6px; direction: ltr; display: inline-block; }

/* ---------- compact card (v2) ---------- */
.card { padding: 8px 12px 8px 10px; padding-inline-start: 14px; }
.card::before { width: 4px; opacity: .75; }
.card.flagged { background: #FFF5F5; border-color: #F3C4C0; }
.card .r1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card .r1 .desc { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .who { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; max-width: 34%; overflow: hidden; text-overflow: ellipsis; }
.card .flag { width: 34px; height: 30px; border: 0; background: transparent; color: #C9CDD2; cursor: pointer; display: grid; place-items: center; border-radius: 8px; flex: none; }
.card .flag svg { width: 18px; height: 18px; }
.card .flag.on { color: var(--danger); }
.card .flag.on svg { fill: var(--danger); }
.card .r2 { display: flex; align-items: center; gap: 2px 6px; flex-wrap: wrap; margin-top: 3px; font-size: 12.5px; color: var(--ink-3); }
.card .qty { font-weight: 800; font-size: 15px; color: var(--ink); min-width: 28px; font-variant-numeric: tabular-nums; }
.card .code { direction: ltr; unicode-bidi: isolate; color: var(--ink-2); font-size: 12.5px; border: 0; background: transparent; padding: 0 2px; cursor: inherit; }
.card .code.rep { cursor: pointer; color: var(--danger); text-decoration: underline dotted; }
.card .lnk { padding: 1px 3px; color: var(--ink-3); font-size: 12.5px; }
.card .lnk.dt { cursor: default; }
.tg { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); border: 0; line-height: 1.8; cursor: default; }
button.tg { cursor: pointer; }
.tg.red { background: var(--danger); color: #fff; font-weight: 800; }
.card .exp { width: 30px; height: 28px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.card.open .exp svg { transform: rotate(180deg); }
.card .x-body { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink); }
.card .x-body > div > span:first-child { display: inline-block; min-width: 82px; color: var(--ink-3); font-size: 12px; }
.card .x-body .lnk { color: var(--brand); }
.list { gap: 6px; }

/* v2.1 */
.card { padding-block: 6px; }
.card .r1 .desc { font-size: 14px; }
.card .r2 { margin-top: 1px; flex-wrap: nowrap; overflow: hidden; }
.card .r2 > * { flex: none; }
.card .who { border: 0; background: transparent; cursor: pointer; font-size: 11.5px; color: var(--ink-2); font-weight: 600; max-width: 30%; padding: 0 2px; }
.card .qty { font-size: 17px; font-weight: 900; min-width: 0; padding-inline-start: 2px; }
.card .exp { width: 26px; height: 24px; }
.card .flag { height: 26px; }

.card .r2 .mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.card .r2 .mid > * { flex: none; }
.card .r2 .mid .who { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: none; }
.card .r2 .mid .tg { padding: 0 5px; font-size: 11px; }
.card .qty { min-width: 34px; text-align: left; }

.card .r1 .who { flex: 0 1 auto; max-width: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); }

.card .ribbon { position: absolute; top: 9px; left: -24px; width: 86px; transform: rotate(-45deg); background: #C62828;
  color: #fff; font-size: 10.5px; font-weight: 900; letter-spacing: .5px; text-align: center; line-height: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); pointer-events: none; z-index: 1; direction: ltr; }
.card.isnew .r1 { padding-inline-end: 26px; }
.card.isnew .r2 { padding-inline-end: 0; }
.card .code { color: var(--item); font-weight: 800; font-size: 13px; }
.card .code.rep { color: var(--item); text-decoration: none; }
.card .code.rep b { color: var(--danger); font-weight: 800; }
.card .ribbon { top: 7px; left: -21px; width: 72px; font-size: 9.5px; line-height: 15px; }
.card.isnew .r1 { padding-inline-end: 20px; }

/* compact filters */
.filters { gap: 6px; padding-top: 8px; }
.seg button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.sm#selBtn { min-height: 34px; }
.chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 30px; padding: 0 12px; font-size: 13px; flex: none; }
.chip.c-flag { color: var(--danger); padding: 0 10px; }
.chip.c-flag.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.chip.c-flag.on svg { fill: #fff; }
.chip.c-new:not(.on) { background: var(--surface); color: var(--ink); border-color: var(--line); }
.combos.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.combos.c4 select { min-height: 34px; font-size: 12.5px; padding: 0 4px; }

/* header v2 */
.top { padding-top: calc(6px + env(safe-area-inset-top)); }
.top-row { align-items: flex-start; }
.hinfo { flex: 1; min-width: 0; }
.hinfo h1 { font-size: 17px; line-height: 1.4; }
.hinfo .sub { display: block; font-size: 11.5px; opacity: .85; line-height: 1.5; }
.huser { display: flex; align-items: center; gap: 2px; }
.huser .uname { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.12);
  padding: 3px 9px; border-radius: 999px; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.iconbtn.sm { width: 38px; height: 38px; }
.search { margin-top: 6px; }
.search input { min-height: 40px; }
.tabs { margin-top: 4px; }
.tab { min-height: 40px; }
/* even tighter filters */
.filters { gap: 5px; padding: 6px 16px 0; }
.seg button { min-height: 30px; }
#selBtn { min-height: 32px !important; }
.chip { min-height: 28px; font-size: 12.5px; padding: 0 10px; }
.combos.c4 select { min-height: 32px; }
.count-line { padding-top: 6px; font-size: 13.5px; color: var(--ink); }
.count-line b { font-size: 15px; font-weight: 900; color: var(--brand); }

.toolrow .count-line { padding: 0 6px; font-size: 12.5px; color: var(--ink-2); }
.list { padding-top: 6px; }

.card .ribbon { background: #15803D; }
.card .ribbon.urgent { background: #C62828; font-size: 10.5px; direction: rtl; }

/* item page v2 */
.ipage { gap: 10px; padding-bottom: 110px; }
.sumcard { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; padding-inline-start: 16px; display: flex; flex-direction: column; gap: 6px; }
.sumcard::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--item); opacity: .75; }
.sumcard.svc::before { background: var(--svc); }
.sumcard.flagged { background: #FFF5F5; border-color: #F3C4C0; }
.sumcard .ribbon { position: absolute; top: 9px; left: -22px; width: 78px; transform: rotate(-45deg); background: #15803D; color: #fff; font-size: 10px;
  font-weight: 900; text-align: center; line-height: 16px; }
.sumcard .ribbon.urgent { background: #C62828; }
.sumcard .s-top { display: flex; gap: 8px; align-items: flex-start; padding-inline-end: 18px; }
.sumcard h1 { margin: 0; font-size: 16.5px; line-height: 1.6; flex: 1; }
.flag.big { width: 40px; height: 36px; border: 0; background: transparent; color: #C9CDD2; cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.flag.big svg { width: 22px; height: 22px; }
.flag.big.on { color: var(--danger); } .flag.big.on svg { fill: var(--danger); }
.sumcard .s-mid { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.code-b { direction: ltr; unicode-bidi: isolate; color: var(--item); font-weight: 800; font-size: 15px; }
.qty-b { font-size: 22px; font-weight: 900; }
.qty-b small { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sumcard .s-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.sumcard .s-meta a { color: var(--brand); text-decoration: none; }
.sumcard .s-note { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.step { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.step.on { background: var(--brand); border-color: var(--brand); color: #fff; opacity: 1; cursor: default; }
.mynote { text-align: start; border: 1px dashed var(--line); background: transparent; border-radius: 10px; padding: 7px 10px; font-size: 13px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itabs { display: flex; gap: 4px; background: var(--line-2); border-radius: 12px; padding: 3px; position: sticky; top: 60px; z-index: 5; overflow-x: auto; }
.itab { flex: 1; min-height: 36px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; padding: 0 8px; }
.itab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kpis > div { background: var(--bg); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; min-width: 0; }
.kpis span { font-size: 11px; color: var(--ink-3); }
.kpis b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis b.sm { font-size: 12px; }
.kpis small { font-size: 10.5px; color: var(--ink-3); }
.more-stats { margin-top: 8px; font-size: 13px; }
.more-stats summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.kv2 { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin-top: 6px; }
.kv2 span { color: var(--ink-3); font-size: 12px; }
.kv2 b { font-weight: 600; unicode-bidi: plaintext; text-align: right; overflow-wrap: anywhere; }
.actbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.actbar .in { max-width: 780px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.actbar .btn { min-height: 44px; }
@media (max-width: 420px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.actbar .btn { white-space: nowrap; padding: 0 10px; }

.steps.s4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.steps.s4 .step { min-height: 40px; font-size: 12px; padding: 0 2px; color: var(--ink-3); background: var(--bg); border-color: transparent; }
.step.st-assigned.on { background: var(--st-assigned); color: #fff; }
.step.st-in_progress.on { background: var(--st-in_progress); color: #fff; }
.step.st-purchased.on { background: var(--st-purchased); color: #fff; }
.step.st-cancelled.on { background: #6B7280; color: #fff; }

.chain { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.chain .c-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chain .c-elb { color: var(--ink-3); }
.chain .c-arr { color: var(--brand); font-weight: 800; }
.chain .c-adm { font-size: 10.5px; background: var(--brand); color: #fff; border-radius: 5px; padding: 0 5px; }
.chain .c-t { color: var(--ink-3); font-size: 11px; margin-inline-start: auto; }
.chain .c-note { width: 100%; color: var(--ink-2); font-size: 12px; padding-inline-start: 14px; }
.steps.locked .step { opacity: .55; cursor: not-allowed; }
.steps.locked .step.on { opacity: .8; }
.lockmsg { font-size: 12px; color: var(--ink-2); background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; }

.tree { display: flex; flex-direction: column; align-items: stretch; padding: 4px 0; }
.t-node { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px; font-size: 13px; }
.t-node.adm { border-color: #B9CCDA; background: var(--brand-soft); }
.t-node.final { background: var(--st-purchased-bg); border: 2px solid var(--st-purchased); }
.t-node.final b { color: var(--st-purchased); }
.t-tag { font-size: 10.5px; background: var(--brand); color: #fff; border-radius: 5px; padding: 0 6px; }
.t-tag.fin { background: var(--st-purchased); }
.t-lbl { font-size: 11.5px; color: var(--ink-3); }
.t-at { margin-inline-start: auto; font-size: 11px; color: var(--ink-3); }
.t-edge { display: flex; align-items: center; gap: 8px; min-height: 26px; padding-inline-start: 22px; position: relative; }
.t-line { width: 2px; align-self: stretch; background: var(--ink-3); position: relative; min-height: 26px; }
.t-line::after { content: ""; position: absolute; bottom: -1px; left: -4px; border: 5px solid transparent; border-top: 6px solid var(--ink-3); border-bottom: 0; }
.t-note { font-size: 12px; color: var(--ink-2); }
.tree { padding: 0; }
.t-node { padding: 3px 8px; font-size: 12px; border-radius: 8px; gap: 4px; }
.t-node.final { border-width: 1.5px; }
.t-tag { font-size: 9.5px; padding: 0 4px; }
.t-lbl { font-size: 10.5px; }
.t-at { font-size: 10px; }
.t-edge { min-height: 16px; padding-inline-start: 18px; gap: 6px; }
.t-line { min-height: 16px; width: 1.5px; }
.t-line::after { border-width: 4px; border-top-width: 5px; left: -3.5px; }
.t-note { font-size: 11px; color: var(--ink-3); }

.tree { align-items: flex-start; }
.t-node { display: inline-flex; width: auto; max-width: 100%; }
.t-at { margin-inline-start: 6px; }

.flow { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: start; margin-top: 4px; }
.steps.vert { grid-template-columns: 1fr; gap: 4px; margin: 0; }
.steps.vert .step { min-height: 32px; font-size: 12px; border-radius: 8px; }
.flow .tree { align-items: flex-end; }
.flow .t-edge { padding-inline-start: 0; padding-inline-end: 18px; flex-direction: row-reverse; }
.flow .tree.empty { align-self: center; text-align: left; }

/* telegram-like chat */
#tabBody:has(.tg-chat) { padding: 0; overflow: hidden; }
.tg-chat { background: #CFDCE6 linear-gradient(160deg, #D8E4C9 0%, #C6D9E5 55%, #CBD3EA 100%); padding: 10px 8px 6px; min-height: 280px; max-height: 60vh;
  overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.tg-empty { margin: auto; background: rgba(0,0,0,.18); color: #fff; padding: 6px 14px; border-radius: 14px; font-size: 13px; }
.tg-day { display: flex; justify-content: center; margin: 8px 0 6px; position: sticky; top: 0; z-index: 1; }
.tg-day span { background: rgba(60,80,95,.35); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 12px; }
.tg-row { display: flex; align-items: flex-end; gap: 6px; justify-content: flex-end; }
.tg-row.me { justify-content: flex-start; }
.tg-row.last { margin-bottom: 6px; }
.tg-av { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; order: 2; }
.tg-b { position: relative; max-width: 78%; background: #fff; border-radius: 14px; padding: 5px 9px 4px; box-shadow: 0 1px 1px rgba(0,0,0,.12);
  font-size: 14.5px; line-height: 1.55; }
.tg-row.me .tg-b { background: #EEFFDE; }
.tg-row:not(.me).last .tg-b { border-bottom-left-radius: 4px; }
.tg-row.me.last .tg-b { border-bottom-right-radius: 4px; }
.tg-name { font-size: 12.5px; font-weight: 700; margin-bottom: 1px; }
.tg-tx { white-space: pre-wrap; overflow-wrap: anywhere; }
.tg-tx .mention { color: #3390EC; font-weight: 600; }
.tg-meta { float: left; margin: 6px 10px 0 0; font-size: 11px; color: #8A9AA6; line-height: 1; white-space: nowrap; direction: ltr; }
.tg-row.me .tg-meta { color: #5DAE5C; }
.tg-ck { letter-spacing: -3px; }
.tg-ph { display: flex; flex-wrap: wrap; gap: 3px; margin: 0 -5px 4px; }
.tg-ph img { width: 100%; max-width: 240px; max-height: 260px; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.tg-comp { background: #fff; padding: 6px 8px; margin: 0; align-items: flex-end; gap: 6px; border-top: 1px solid var(--line); }
.tg-field { flex: 1; display: flex; align-items: flex-end; background: #F1F3F4; border-radius: 22px; padding: 0 6px 0 4px; }
.tg-field textarea { flex: 1; border: 0; background: transparent; outline: 0; resize: none; min-height: 40px; max-height: 140px; padding: 9px 8px; font: inherit; font-size: 15px; }
.tg-att { width: 36px; height: 40px; display: grid; place-items: center; color: #8A9AA6; cursor: pointer; }
.tg-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #3390EC; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.tg-send svg { width: 20px; height: 20px; transform: scaleX(-1); }
.tg-comp .mention-pop { bottom: 100%; }
.tg-chat { background: var(--bg); }
.tg-day span { background: rgba(0,0,0,.12); color: var(--ink-2); }
.tg-b { box-shadow: 0 1px 1px rgba(0,0,0,.08); border: 1px solid var(--line-2); }
.tg-row.me .tg-b { border-color: #D6F0C2; }
/* reply quote / reply bar / bubble menu */
.tg-b { position: relative; transition: transform .15s; }
.tg-q { display: flex; flex-direction: column; border-inline-start: 3px solid var(--qc, #3390EC); background: rgba(51,144,236,.08);
  border-radius: 6px; padding: 3px 8px; margin: 2px 0 4px; font-size: 12px; cursor: pointer; max-width: 100%; }
.tg-row.me .tg-q { background: rgba(76,175,80,.12); --qc: #4CAF50; }
.tg-q b { color: var(--qc, #3390EC); font-weight: 700; }
.tg-q span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-reply { display: flex; align-items: center; gap: 8px; background: var(--card); border-top: 1px solid var(--line-2);
  padding: 6px 10px; }
.tg-reply[hidden] { display: none; }
.tg-rq { flex: 1; min-width: 0; display: flex; flex-direction: column; border-inline-start: 3px solid #3390EC; padding-inline-start: 8px; font-size: 12px; }
.tg-rq b { color: #3390EC; }
.tg-rq span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-reply button { border: 0; background: none; font-size: 16px; color: var(--ink-3); padding: 4px 6px; cursor: pointer; }
.tg-menu { position: absolute; top: 100%; inset-inline-start: 0; z-index: 5; margin-top: 4px; background: var(--card);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.14); display: flex; flex-direction: column; min-width: 110px; overflow: hidden; }
.tg-menu button { border: 0; background: none; text-align: start; padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.tg-menu button + button { border-top: 1px solid var(--line-2); }
.tg-hl { animation: tghl 1.2s; }
@keyframes tghl { 0%,60% { box-shadow: 0 0 0 3px rgba(51,144,236,.45); } 100% { box-shadow: none; } }
.tg-field { padding-inline-end: 12px; }
/* "show more" for long lists */
[data-lim] { display: none !important; }
.lim-btn { display: block; width: 100%; border: 1px dashed var(--line); background: var(--card); color: #1E6FD9; font: inherit;
  font-size: 13px; font-weight: 600; padding: 8px; border-radius: 10px; cursor: pointer; margin: 6px 0; }
.lim-btn small { color: var(--ink-3); font-weight: 400; }
.tg-chat .lim-btn { width: auto; margin: 4px auto 8px; padding: 5px 14px; border-radius: 999px; border: 0; background: rgba(0,0,0,.08); color: var(--ink-2); font-size: 12px; }
.tbl .lim-row td { padding: 0; background: none; }
.tbl .lim-row .lim-btn { margin: 4px 0; border-radius: 6px; }
.timeline .lim-btn { margin: 0 0 6px; }
.tg-it .tg-day { display: none; }
.tg-it.dayf .tg-day { display: flex; }
.kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 4px; }
.kpis small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsec { font-weight: 800; font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.dsec:first-child { margin-top: 0; }
.kv2 a.doclink { color: #1E6FD9; font-weight: 700; text-decoration: none; text-align: right; }
.dsec + .kv2 { grid-template-columns: 100px 1fr; }
/* long-press selection */
.card[data-id] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.card.pressing { transform: scale(.985); transition: transform .45s ease, background-color .45s; background-color: #EEF4FF; }
/* selection bar — same look as the item page bottom bar */
.selbar { background: var(--surface); color: var(--ink); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); }
.selbar .in { gap: 6px; }
.selbar .r1 { gap: 6px; font-size: 14px; }
.selbar .r1 b { color: var(--brand-2); }
.selbar .xbtn { border: 0; background: var(--bg); color: var(--ink-2); width: 32px; height: 32px; border-radius: 50%; font-size: 14px; cursor: pointer; }
.selbar .linkb { border: 0; background: none; color: #1E6FD9; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px; }
.selbar .r2 { display: grid; grid-template-columns: 2fr 44px 1fr 1fr; gap: 8px; }
.selbar .r2 .btn { min-height: 44px; white-space: nowrap; padding: 0 8px; }
.selbar .r2 .btn.iconly { padding: 0; color: var(--ink-3); }
.selbar .r2 .btn.iconly.flagon { color: #C62828; border-color: #F3B4B4; background: #FDECEC; }
.selbar .r2 .btn.iconly.flagon svg { fill: currentColor; }
.selbar .r1 .grow { flex: 1; }
.selbar .ibtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; cursor: pointer; }
.selbar .r2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 44px; gap: 5px; }
.sstep { min-height: 44px; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink-2); font: inherit; font-size: 12px;
  font-weight: 700; padding: 0 2px; cursor: pointer; line-height: 1.25; }
.sstep:disabled { opacity: .45; cursor: default; }
.sstep.on.st-assigned { background: var(--st-assigned); color: #fff; }
.sstep.on.st-in_progress { background: var(--st-in_progress); color: #fff; }
.sstep.on.st-purchased { background: var(--st-purchased); color: #fff; }
.sstep.on.st-cancelled { background: #6B7280; color: #fff; }
.sstep.flagb { color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; }
.sstep.flagb.flagon { color: #C62828; background: #FDECEC; }
.sstep.flagb.flagon svg { fill: currentColor; }
.selbar .r1 b, .selbar .linkb { white-space: nowrap; flex: none; }
/* compact request (document) cards */
.dcard2 { cursor: pointer; }
.dcard2 .code.doc { color: #1E6FD9; font-weight: 800; font-size: 13.5px; }
.dcard2 .dmsg { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--ink-3); flex: none; }
.dcard2 .dmsg svg { width: 14px; height: 14px; }
.dcard2 .qty small { font-size: 10.5px; font-weight: 600; color: var(--ink-3); margin-inline-start: 2px; }
.dcard2 .bars { height: 3px; margin-top: 6px; border-radius: 2px; }
#selBtn[hidden] { display: none; }
.dcard2 .bars { background: #ECEEF1; }
/* document page */
.code-b.doc { color: #1E6FD9; font-size: 18px; }
.sumcard .bars { height: 6px; margin-top: 2px; }
.dchips { display: flex; flex-wrap: wrap; gap: 4px; }
.dchip { font-size: 11.5px; background: var(--bg); color: var(--ink-2); border-radius: 999px; padding: 2px 9px; }
.dchip b { font-weight: 800; }
.dchip.st-assigned b { color: var(--st-assigned); } .dchip.st-in_progress b { color: var(--st-in_progress); }
.dchip.st-purchased b { color: var(--st-purchased); } .dchip.st-cancelled b { color: #6B7280; }
#dtabBody { padding-bottom: 80px; }
.dkv { grid-template-columns: 100px 1fr; margin-top: 0; }
.sumcard:has(.ribbon) .s-mid { padding-left: 30px; }
/* messages (notifications) list */
.nhead { display: flex; align-items: center; gap: 6px; }
.nhead .grow { flex: 1; }
.nlist { display: flex; flex-direction: column; gap: 6px; }
.notif { gap: 8px; padding: 8px 10px; align-items: flex-start; border-color: var(--line); transition: opacity .18s, transform .18s; }
.notif.unread { border-color: #BFD3EA; background: #F3F8FD; }
.notif.unread .tx { font-weight: 600; }
.notif.urgent.unread { border-inline-start: 3px solid var(--danger); }
.notif .nic { font-size: 16px; line-height: 1.4; flex: none; width: 22px; text-align: center; }
.notif .nb { flex: 1; min-width: 0; }
.notif .tx { font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.notif .t .go { color: #1E6FD9; }
.notif .nacts { display: flex; flex-direction: column; gap: 4px; flex: none; }
.notif .na { width: 32px; height: 30px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--brand); }
.notif .na.del { font-size: 12px; filter: grayscale(1); opacity: .7; }
.notif.gone { opacity: 0; transform: translateX(-30px); }
.notif .dot { margin-top: 9px; }
.notif .tx { -webkit-line-clamp: 3; }
.notif .nf { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 11.5px; }
.notif .nf .t { margin: 0; }
.notif .nf .go { color: #1E6FD9; }
.notif .nf .grow { flex: 1; }
.notif .na { width: auto; height: 26px; padding: 0 8px; font: inherit; font-size: 11.5px; color: var(--ink-2); }
.notif.unread .na[data-nread="1"] { color: var(--brand); border-color: #BFD3EA; font-weight: 700; }
.notif .na.del { filter: none; opacity: 1; color: var(--danger); }
/* My tasks */
.msec { display: flex; align-items: center; gap: 6px; padding: 8px 2px 0; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.msec b { font-size: 11px; background: var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.msec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9AA3AC; }
.msec.red::before { background: #C62828; } .msec.amber::before { background: #D97706; } .msec.green::before { background: #15803D; }
.count-line .unseen { color: #15803D; font-weight: 700; }
.dcard2 .tg.me { background: #E8F1FC; color: #1E6FD9; }
.card .who.from { color: var(--ink-3); font-weight: 400; }
.dcard2 .qty .mn { color: #1E6FD9; }
.card .tg.tnew { background: #15803D; color: #fff; font-weight: 800; font-size: 10.5px; }
.mw { display: contents; }
.msec.green::before { background: #15803D; } .msec.green span { color: #15803D; }
.msec.done::before { background: #9AA3AC; }
.msort { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.msort select { flex: 1; min-height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 13px; padding: 0 8px; color: var(--ink); }
.msort select.on { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.msub { font-size: 11.5px; color: var(--ink-3); padding: 4px 4px 0; border-bottom: 1px dashed var(--line); }
/* reports (compact) */
.rtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rtiles button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font: inherit; }
.rtiles b { font-size: 18px; font-weight: 900; color: var(--ink); }
.rtiles span { font-size: 11.5px; color: var(--ink-3); }
.rtiles .red b { color: var(--danger); } .rtiles .new b { color: #15803D; }
.ralerts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ralerts .alert { font-size: 13px; padding: 8px 10px; }
.panel.rp { padding: 10px 12px; }
.panel.rp h2 { font-size: 14px; margin: 0 0 6px; }
.panel.rp h2 small { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.pbar { display: grid; grid-template-columns: 92px 1fr 30px; grid-template-rows: auto auto; align-items: center; gap: 0 8px; width: 100%;
  border: 0; background: none; padding: 6px 0; border-bottom: 1px solid var(--line-2); font: inherit; text-align: start; cursor: pointer; }
.pbar:last-child { border-bottom: 0; }
.pbar .lab { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .track { display: flex; height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.pbar .track span { height: 100%; }
.pbar .val { font-weight: 800; font-size: 14px; text-align: left; }
.pbar .sub { grid-column: 2 / 4; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.rrow { display: grid; grid-template-columns: 1fr 42px 52px 36px; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: center; }
.rrow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .v { text-align: center; font-variant-numeric: tabular-nums; }
.rrow .v.mut { color: var(--ink-3); }
.rrow.hd { font-size: 11px; color: var(--ink-3); padding-top: 0; }
.rfoot { margin-top: 10px; line-height: 1.9; }
.lockmsg.soft { background: var(--bg); color: var(--ink-3); }
.tbl td.fxc { color: var(--ink-3); font-size: 12px; text-align: center; }
/* person page */
.ptitle { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ptitle b { font-size: 16px; } .ptitle span { font-size: 12px; color: var(--ink-3); }
.rtiles > div { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.rtiles > div b { font-size: 18px; font-weight: 900; } .rtiles > div span { font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.rtiles button.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.psub { font-size: 12px; color: var(--ink-3); margin: 8px 2px 0; line-height: 1.8; }
.psub b { color: var(--ink); }
.wbars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 92px; margin-top: 10px; direction: ltr; }
.wb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; }
.wb .bar { width: 70%; background: var(--st-purchased); border-radius: 3px 3px 0 0; }
.wb .v { font-size: 10.5px; color: var(--ink-2); font-weight: 700; }
.wb .x { font-size: 9.5px; color: var(--ink-3); }
.pkv { grid-template-columns: 1fr auto; margin-top: 0; }
.pkv b { text-align: left; }
.ptops { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ptops div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.ptops span { color: var(--ink-3); margin-inline-end: 4px; }
.ptops i { font-style: normal; background: var(--bg); border-radius: 999px; padding: 2px 9px; }
.msec .grow { flex: 1; }
.mini-link { font-size: 12px; font-weight: 600; color: #1E6FD9; text-decoration: none; margin-inline-start: 8px; }
/* Excel button */
.xls-btn { display: inline-flex; align-items: center; gap: 3px; height: 32px; padding: 0 8px; border: 1px solid #B7DCC4; background: #EEF8F1;
  color: #157347; border-radius: 9px; font: inherit; font-size: 11.5px; font-weight: 800; cursor: pointer; flex: none; }
.xls-btn svg { width: 16px; height: 16px; }
.rhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rhead b { font-size: 15px; }
.rhead.sm { margin-bottom: 6px; }
.s-meta .grow { flex: 1; }
/* share sheet */
.shopts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-bottom: 8px; }
.shopts label { display: inline-flex; align-items: center; gap: 4px; }
.shprev { white-space: pre-wrap; direction: rtl; text-align: right; font-family: inherit; font-size: 13px; line-height: 1.8; background: var(--bg);
  border-radius: 10px; padding: 10px 12px; max-height: 38vh; overflow: auto; margin: 0 0 10px; unicode-bidi: plaintext; }
.shrow { display: flex; gap: 6px; }
.shrow select { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; font: inherit; padding: 0 8px; background: var(--surface); }
.btns3 { display: flex; gap: 6px; }
.btns3 .btn { flex: 1; min-height: 42px; white-space: nowrap; padding: 0 6px; }
/* keep the list toolbar on one line on phones */
.toolrow { flex-wrap: nowrap; gap: 6px; }
.toolrow .count-line { padding: 0; white-space: nowrap; }
.toolrow .xls-btn { padding: 0 7px; }
.toolrow .xls-btn span { display: none; }
.toolrow .seg button { padding: 0 10px; }
.toolrow #selBtn { padding: 0 8px; white-space: nowrap; }
.shprev { unicode-bidi: normal; }
.colhead { display: flex; align-items: center; gap: 4px; }
.colhead > span { flex: 1; }
.colhead small { font-weight: 400; color: var(--ink-3); }
.colhead .linkb { border: 0; background: none; color: #1E6FD9; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 6px; }
.colhead .linkb + .linkb { border-inline-start: 1px solid var(--line); }
/* inner-page header */
.subtop { padding: 0; display: block; }
.subtop .in { max-width: 780px; margin: 0 auto; display: flex; align-items: center; gap: 6px; padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top)); }
.subtop .back, .subtop .home { width: 40px; height: 40px; min-height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.1); border: 0; cursor: pointer; flex: none; padding: 0; }
.subtop .back svg, .subtop .home svg { width: 20px; height: 20px; }
.subtop .ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.subtop .ttl h1 { font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtop .ttl .sub { font-size: 11.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: right; }
.subtop .ttl .sub:empty { display: none; }
/* status: coloured text on the usual grey chip */
.tg.stc-assigned { color: #6D3FB5; }
.tg.stc-in_progress { color: #1E6FD9; }
.tg.stc-purchased { color: #15803D; }
.tg.stc-cancelled { color: #C62828; }
.dchip.st-assigned { color: #6D3FB5; } .dchip.st-in_progress { color: #1E6FD9; }
.dchip.st-purchased { color: #15803D; } .dchip.st-cancelled { color: #C62828; }
.dchip.st-assigned b, .dchip.st-in_progress b, .dchip.st-purchased b, .dchip.st-cancelled b { color: inherit; }
[data-refresh].spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.t-node.pp { background: #FFF7E6; border-color: #F2D29B; } .t-node.pp small { display: block; font-size: 10px; color: #92600A; }
/* permissions table */
.ptable-wrap { overflow-x: auto; }
.ptable { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 12.5px; }
.ptable th { font-size: 11.5px; color: var(--ink-3); font-weight: 600; padding: 6px 4px; text-align: center; line-height: 1.4; }
.ptable th:first-child, .ptable td:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: var(--surface); }
.ptable td { padding: 8px 4px; border-top: 1px solid var(--line-2); text-align: center; }
.ptable input { width: 20px; height: 20px; accent-color: var(--brand); }
.linkb.danger, .danger-o { color: var(--danger); }
.btn.danger-o { border-color: #F3B4B4; }
.linkb { border: 0; background: none; font: inherit; cursor: pointer; font-weight: 700; }
/* chat extras */
.tg-tools { display: flex; justify-content: flex-end; padding: 2px 4px 4px; }
.tg-tools .linkb { font-size: 12px; }
.tg-lock { background: var(--bg); border-top: 1px solid var(--line-2); padding: 10px 12px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.tg-q.del span { font-style: italic; color: var(--ink-3); }
.tg-ed { font-size: 10px; color: var(--ink-3); margin-inline-end: 2px; }
.tg-menu button.danger { color: var(--danger); }
.tg-field { position: relative; display: flex; align-items: flex-end; gap: 2px; }
.tg-emo, .tg-att { border: 0; background: none; font-size: 19px; cursor: pointer; padding: 4px 6px; line-height: 1; flex: none; }
.emoji-pop { position: absolute; bottom: 100%; inset-inline-end: 50px; z-index: 6; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 22px rgba(0,0,0,.16); padding: 6px; display: grid; grid-template-columns: repeat(6, 36px); gap: 2px; margin-bottom: 6px; }
.emoji-pop[hidden] { display: none; }
.emoji-pop button { border: 0; background: none; font-size: 20px; height: 36px; border-radius: 8px; cursor: pointer; }
.emoji-pop button:hover { background: var(--bg); }
.mention-pop button.on { background: var(--bg); }
.mcards { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 4px; }
.mcard { display: flex; flex-direction: column; gap: 1px; text-decoration: none; color: var(--ink); background: rgba(255,255,255,.7);
  border: 1px solid var(--line-2); border-inline-start: 3px solid #1E6FD9; border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
.mcard.doc { border-inline-start-color: #6D3FB5; }
.mcard b { font-size: 13px; }
.mcard span { color: var(--ink-3); font-size: 11.5px; }
.mcard i { font-style: normal; }
.mcard em { font-style: normal; font-weight: 700; }
.mcard em.stc-assigned { color: #6D3FB5; } .mcard em.stc-in_progress { color: #1E6FD9; } .mcard em.stc-purchased { color: #15803D; } .mcard em.stc-cancelled { color: #C62828; }
.mcard.gone { border-inline-start-color: var(--line); color: var(--ink-3); font-style: italic; }
.tg-cards { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px 0; background: var(--card); }
.tg-cards[hidden] { display: none; }
.tg-cards span { background: #E8F1FC; color: #1E6FD9; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.tg-cards button { border: 0; background: none; cursor: pointer; color: inherit; }
.pclist { max-height: 46vh; overflow: auto; display: flex; flex-direction: column; margin-bottom: 8px; }
.pclist label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 2px; border-bottom: 1px solid var(--line-2); font-size: 13px; cursor: pointer; }
.pclist label span { display: flex; flex-direction: column; min-width: 0; }
.pclist small { color: var(--ink-3); font-size: 11px; }
/* messages tab & private chats */
.nhead .seg button { font-size: 13px; }
.seg.sm2 button { min-height: 28px; font-size: 12px; padding: 0 10px; }
.cntb { font-style: normal; background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 10.5px; margin-inline-start: 3px; font-weight: 800; }
.dmlist { display: flex; flex-direction: column; gap: 4px; }
.dmrow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.dmrow .tg-av { width: 38px; height: 38px; font-size: 13px; flex: none; }
.dmrow .dmb { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dmrow .dmb small { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.dmrow.unread .dmb b, .dmrow.unread .dmb small { color: var(--ink); font-weight: 700; }
.dmrow .dmm { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.dmrow .dmm small { font-size: 10.5px; color: var(--ink-3); }
.ptitle .grow { flex: 1; }
.dmpanel .tg-chat { min-height: 55vh; max-height: 68vh; }
.dmrow .tg-av { order: 0; }
/* archive */
.combos.c3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.combos.c3 select { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 12.5px; padding: 0 6px; }
.combos.c3 select.on { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.rhead .grow { flex: 1; }
.arlist.picking .card { cursor: pointer; }
.card.asel { outline: 3px solid var(--brand); outline-offset: -1px; }
.card.asel::after { content: "✓"; position: absolute; top: 6px; inset-inline-start: 8px; width: 22px; height: 22px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.selbar .r2.arb { grid-template-columns: 1fr 1fr 2fr; }
.archbar { background: #EEF0F3; color: var(--ink-2); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; }
.mynote.ro { cursor: default; border-style: solid; background: var(--bg); }
/* main header: keep date lines on one line on phones */
.un-short { display: none; }
@media (max-width: 480px) {
  .un-full { display: none; } .un-short { display: inline; }
  .huser { gap: 4px; } .huser .iconbtn.sm { width: 34px; height: 34px; }
  .hinfo .sub { white-space: nowrap; font-size: 11px; }
}

/* ================================================================ round 3: my-tasks chips, chat photos, vendors, inquiries, forms, storage */
.nm { unicode-bidi: plaintext; }
.chips .cn { font-style: normal; font-size: 11px; opacity: .75; margin-inline-start: 2px; }
.chip.on .cn { opacity: .95; }
.mchips { margin-top: 8px; }
.drange { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.opt.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.opt small { display: block; font-size: 11px; font-weight: 400; opacity: .8; }
.opts.col { flex-direction: column; }
.opts.col .opt { text-align: right; min-height: 40px; padding: 6px 12px; }
.tg.trfq { background: #FFF4D6; color: #7A5200; text-decoration: none; cursor: pointer; }
.rfqbar { display: block; background: #FFF4D6; color: #6B4800; border-radius: 10px; padding: 7px 10px; font-size: 13px; text-decoration: none; }
.selbar .ibtn.rfqb { font-size: 16px; }
/* chat photos & templates */
.tg-ph.n2 img, .tg-ph.n3 img { width: calc(50% - 2px); height: 130px; }
.tg-ph.n3 img:first-child { width: 100%; }
.tg-gone { font-size: 12px; color: var(--ink-3); background: var(--line-2); border-radius: 8px; padding: 3px 8px; margin: 2px 0 4px; }
.tg-pph { display: flex; gap: 6px; padding: 6px 10px 0; background: #fff; border-top: 1px solid var(--line-2); }
.tg-pph span { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--line-2); display: grid; place-items: center; }
.tg-pph img { width: 100%; height: 100%; object-fit: cover; }
.tg-pph button { position: absolute; top: 2px; inset-inline-end: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; cursor: pointer; }
.spin-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tg-tpl { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px 2px; background: #fff; border-top: 1px solid var(--line-2); scrollbar-width: none; }
.tg-tpl::-webkit-scrollbar { display: none; }
.tg-tpl button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.tg-att svg { width: 20px; height: 20px; }
label.tg-att { margin: 0; }
.imgview { gap: 10px; grid-template-rows: 1fr auto; padding: 12px; }
.imgview img { max-height: calc(100vh - 80px); }
.iv-bar { display: flex; gap: 8px; justify-content: center; }
.iv-bar .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.mcard.rfqc { border-inline-start-color: #C98A00; }
.mcard.pdfc { border-inline-start-color: #B42318; }
/* inquiry status pills */
.rst { flex: none; font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.rst-draft { background: #ECEDEF; color: #555E68; }
.rst-quoting { background: #E1ECF8; color: #1D5F9E; }
.rst-pending { background: #FCEFC9; color: #8A5300; }
.rst-returned { background: #FDE2CC; color: #9A3B00; }
.rst-approved { background: #DDF1E4; color: #1E7A45; }
.rst-purchased { background: #D2EBDA; color: #145A33; }
.rst-rejected { background: #FDECEA; color: #B42318; }
.rst-cancelled { background: #ECEDEF; color: #6B7280; text-decoration: line-through; }
em.rst-pending, em.rst-approved, em.rst-returned, em.rst-rejected { padding: 0 6px; border-radius: 6px; }
.kind { font-size: 11.5px; font-weight: 700; padding: 0 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.kind.k-waiver { background: #F3E8FF; color: #6D28D9; }
/* inquiry list */
.search.light { background: var(--surface); border: 1px solid var(--line); margin-top: 0; }
.grow1 { flex: 1; min-width: 0; }
.hint-new { font-size: 12.5px; color: var(--ink-2); background: var(--brand-soft); border-radius: 10px; padding: 8px 10px; margin: 8px 16px 0; }
.hint-new .linkb { color: var(--brand); font-size: 12.5px; }
.rcard { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  text-decoration: none; color: var(--ink); border-inline-start: 4px solid var(--line); }
.rcard.rs-pending { border-inline-start-color: #E0A100; } .rcard.rs-returned { border-inline-start-color: #E06A00; }
.rcard.rs-approved, .rcard.rs-purchased { border-inline-start-color: #1E7A45; } .rcard.rs-quoting { border-inline-start-color: #1D5F9E; }
.rcard .r1 { display: flex; gap: 8px; align-items: center; }
.rcard .r1 .num { color: var(--ink-3); font-size: 13px; font-weight: 700; }
.rcard .r1 .desc { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard .r2, .rcard .r3 { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.rcard .vn2 { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rcard .r3 b { color: var(--ink); font-size: 14px; } .rcard .r3 small { color: var(--ink-3); }
.list .rcard + .rcard { margin-top: 8px; }
/* one inquiry */
.okbar { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 600; }
.okbar.wait { background: var(--warn-soft); color: var(--warn); }
.pre { white-space: pre-wrap; margin: 0; }
.ritem { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.ritem:last-child { border-bottom: 0; }
.ritem.rej { opacity: .55; }
.ritem .num { color: var(--ink-3); font-size: 12px; min-width: 16px; }
.ri-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ri-t { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 14px; }
.ri-s { font-size: 12px; color: var(--ink-2); }
.ri-s a { color: var(--brand); text-decoration: none; }
.ri-s i { font-style: normal; }
.qtyb { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-width: 54px; padding: 3px 6px; font: inherit; font-weight: 800; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.qtyb small { font-size: 10px; font-weight: 400; color: var(--ink-3); }
.qtyb:disabled { cursor: default; border-style: dashed; }
.xbtn { flex: none; border: 0; background: var(--bg); color: var(--ink-2); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 13px; }
.rvend { border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; }
.rvend + .rvend { margin-top: 8px; }
.rv1 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rv1 a { color: var(--ink); text-decoration: none; }
.rv2 { font-size: 12.5px; color: var(--ink-2); }
.rv3 { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.rv3 b { color: var(--ink); font-size: 14px; }
.pfs { display: flex; gap: 4px; }
.pfs img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.tel { color: var(--brand); text-decoration: none; font-weight: 600; }
.twrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.cmpt { border-collapse: collapse; width: 100%; font-size: 13px; min-width: max-content; }
.cmpt th, .cmpt td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; vertical-align: middle; }
.cmpt th { background: var(--bg); font-size: 12px; max-width: 140px; }
.cmpt td.it { text-align: right; min-width: 140px; max-width: 220px; }
.cmpt td.it b { display: block; font-weight: 700; font-size: 13px; }
.cmpt td small { display: block; font-size: 10.5px; color: var(--ink-3); }
.cmpt td small.up { color: var(--danger); } .cmpt td small.dn { color: var(--ok); }
.cmpt td.best { background: #E6F4EA; }
.cmpt td.win { outline: 2px solid var(--brand); outline-offset: -2px; font-weight: 800; }
.cmpt td.pick { cursor: pointer; }
.cmpt td.pick:hover { background: var(--brand-soft); }
.cmpt tr.rej td { opacity: .5; }
.cmpt tr.rsn td { text-align: right; background: #FFFBEB; font-size: 12.5px; }
.cmpt tr.rsn label { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cmpt tr.rsn .inp { flex: 1; min-width: 160px; }
.cmpt tr.tot td { font-weight: 800; background: var(--bg); }
.inp.sm { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.rsum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0 8px; }
.rsum > div { border: 1px solid var(--line); border-radius: 12px; padding: 7px 8px; display: flex; flex-direction: column; gap: 1px; }
.rsum span { font-size: 11.5px; color: var(--ink-3); }
.rsum b { font-size: 15px; font-weight: 900; }
.rsum small { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decide { border-color: #E0A100; background: #FFFBEB; }
.dlist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.drow2 { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; }
.drow2 small { color: var(--ink-3); }
.decide .btns3 { margin-top: 8px; flex-wrap: wrap; }
.row.wrapr { flex-wrap: wrap; margin: 6px 0; }
.pdfl { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pdfl > div { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.pdfl a { color: var(--ink); text-decoration: none; font-weight: 600; }
.pdfl small { color: var(--ink-3); flex: 1; }
.pdfl .linkb { color: var(--brand); font-size: 12.5px; }
.plist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 42vh; overflow-y: auto; }
.prow { display: flex; gap: 8px; align-items: center; }
.prow span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.prow small { color: var(--ink-3); font-size: 11.5px; }
.prow .inp { width: 140px; flex: none; text-align: left; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.inp.ltr, input.ltr { direction: ltr; text-align: left; }
/* vendors */
.vplist { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; margin: 8px 0; }
.vplist.big { max-height: none; overflow: visible; }
.vsec { font-size: 12px; font-weight: 800; color: var(--brand); padding: 8px 2px 2px; }
.vrow { display: flex; flex-direction: column; align-items: stretch; gap: 1px; text-align: right; border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 7px 10px; font: inherit; cursor: pointer; width: 100%; }
.vrow:hover { border-color: var(--brand); }
.vrow .vn { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.vrow .vn b { font-size: 14px; }
.vrow .vs { font-size: 12px; color: var(--ink-3); }
.vrow .vs i { font-style: normal; color: var(--ink-2); }
.vrow.vnew { border-style: dashed; color: var(--brand); font-weight: 700; align-items: center; }
.vb { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); line-height: 1.8; display: inline-flex; align-items: center; }
.vb.new { background: #E7F6EC; color: #1E7A45; } .vb.off { background: #FDECEA; color: var(--danger); }
.vb.priv { background: #F3E8FF; color: #6D28D9; } .vb.warn { background: var(--warn-soft); }
.vb.lk svg { width: 12px; height: 12px; }
.vtags { margin: 6px 0 2px; }
.dupbox { font-size: 13px; background: var(--warn-soft); color: #5E3A00; border-radius: 10px; padding: 7px 10px; }
.dupbox.bad { background: var(--danger-soft); color: #7A1A12; }
.dupbox .linkb { color: var(--brand); font-size: 13px; }
.vhead .vtitle { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vhead h1 { font-size: 17px; margin: 0; }
.vbtns { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.vbtns .btn { text-decoration: none; }
.btn.on { background: var(--ok-soft); border-color: #AFD9BE; color: var(--ok); }
.drow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.alert.mid { flex-direction: column; }
.mynote2 { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 13px; }
.tagp { font-style: normal; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 0 7px; font-size: 12px; }
.vdocs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.vdoc { border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.vdoc.del { opacity: .55; border-style: dashed; }
.vdoc small { color: var(--ink-3); font-size: 11px; }
.vthumb { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: grid; place-items: center; background: var(--line-2); }
.vthumb.pdf { color: #B42318; font-weight: 900; text-decoration: none; font-size: 15px; width: 54px; height: 54px; }
.vdoc .vthumb.pdf { width: 100%; height: 90px; }
.rres { font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 6px; background: var(--line-2); }
.rres.ok { background: var(--ok-soft); color: var(--ok); } .rres.bad { background: var(--danger-soft); color: var(--danger); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.twrap .tbl td { white-space: normal; }
.timeline .clickable { cursor: pointer; border-radius: 6px; }
.timeline .clickable:hover { background: var(--brand-soft); }
.vbrief { display: flex; flex-direction: column; gap: 1px; font-size: 13px; min-width: 0; }
.vbrief a { color: var(--ink); text-decoration: none; }
.vbrief small { color: var(--ink-3); font-size: 11.5px; }
.pair { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.pmid { display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 12px; color: var(--ink-2); text-align: center; }
.pmid .btn { white-space: nowrap; font-size: 12px; }
.pmid .linkb { color: var(--ink-3); font-size: 12px; }
.vbr2 { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.vbr2 small { color: var(--ink-3); font-size: 11.5px; }
.plist2 { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; }
.plist2 summary { cursor: pointer; font-size: 14px; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } .pmid { flex-direction: row; flex-wrap: wrap; justify-content: center; } .rsum b { font-size: 13px; } .prow .inp { width: 118px; } }
/* printable forms */
.wrap.wide { max-width: 1240px; }
.formpage { padding-bottom: 20px; }
.fseg { align-self: flex-start; }
.fgrid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
.fprev { background: #8a8f96; border-radius: 12px; overflow: hidden; }
.fprev iframe { width: 100%; height: 80vh; border: 0; display: block; background: #8a8f96; }
.fedit { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 64px; max-height: calc(100vh - 140px); overflow-y: auto; }
.ffield { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.ffield.ed { border-color: #F59E0B; box-shadow: 0 0 0 2px #FEF3C7; }
.ffield .fl { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ffield .fl .linkb { color: #B45309; font-size: 12px; }
.ffield summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ffield details > .inp, details.ffield .inp { margin-top: 4px; }
.row3 .ffield { padding: 6px 8px; }
@media (min-width: 900px) { .fseg { display: none !important; } }
@media (max-width: 899px) {
  .fgrid { grid-template-columns: 1fr; }
  .fgrid .fedit { display: none; position: static; max-height: none; }
  .fgrid[data-m="edit"] .fedit { display: flex; }
  .fgrid[data-m="edit"] .fprev { display: none; }
  .row3 { grid-template-columns: 1fr; }
}
/* storage */
.ubar { height: 14px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.ubar span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.ubar.warn span { background: #E0A100; } .ubar.bad span { background: var(--danger); }
.ubig { font-size: 15px; margin: 6px 0; }
.flist { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.flist label { display: flex; gap: 8px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--line-2); padding: 4px 0; }
.flist img, .flist .vthumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; flex: none; }
.flist span { display: flex; flex-direction: column; min-width: 0; }
.flist small { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg.trfq { padding: 0 3px; font-size: 11px; }
.tg-field { min-width: 0; }
.tg-field textarea { min-width: 0; width: 100%; }
.tg-field .tg-att { width: 32px; flex: none; }
.panel .tbl td, .panel .tbl th { white-space: normal; }
.panel .tbl td:last-child { white-space: nowrap; text-align: left; }
.vbrief .vb { align-self: flex-start; }
.rsum.one { grid-template-columns: 1fr; }
.rsum.one > div:not(:first-child) { display: none; }
