:root {
  --accent: #3d7be0;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #4a4f5a;
  --muted: #7b818c;
  --line: #e3e6eb;
  --line-2: #eef0f3;
  --side: #16181d;
  --side-ink: #b9bec8;
  --side-hover: #22252c;
  --ok: #2e7d46;
  --warn: #b06d10;
  --danger: #c0392b;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }

.boot-spinner, .spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40vh auto; }
.spinner { margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- каркас ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 228px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 50; transition: transform .2s; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: #858b96; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--side-ink); font-size: 13.5px; margin-bottom: 1px; }
.nav a:hover { background: var(--side-hover); color: #e9ebef; text-decoration: none; }
.nav a.active { background: var(--side-hover); color: #fff; font-weight: 600; }
.nav a.active svg { color: var(--accent); }
.nav svg { width: 17px; height: 17px; flex-shrink: 0; color: #7d838f; }
.nav .badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.nav-sep { height: 1px; background: #2a2d35; margin: 8px 6px; }
.userbox { border-top: 1px solid #2a2d35; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2a2d35; color: var(--accent); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.userbox .who { flex: 1; min-width: 0; }
.userbox .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .who span { font-size: 11px; color: #858b96; }
.icon-btn { background: none; border: 0; color: #858b96; padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--side-hover); color: #fff; }
.icon-btn svg { width: 17px; height: 17px; }
.main { flex: 1; margin-left: 228px; padding: 22px 28px 40px; min-width: 0; }
.topbar { display: none; }
.backdrop { display: none; }

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
  .layout { display: block; }
  .main { margin-left: 0; padding: 14px 14px 40px; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--side); color: #fff; padding: 10px 14px; }
  .topbar .icon-btn { color: #fff; }
}

/* ---------- заголовки и блоки ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card h2 { font-size: 14px; margin: 0 0 12px; }
.card h2 .muted { font-weight: 400; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 14px; }

.stat { padding: 14px 16px; }
.stat .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap; color: var(--ink); }
.btn:hover { background: #f0f2f5; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #2b2f38; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(.95); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fdecea; border-color: #f3c5bf; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef0f3; }

label.f { display: block; }
label.f > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
label.f > span .req { color: var(--danger); }
.input, select.input, textarea.input { width: 100%; height: 36px; border: 1px solid #d5d9e0; border-radius: 6px; background: #fff; padding: 0 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input.sm { height: 30px; font-size: 13px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search .input { padding-left: 32px; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #f8f9fb; }
.t .r { text-align: right; }
.t td.sub { color: var(--muted); font-size: 12px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }

/* ---------- бейджи и вкладки ---------- */
.badge-s { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-s::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; background: #eef0f3; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.pill.warn { background: #fdf1de; color: var(--warn); }
.pill.danger { background: #fdecea; color: var(--danger); }
.pill.ok { background: #e3f3e7; color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: #c9ced6; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- модальные окна, уведомления ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16, 18, 24, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px; z-index: 100; overflow-y: auto; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: pop .15s; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .icon-btn { color: var(--muted); }
.modal-head .icon-btn:hover { background: #eef0f3; color: var(--ink); }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 360px; animation: pop .15s; }
.toast.err { background: var(--danger); }

/* ---------- заказ ---------- */
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.order-head h1 { font-size: 22px; margin: 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: #c3c8d0; }
.timeline li.status::before { background: var(--accent); }
.timeline li.payment::before { background: var(--ok); }
.timeline li.comment::before { background: var(--warn); }
.timeline .when { font-size: 11.5px; color: var(--muted); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-size: 13.5px; }
.totals .big { font-size: 17px; font-weight: 700; }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line-2); }

/* ---------- графики ---------- */
.chart { width: 100%; height: 180px; }
.chart text { font-size: 10px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 140px 1fr 70px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.hbar .track { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -160px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%); }
.auth-side h2 { font-size: 34px; line-height: 1.15; margin: 0 0 14px; position: relative; }
.auth-side h2 span { color: var(--accent); }
.auth-side p { color: #a7adb8; max-width: 380px; position: relative; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 340px; }
.auth-form h1 { font-size: 22px; margin: 0 0 4px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- печать ---------- */
.print-page { background: #fff; max-width: 210mm; margin: 0 auto; padding: 14mm; color: #000; font-size: 12.5px; }
.print-bar { display: flex; justify-content: center; gap: 8px; padding: 12px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
.doc-head .co { font-size: 18px; font-weight: 700; }
.doc-title { font-size: 15px; font-weight: 700; margin: 8px 0 2px; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.doc td, .doc th { border: 1px solid #999; padding: 5px 7px; text-align: left; vertical-align: top; }
.doc th { background: #f2f2f2; font-weight: 600; }
.doc td.k { width: 34%; background: #fafafa; color: #333; }
.doc .terms { font-size: 10.5px; color: #222; margin-top: 10px; white-space: pre-line; }
.doc .signs { display: flex; gap: 14mm; margin-top: 16mm; }
.doc .signs div { flex: 1; border-top: 1px solid #000; padding-top: 3px; font-size: 11px; }
.doc .blank { display: inline-block; min-width: 50mm; border-bottom: 1px solid #000; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .no-print, .sidebar, .topbar, #toasts { display: none !important; }
  .main { margin: 0; padding: 0; }
  .print-page { padding: 0; max-width: none; }
}
.auth-feats { list-style: none; padding: 0; margin: 22px 0 0; position: relative; display: grid; gap: 10px; color: #c9ced8; font-size: 14px; }
.auth-feats span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: #ffffff12; color: var(--accent); margin-right: 10px; font-size: 13px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid #ffffff55; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin-left: 6px; opacity: .85; }
/* смена статуса из списка */
.status-btn { background: none; border: 0; padding: 2px; margin: -2px; border-radius: 20px; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; font: inherit; }
.status-btn:hover { background: #eef0f3; }
.status-btn .caret { font-size: 10px; color: var(--muted); padding-right: 4px; }
.status-menu { position: absolute; z-index: 150; padding: 4px; min-width: 190px; max-height: 360px; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.status-menu button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13.5px; text-align: left; color: var(--ink); }
.status-menu button:hover { background: #f0f2f5; }
.status-menu button.on { font-weight: 600; background: var(--accent-soft); }
.status-menu button span { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
/* отправка документа в мессенджер */
.send-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.send-btn { position: relative; height: 46px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c) 40%, #fff); background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; }
.send-btn:hover, .send-btn:focus-visible { background: var(--c); color: #fff; outline: none; }
.send-btn kbd, .hk kbd { position: absolute; top: 4px; right: 5px; border-color: currentColor; opacity: .55; font-size: 10px; margin: 0; }
.hk { position: relative; padding-right: 46px; }
.hk kbd { top: 50%; transform: translateY(-50%); right: 8px; }
/* установка приложения */
.install-link { display: flex; align-items: center; gap: 8px; margin: 0 10px 8px; padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: #e9ebef; font-size: 13px; }
.install-link:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); text-decoration: none; }
/* установленное приложение: отступы под вырез экрана телефона */
@media (display-mode: standalone) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .main { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}
/* телефон и планшет: горячих клавиш нет — прячем подсказки, кнопки в подвале формы переносятся */
@media (hover: none), (max-width: 980px) {
  kbd { display: none; }
  .hk { padding-right: 14px; }
  .modal-foot { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .modal-foot { flex-direction: column-reverse; align-items: stretch; }
  .modal-foot .btn { width: 100%; height: 44px; justify-content: center; }
}
/* лиды */
.lead-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.lead-bar .search { flex: 0 1 300px; }
.lead { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: grid; gap: 6px; }
.lead-top { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.lead-who { display: flex; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; }
.lead-phone { font-weight: 600; }
.lead-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lead-note { background: #fffaf0; border: 1px solid #f3dfb8; border-radius: 6px; padding: 6px 10px; white-space: pre-line; }
.lead-photo { max-width: 160px; max-height: 120px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; }
.lead-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 640px) {
  .lead-bar .search { flex: 1 1 100%; }
  .lead-actions .btn { height: 40px; flex: 1 1 auto; }
  .lead-actions .btn.ghost { flex: 0 0 auto; }
}
/* лиды */
.lead-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.lead-bar .search { flex: 0 1 300px; }
.lead { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: grid; gap: 6px; }
.lead-top { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.lead-who { display: flex; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; }
.lead-phone { font-weight: 600; }
.lead-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lead-note { background: #fffaf0; border: 1px solid #f3dfb8; border-radius: 6px; padding: 6px 10px; white-space: pre-line; }
.lead-photo { max-width: 160px; max-height: 120px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; }
.lead-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 640px) {
  .lead-bar .search { flex: 1 1 100%; }
  .lead-actions .btn { height: 40px; flex: 1 1 auto; }
  .lead-actions .btn.ghost { flex: 0 0 auto; }
}
/* широкие таблицы не раздвигают колонки сетки: прокручиваются внутри своей карточки */
.grid > *, .stack > * { min-width: 0; }
/* карточка сотрудника */
.sal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.perm-cols { margin-top: 10px; columns: 2; column-gap: 24px; }
@media (max-width: 640px) {
  .sal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perm-cols { columns: 1; }
}
.sal-grid > .f { display: flex; flex-direction: column; justify-content: flex-end; }
/* фильтр заказов на телефоне: кнопка + список снизу экрана */
.ofilter-m { display: none; }
.of-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center; font-size: 12px; line-height: 1; color: var(--accent); }
@media (max-width: 640px) {
  [data-filters], [data-types] { display: none !important; }
  .ofilter-m { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; text-align: left; }
  .ofilter-m:active { background: #f0f2f5; }
  .ofilter-m .of-label { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ofilter-m .of-count { min-width: 26px; padding: 2px 8px; border-radius: 20px; background: #eef0f3; color: var(--ink-2); font-size: 13px; text-align: center; }
  .ofilter-m .of-caret { color: var(--muted); font-size: 12px; }
}
.sheet-back { position: fixed; inset: 0; z-index: 200; background: rgba(15, 17, 21, 0); transition: background .2s; display: flex; align-items: flex-end; }
.sheet-back.open { background: rgba(15, 17, 21, .45); }
.sheet { width: 100%; max-height: 82vh; overflow-y: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 6px 10px calc(14px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; box-shadow: 0 -8px 30px rgba(0,0,0,.15); }
.sheet-back.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: #d5d9e0; margin: 4px auto 10px; }
.sheet-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 8px 4px; }
.sheet-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 10px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 15.5px; color: var(--ink); cursor: pointer; text-align: left; }
.sheet-item:active { background: #f0f2f5; }
.sheet-item.on { background: var(--accent-soft); font-weight: 600; }
.sheet-label { flex: 1; }
.sheet-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.sheet-check { color: var(--accent); font-weight: 700; }
.sheet-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: #eef0f3; border-radius: 10px; margin: 0 2px 4px; }
.sheet-types button { height: 36px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.sheet-types button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
