:root {
  --bg: #f5f7f5; --surface: #ffffff; --border: #e1e7e3; --grid: #edf1ee;
  --text: #17221c; --muted: #5d6b63; --accent: #1f7a4d; --accent-ink: #ffffff; --accent-soft: #e5f2ea;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --error-bg: #fdecec; --error-text: #a12626; --ok-bg: #e5f2ea; --ok-text: #14603a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1512; --surface: #161e1a; --border: #26322b; --grid: #1e2822;
    --text: #e6ece8; --muted: #93a29a; --accent: #4cbf86; --accent-ink: #0b1a12; --accent-soft: #1a2e23;
    --error-bg: #3a1a1a; --error-text: #f2a7a7; --ok-bg: #1a2e23; --ok-text: #8fdcb2;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1512; --surface: #161e1a; --border: #26322b; --grid: #1e2822;
  --text: #e6ece8; --muted: #93a29a; --accent: #4cbf86; --accent-ink: #0b1a12; --accent-soft: #1a2e23;
  --error-bg: #3a1a1a; --error-text: #f2a7a7; --ok-bg: #1a2e23; --ok-text: #8fdcb2;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }

/* top bar */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none;
}
.top h1 { font-size: 20px; margin: 0; }
.sub { color: var(--muted); font-size: 13px; }
.top nav { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top nav .who { color: var(--muted); font-size: 13px; }

/* auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px 24px; }
.auth .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth h1 { font-size: 20px; margin: 0; }
.auth h2 { font-size: 16px; margin: 0 0 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.otp { letter-spacing: .3em; font-variant-numeric: tabular-nums; font-size: 18px; }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn.block { width: 100%; margin-top: 18px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); font-weight: 500; }
.btn:disabled { opacity: .6; cursor: wait; }
.tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-top: 16px; }
.tabs button {
  flex: 1; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tabs button[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.msg { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 13px; display: none; }
.msg.error { display: block; background: var(--error-bg); color: var(--error-text); }
.msg.ok { display: block; background: var(--ok-bg); color: var(--ok-text); }
.links { margin-top: 16px; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* dashboard */
h2.section { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bar { display: flex; height: 14px; gap: 2px; margin: 12px 0 10px; }
.bar span { display: block; height: 100%; }
.bar span:first-child { border-radius: 4px 0 0 4px; }
.bar span:last-child { border-radius: 0 4px 4px 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); }
.pill.late { --dot: var(--critical); }
.pill.soon { --dot: var(--warning); }
.pill.ok { --dot: var(--good); }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.links-grid a.card { color: inherit; text-decoration: none; display: block; }
.links-grid a.card:hover { border-color: var(--accent); }
.links-grid h3 { margin: 0 0 4px; font-size: 15px; }
.links-grid p { margin: 0; color: var(--muted); font-size: 13px; }
.stamp { color: var(--muted); font-size: 12px; margin-top: 32px; text-align: center; }

/* settings */
.settings { max-width: 560px; }
.settings .card { margin-bottom: 16px; padding: 20px; }
.settings h2 { font-size: 16px; margin: 0 0 4px; }
.qr { background: #fff; padding: 12px; border-radius: 8px; display: inline-block; margin: 12px 0; }
.qr svg { display: block; }
code.secret { font-size: 14px; word-break: break-all; background: var(--bg); padding: 4px 6px; border-radius: 4px; }

/* ---------- app shell: sidebar + main ---------- */
:root { --sb-w: 240px; --sb-rail: 60px; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; flex: none; width: var(--sb-w);
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border);
  overflow: hidden; transition: width .18s ease;
}
.sb-resizing .sidebar, .sb-resizing .resizer { transition: none; }
.sb-resizing, .sb-resizing * { cursor: col-resize !important; user-select: none; }
.sb-resizing iframe { pointer-events: none; }
.sb-collapsed .sidebar { width: var(--sb-rail); }
.resizer {
  flex: none; width: 6px; margin-left: -3px; margin-right: -3px; cursor: col-resize; position: relative; z-index: 5;
  touch-action: none;
}
.resizer::after { content: ""; position: absolute; inset: 0 2px; border-radius: 2px; transition: background .15s; }
.resizer:hover::after, .resizer:focus-visible::after, .sb-resizing .resizer::after { background: var(--accent); }
.resizer:focus-visible { outline: none; }
.main { flex: 1; min-width: 0; }

.sb-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px; min-height: 64px; }
.sb-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; min-width: 0; flex: 1; }
.logo.sm { width: 32px; height: 32px; border-radius: 8px; font-size: 16px; }
.sb-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-btn {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
}
.sb-btn:hover { background: var(--bg); color: var(--text); }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
}
.sb-nav a svg { flex: none; }
.sb-section { display: flex; flex-direction: column; gap: 2px; }
.sb-section + .sb-section { margin-top: 10px; }
.sb-section[hidden] { display: none; }
.sb-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.sb-rule { display: none; height: 1px; background: var(--border); margin: 4px 12px; }
.sb-ext { margin-left: auto; opacity: .6; display: flex; }
.sb-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink);
}
.sb-badge[hidden] { display: none; }
.sb-collapsed .sb-rule { display: block; }
.sb-collapsed .sb-section + .sb-section { margin-top: 4px; }
.sb-collapsed .sb-nav a { position: relative; }
.sb-collapsed .sb-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.sb-nav a:hover { background: var(--bg); color: var(--text); }
.sb-nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-nav a[hidden] { display: none; }
.sb-foot { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.sb-user { flex: 1; min-width: 0; }
.sb-email { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge {
  display: inline-block; margin-top: 2px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
}
.role-badge[data-role=admin] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* collapsed rail: icons only, brand logo becomes the expand target */
.sb-collapsed .sb-text, .sb-collapsed .sb-user { display: none; }
.sb-collapsed .sb-head { flex-direction: column; padding: 12px 0; gap: 6px; }
.sb-collapsed .sb-brand { flex: none; }
.sb-collapsed .sb-nav a { justify-content: center; padding: 9px 0; }
.sb-collapsed .sb-foot { justify-content: center; padding: 12px 0; }

.mobile-bar, .m-chips, .tabbar, .sb-grab, .ptr, .m-only { display: none; }
.sb-scrim { display: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 24px 48px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 22px; margin: 0; }

/* full-bleed embedded page (PO form) */
.embed { display: flex; flex-direction: column; height: 100vh; }
.embed iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* ---------- tablet (768–1099px): icon rail; the full menu slides over the page ---------- */
@media (min-width: 768px) and (max-width: 1099px) {
  .shell { padding-left: var(--sb-rail); }
  .resizer { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; z-index: 40; }
  .sb-tablet-open .sidebar { box-shadow: 0 12px 40px rgba(0,0,0,.22); }
  .sb-tablet-open .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 30; animation: tc-fade .2s; }
  .page { padding: 20px 20px 40px; }
  .embed { height: 100dvh; }
}

/* ---------- phone (<768px): native-app layout ---------- */
:root {
  --m-bar: 52px; --m-tab: 60px;
  --m-top: calc(var(--m-bar) + env(safe-area-inset-top, 0px));
  --m-bottom: calc(var(--m-tab) + env(safe-area-inset-bottom, 0px));
  --m-ease: cubic-bezier(.32, .72, 0, 1);
}
@keyframes tc-fade { from { opacity: 0; } }
@keyframes tc-sheet-up { from { transform: translateY(100%); } }
@keyframes tc-spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) {
  @view-transition { navigation: auto; }
  html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  .sb-mobile-open body { overflow: hidden; }
  .standalone body { overscroll-behavior-y: none; }
  a, button, .btn, .chip, label { touch-action: manipulation; }
  .shell { display: block; }
  .resizer { display: none; }
  .main { min-height: 100dvh; padding-bottom: var(--m-bottom); }
  .m-only { display: revert; }

  /* top app bar */
  .mobile-bar {
    display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 20;
    height: var(--m-top); padding: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
    background: var(--surface); background: color-mix(in srgb, var(--surface) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.8) blur(16px); backdrop-filter: saturate(1.8) blur(16px);
    border-bottom: 1px solid transparent; transition: border-color .2s; view-transition-name: tc-appbar;
  }
  .mobile-bar.scrolled { border-bottom-color: var(--border); }
  .mb-logo { display: flex; text-decoration: none; }
  .mb-center { flex: 1; min-width: 0; display: grid; margin-left: 4px; }
  .mb-center > span { grid-area: 1 / 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s, transform .2s; }
  .mb-brand { font-weight: 700; font-size: 17px; }
  .mb-title { font-weight: 650; font-size: 17px; opacity: 0; transform: translateY(6px); }
  .mobile-bar.show-title .mb-title { opacity: 1; transform: none; }
  .mobile-bar.show-title .mb-brand { opacity: 0; transform: translateY(-6px); }
  .mb-btn {
    position: relative; flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
    border: 0; background: transparent; color: var(--text); text-decoration: none; cursor: pointer; font: inherit;
  }
  .mb-btn[hidden] { display: none; }
  .mb-btn:active { background: var(--bg); }
  .mb-avatar span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
  .mb-btn .sb-badge { position: absolute; top: 4px; right: 2px; margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }

  /* section chips under the app bar */
  .m-chips { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .m-chips[hidden] { display: none; }
  .m-chips::-webkit-scrollbar { display: none; }
  .m-chips a {
    flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 13.5px; font-weight: 550; text-decoration: none; white-space: nowrap;
  }
  .m-chips a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

  /* bottom tab bar */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--m-bottom);
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.8) blur(16px); backdrop-filter: saturate(1.8) blur(16px);
    border-top: 1px solid var(--border); view-transition-name: tc-tabbar;
  }
  .tabbar [data-tab] {
    flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer;
    -webkit-user-select: none; user-select: none;
  }
  .tabbar .ti { width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .2s, transform .12s; }
  .tabbar .tl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar [aria-current] { color: var(--accent); }
  .tabbar [aria-current] .ti { background: var(--accent-soft); }
  .tabbar [data-tab]:active .ti { transform: scale(.9); }
  .tabbar .sb-badge { position: absolute; top: 5px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
  .tabbar .sb-badge[hidden] { display: none; }

  /* the sidebar becomes the "More" bottom sheet */
  .sidebar, .sb-collapsed .sidebar {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 60; width: 100%; height: auto; max-height: 88dvh;
    border-right: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(105%); visibility: hidden; transition: transform .3s var(--m-ease), visibility 0s .3s;
  }
  .sb-mobile-open .sidebar { transform: none; visibility: visible; transition: transform .3s var(--m-ease); }
  .sb-mobile-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); animation: tc-fade .25s; }
  .sb-grab { display: block; order: -2; flex: none; width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 8px auto 4px; }
  .sb-head { display: none; }
  .sb-foot { order: -1; border-top: 0; border-bottom: 1px solid var(--border); padding: 6px 16px 14px; }
  .sb-email { font-size: 15px; }
  .sb-nav { padding: 8px 10px 14px; overscroll-behavior: contain; gap: 0; }
  .sb-nav a { padding: 12px; font-size: 15px; border-radius: 12px; gap: 14px; }
  .sb-nav a:active { background: var(--bg); }
  .sb-section + .sb-section { margin-top: 12px; }

  /* pull to refresh (installed app) */
  .ptr {
    display: grid; place-items: center; position: fixed; top: calc(var(--m-top) + 6px); left: 50%; z-index: 30; width: 38px; height: 38px;
    border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.18);
    opacity: 0; transform: translate(-50%, 0); pointer-events: none; transition: opacity .2s;
  }
  .ptr.spin svg { animation: tc-spin .8s linear infinite; }

  /* page content */
  .page, .page.wide { padding: 6px 16px 28px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 28px; font-weight: 750; letter-spacing: -.015em; line-height: 1.2; }
  .page-head .sub { font-size: 13px; margin-top: 2px; }
  .card { border-radius: 14px; }
  h2.section { margin: 24px 2px 10px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .kpi .value { font-size: 22px; overflow-wrap: anywhere; }
  .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
  .btn.sm { min-height: 36px; }
  .btn:active, .chip:active { transform: scale(.97); }
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px !important; }
  input[type=email], input[type=password], input[type=text] { padding: 12px; }
  .embed { height: 100dvh; }
  body .toast { bottom: calc(var(--m-bottom) + 12px); border-radius: 12px; }
  .auth { min-height: 100dvh; padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px)); }

  /* dialogs open as full-screen sheets */
  body dialog {
    width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  }
  body dialog[open] { animation: tc-sheet-up .32s var(--m-ease); }

  /* wide tables become stacked cards (labels come from shell.js) */
  table.m-cards, table.m-cards > tbody { display: block; }
  table.m-cards > thead { display: none; }
  table.m-cards > tbody > tr { display: block; position: relative; padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.m-cards > tbody > tr:last-child { border-bottom: 0; }
  table.m-cards > tbody > tr:active { background: var(--bg); }
  table.m-cards > tbody > tr > td {
    display: flow-root; padding: 3px 0; border: 0; text-align: right; width: auto !important; white-space: normal; background: none !important;
  }
  table.m-cards > tbody > tr > td[data-label]::before {
    content: attr(data-label); float: left; max-width: 45%; margin-right: 12px; text-align: left;
    color: var(--muted); font-size: 12px; font-weight: 500; line-height: 20px;
  }
  table.m-cards > tbody > tr > td:first-child { font-weight: 600; }
  table.m-cards > tbody > tr > td:not([data-label]) { text-align: left; }
  table.m-cards > tbody > tr > td[colspan] { text-align: center; font-weight: 400; }
  table.m-cards > tbody > tr > td.m-blank { display: none; }
  table.m-cards > tbody > tr > td.m-act { position: absolute; top: 4px; right: -6px; padding: 0; }
  table.m-cards > tbody > tr.m-has-act > td:first-child { padding-right: 34px; }
  table.m-cards .icon-btn { padding: 8px; }
}

/* users page */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--critical); border-color: var(--border); font-weight: 500; }
select {
  padding: 8px 10px; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
select.sm { padding: 4px 8px; font-size: 13px; }
.form-row { display: grid; gap: 12px; grid-template-columns: 2fr 1.5fr 1fr auto; align-items: end; }
.form-row label { margin-top: 0; }
@media (max-width: 767px) { .form-row { grid-template-columns: 1fr; } }
.link-box { display: flex; gap: 8px; margin-top: 12px; }
.link-box input { flex: 1; font-size: 13px; }
.roles-help { font-size: 13px; color: var(--muted); margin: 0; padding-left: 18px; }
.roles-help li { margin: 2px 0; }
.form-row select { padding: 10px 12px; }

/* "Quotation Received" pop-up (shell.js) */
.qpop-stack { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: min(360px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; }
.qpop-stack:empty { display: none; }
.qpop { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--good); border-radius: 12px; padding: 11px 12px 11px 13px; box-shadow: 0 10px 28px rgba(0,0,0,.22); }
.qpop.new { animation: qpop-in .28s ease-out; }
@keyframes qpop-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.qpop-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.qpop-head b { flex: 1; }
.qpop-tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: #fff; font-size: 13px; line-height: 1; flex: none; }
.qpop-tick svg { width: 13px; height: 13px; }
.qpop-x { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.qpop-x:hover { background: var(--accent-soft); color: var(--text); }
.qpop-st { font-weight: 600; font-size: 13px; margin-top: 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qpop-meta { color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.qpop-more { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.qpop-all { background: none; border: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; padding: 2px 4px; }
@media (max-width: 767px) { .qpop-stack { right: 12px; bottom: calc(var(--m-bottom, 64px) + 12px); } }
@media (prefers-reduced-motion: reduce) { .qpop.new { animation: none; } }
@media print { .qpop-stack { display: none; } }
