@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/raleway-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/raleway-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/raleway-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/raleway-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/raleway-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root, html[data-style="official"], html.theme-light {
  --ink: #243044;
  --muted: #667085;
  --line: #e4e7ed;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --aside: #ffffff;
  --hover: #eef3ff;
  --ghost: #eef1f6;
  --green: #1f9d55;
  --blue: #2f6fed;
  --pink: #fdecee;
  --red: #c0392b;
  --warn: #fff6df;
  --ring: #243044;
  --stm-bg: #ffffff;
  --stm-bd: #e4e7ed;
  font: 15px/1.45 "Raleway", "Segoe UI", sans-serif;
  font-weight: 400;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.auth { max-width: 460px; margin: 8vh auto; background: var(--panel); border-radius: 16px; padding: 28px; box-shadow: 0 8px 30px rgba(20,30,50,.08); }
.auth.wide { max-width: 760px; }
.auth h1 { margin: 0 0 8px; font-weight: 500; }
.auth .logo { height: 36px; width: auto; margin-bottom: 16px; display: block; }
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
aside { background: var(--aside); border-right: 1px solid var(--line); padding: 16px 12px 32px; }
.brand { font-weight: 500; letter-spacing: .02em; font-size: 22px; }
.brand .logo { height: 34px; width: auto; display: block; margin: 0 0 10px; }
.point-name { font-size: 14px; font-weight: 500; margin: 0; }
.addr { color: var(--muted); font-size: 12px; margin: 4px 0 8px; font-weight: 400; }
nav a, nav .group { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-weight: 400; }
nav a.active, nav a:hover { background: var(--hover); }
nav .group { margin-top: 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
nav a.exit { margin-top: 14px; }
main { padding: 22px; }
.panel { background: var(--panel); border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(20,30,50,.04); }
.rowline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 500; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--blue); font-weight: 500; border-bottom: 1px solid #dfe3ea; }
th a { color: var(--blue); font-weight: 500; }
tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 1px solid var(--line); }
tr.unpaid { background: var(--pink); }
tr.warn { background: var(--warn); }
.switch { display: block; margin: 0 0 14px; font-size: 13px; }
.site-link { display: block; margin: 0 0 6px; }
.thumb { width: 86px; height: 58px; object-fit: cover; border-radius: 6px; background: #eee; display: block; }
.badge.ok { background: var(--green); color: #fff; }
.badge.wait { background: #f3e2b3; color: #8a5a00; }
.btn, button.btn { border: 0; border-radius: 8px; padding: 8px 12px; background: var(--green); color: #fff; display: inline-block; font-weight: 500; }
.btn.blue { background: var(--blue); }
.btn.ghost { background: var(--ghost); color: var(--ink); }
.btn.orange { background: #e6a117; }
.field { display: grid; grid-template-columns: 220px 1fr; gap: 8px 14px; align-items: start; margin: 8px 0; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.radios label { margin-right: 12px; display: inline-flex; gap: 4px; align-items: center; }
.badge { border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #eee; font-weight: 500; }
.badge.bad { background: #f8d0d4; color: var(--red); }
.cat { display: inline-block; font-size: 11px; font-weight: 600; color: #5b6b8a; background: #eef1f6; border-radius: 4px; padding: 0 5px; margin-right: 4px; vertical-align: middle; }
.unpaid-label { color: #e35d6a; font-size: 13px; font-weight: 500; margin-top: 2px; }
.col-num { white-space: nowrap; }
.col-num a { font-weight: 500; }
.slot { white-space: nowrap; }
.debt { background: #e35d6a; color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 500; }
.tabs { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.tabs a { padding: 8px 10px; border-radius: 8px 8px 0 0; color: var(--ink); }
.tabs a.on { background: var(--panel); box-shadow: inset 0 -2px 0 var(--blue); }
.note { color: var(--muted); font-size: 13px; }
.error { color: var(--red); }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; background: #eee; }
.companies { display: grid; gap: 12px; margin-top: 12px; }
.company-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.company-card.current { border-color: var(--green); }
.company-card h2 { font-size: 18px; margin: 6px 0; }
.barline { display: grid; grid-template-columns: 110px 1fr 70px; gap: 8px; align-items: center; margin: 8px 0; }
.bar { display: block; height: 14px; border-radius: 99px; background: var(--blue); min-width: 2px; }
.bar.alt { background: var(--green); }
.tabs a.on.ext, a.btn.orange { color: #fff; }

.foot { margin-top: 28px; color: var(--muted); font-size: 13px; }
.tgl { position: relative; display: inline-block; width: 42px; height: 24px; }
.tgl input { opacity: 0; width: 0; height: 0; }
.tgl span { position: absolute; inset: 0; background: #d5d8e0; border-radius: 99px; }
.tgl span:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; }
.tgl input:checked + span { background: #2f6fed; }
.tgl input:checked + span:before { left: 21px; }
.fold { display: none; }
.fold.open { display: block; }
.pill, .readonly { display: inline-block; background: var(--ghost); border-radius: 8px; padding: 8px 10px; }
.warnbox { background: #fdecee; color: #9a3b4a; border-radius: 8px; padding: 8px 10px; margin: 8px 0 8px 234px; }
.btn.pink { background: #e35d6a; }
.mini { padding: 4px 6px; background: transparent; color: var(--blue); }
.blank-sheet { border: 1px dashed var(--muted); padding: 16px; margin: 12px 0; background: var(--panel); }
.blank-sheet.lit [data-field], .blank-sheet.lit b { background: #ffe08a; }
.blank-sheet { font-family: "Times New Roman", Times, serif; color: #1c1c1c; }
.blank-sheet table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.blank-sheet td, .blank-sheet th { border: 1px solid #222; padding: 4px 6px; vertical-align: top; }
.blank-sheet .row { display: flex; gap: 12px; flex-wrap: wrap; }
.blank-sheet .col-3, .blank-sheet .col-4, .blank-sheet .col-5, .blank-sheet .col-6, .blank-sheet .col-8 { flex: 1; min-width: 140px; }
.blank-sheet .col-8 { flex: 2; }
.blank-sheet .text-center { text-align: center; }
.blank-sheet .text-end, .blank-sheet .text-right { text-align: right; }
.blank-sheet .text-justify, .blank-sheet .para { text-align: justify; }
.blank-sheet .para { text-indent: 1.5em; }
.blank-sheet .small { font-size: 12px; }
.blank-sheet .d-none { display: none; }
.blank-page { background: var(--panel); }
.qr-box svg { width: 220px; height: 220px; display: block; }
.sheet-date { float: right; }
.sheet-h { text-align: center; font-weight: 700; }
.tabbtn { border: 0; background: transparent; padding: 8px 10px; color: var(--ink); }
.modal-page { display: flex; justify-content: center; }
.modal-card { width: min(640px, 100%); background: var(--panel); border-radius: 12px; padding: 8px 0; box-shadow: 0 8px 30px rgba(20,30,50,.12); }
.company-row { display: block; width: 100%; text-align: left; background: var(--panel); border: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; color: inherit; }
.company-row.current { background: #f7fbf8; }
table.totals td { font-size: 16px; }

/* ---- Верхняя и нижняя панели (только телефон) ---- */
.topbar, .bottombar, .nav-shade { display: none; }

/* ---- Задачи ---- */
.task-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.task-form input, .task-form select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.task-form input[name=title] { flex: 1 1 260px; }
.tasks { list-style: none; padding: 0; margin: 8px 0; }
.task { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; animation: task-in .35s ease both; }
.task-title { font-weight: 500; }
.task-state { font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 10px; align-self: start; background: #eef1f6; color: var(--muted); }
.task-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.task-actions form { margin: 0; }
.task-actions .btn { padding: 5px 10px; font-size: 13px; }
.task-time { height: 3px; background: #eef1f6; border-radius: 99px; margin-top: 8px; overflow: hidden; max-width: 320px; }
.task-time span { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width 1s ease; }
.task-overdue { border-left-color: #e35d6a; background: var(--pink); animation: task-in .35s ease both, overdue-glow 2.4s ease-in-out 0.4s infinite; }
.task-overdue .task-state { background: #e35d6a; color: #fff; }
.task-soon { border-left-color: #e6a117; }
.task-soon .task-state { background: #fbe9c3; color: #8a5a00; }
.task-soon .task-time span { background: #e6a117; }
.task-today .task-state { background: #e4ecff; color: var(--blue); }
.task-done { opacity: .6; }
.task-done .task-title { text-decoration: line-through; }
@keyframes task-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes overdue-glow { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(227,93,106,0); } 50% { box-shadow: inset 4px 0 0 0 rgba(227,93,106,.35); } }

/* ---- Страница помощника ---- */
.assistant-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.pulse-ring { position: relative; width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; background: var(--ring); color: #fff; display: grid; place-items: center; }
.assistant-hero.is-soon .pulse-ring { background: #e6a117; }
.assistant-hero.is-overdue .pulse-ring { background: #e35d6a; }
.assistant-hero.is-soon .pulse-ring::after, .assistant-hero.is-overdue .pulse-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; color: inherit; animation: ring-out 1.8s ease-out infinite; }
.assistant-hero.is-overdue .pulse-ring::after { border-color: #e35d6a; }
.assistant-hero.is-soon .pulse-ring::after { border-color: #e6a117; }
.assistant-hero.is-soon .pulse-ring svg, .assistant-hero.is-overdue .pulse-ring svg { animation: bell-swing 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.assistant-tools { margin-bottom: 6px; }
@keyframes ring-out { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
@keyframes bell-swing { 0%, 60%, 100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); } 30% { transform: rotate(8deg); } 40% { transform: rotate(-5deg); } 50% { transform: rotate(2deg); } }

/* ---- Плавающий помощник ---- */
.helper { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.helper-btn { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--ring); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(20,30,50,.25); transition: transform .2s ease; }
.helper-btn:hover { transform: translateY(-2px); }
.helper[data-state=soon] .helper-btn { background: #e6a117; }
.helper[data-state=overdue] .helper-btn { background: #e35d6a; }
.helper[data-state=soon] .helper-btn svg, .helper[data-state=overdue] .helper-btn svg { animation: bell-swing 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.helper[data-state=overdue] .helper-btn::after, .helper[data-state=soon] .helper-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid; border-color: inherit; animation: ring-out 1.8s ease-out infinite; }
.helper[data-state=overdue] .helper-btn::after { border-color: #e35d6a; }
.helper[data-state=soon] .helper-btn::after { border-color: #e6a117; }
.helper-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #fff; color: #c0392b; font-size: 12px; font-weight: 600; line-height: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.helper-panel { position: absolute; right: 0; bottom: 64px; width: 340px; max-width: calc(100vw - 24px); background: var(--panel); border-radius: 14px; box-shadow: 0 12px 40px rgba(20,30,50,.22); padding: 12px 14px; opacity: 0; transform: translateY(10px) scale(.98); transform-origin: bottom right; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.helper.open .helper-panel { opacity: 1; transform: none; pointer-events: auto; }
.helper-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.helper-head b { font-weight: 500; }
.helper-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0 8px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid #d5d8e0; animation: task-in .3s ease both; transition: opacity .25s ease, transform .25s ease; }
.helper-item.s-overdue { border-left-color: #e35d6a; }
.helper-item.s-soon { border-left-color: #e6a117; }
.helper-item.leaving { opacity: 0; transform: translateX(20px); }
.helper-title { font-size: 14px; font-weight: 500; }
.helper-done { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--green); font-size: 16px; }
.helper-foot { margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Планшет и телефон ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .field { grid-template-columns: 1fr; }
  .warnbox { margin-left: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px; height: 54px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .topbar .logo { height: 26px; width: auto; }
  .topbar-title { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .burger { width: 40px; height: 40px; display: grid; align-content: center; gap: 5px; padding: 0 9px; cursor: pointer; }
  .burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
  aside { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 86vw; z-index: 50; overflow-y: auto; transform: translateX(-102%); transition: transform .25s ease; box-shadow: 0 0 30px rgba(20,30,50,.2); }
  .navtoggle:checked ~ aside { transform: none; }
  .navtoggle:checked ~ .nav-shade { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(20,30,50,.35); }
  main { padding: 12px 10px 96px; min-width: 0; }
  .panel { padding: 14px 12px; border-radius: 12px; }
  h1 { font-size: 22px; }
  .rowline > input, .rowline > label { max-width: 100%; }
  .rowline input[type=date] { max-width: 150px; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; height: 60px; padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); }
  .bottombar a, .bottombar label { flex: 1; display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
  .bottombar a.on { color: var(--blue); box-shadow: inset 0 2px 0 var(--blue); }
  .helper { right: 14px; bottom: 74px; }
  .helper-btn { width: 48px; height: 48px; }
  .foot { margin-bottom: 8px; }
  .task-form input, .task-form select, .task-form .btn { flex: 1 1 100%; }
}

/* Таблицы заказов и клиентов — карточки на узком экране */
@media (max-width: 720px) {
  table.cards, table.cards tbody { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  table.cards td { border: 0; padding: 2px 0; min-width: 0; overflow-wrap: anywhere; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  table.cards td.col-empty { display: none; }
  table.cards td.col-car { grid-column: 1 / -1; font-size: 16px; }
  table.orders-table tr { grid-template-columns: 96px 1fr 1fr; }
  table.orders-table td.col-photo { grid-column: 1; grid-row: 1 / span 2; }
  .orders-table td.col-photo .thumb { width: 96px; height: 68px; }
  table.orders-table td.col-num { grid-column: 2; grid-row: 1; }
    table.orders-table td.slot { grid-column: 3; grid-row: 1; }
  table.orders-table td.col-car { grid-column: 2 / -1; grid-row: 2; }
  tr.unpaid { border-radius: 8px; }
}

/* ---- ИНН и юрлицо ---- */
.inn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inn-row input { flex: 1 1 180px; min-width: 0; max-width: 260px; }
.inn-row .btn { flex: 0 0 auto; }
.org-block { display: none; margin: 8px 0 16px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.org-block.open { display: block; }

/* ---- Ползунок размера фото ---- */
.kb-slider { display: grid; gap: 6px; max-width: 440px; width: 100%; }
.kb-slider input[type=range] { width: 100%; accent-color: var(--blue); }
.kb-value { font-weight: 500; }

/* ---- Переключатель тем (как на скупке и to.on-ok.ru) ---- */
.theme-dock { position: fixed; top: 12px; right: 12px; z-index: 70; }
.stw { position: relative; }
.stw .hi { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 "Raleway", sans-serif; background: var(--hover); color: var(--blue); border: 2px solid var(--blue); border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
.stw .hi:hover { background: var(--blue); color: #fff; }
.stw .hi svg { flex: 0 0 20px; }
.aside-theme .stw .hi { width: 100%; }
.stm { position: absolute; right: 0; top: calc(100% + 8px); background: var(--stm-bg); border: 1px solid var(--stm-bd); border-radius: 10px; padding: 8px; min-width: 200px; z-index: 80; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 10px 30px rgba(20,30,50,.14); }
.stm[hidden] { display: none !important; }
.stm button { font: 400 13px/1.3 "Raleway", sans-serif; background: transparent; color: var(--ink); border: 0; text-align: left; padding: 7px 8px; cursor: pointer; border-radius: 6px; }
.stm button.on, .stm button:hover { background: var(--hover); color: var(--blue); }
.stm hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.aside-theme { margin: 0 0 14px; }
.aside-theme .stm { left: 0; right: auto; }
.theme-dock .stm, .topbar .stm { right: 0; left: auto; }
@media (max-width: 900px) {
  .topbar { max-width: 100vw; }
  .topbar-title { flex: 1 1 auto; min-width: 0; }
  .topbar .stw { margin-left: auto; flex: 0 0 auto; }
  .shell .theme-dock { display: none; }
  aside .aside-theme { display: none; }
}

html[data-style="city"] {
  --ink: #1e2a44;
  --muted: #5b6b86;
  --line: #d9e1ee;
  --bg: #eef2f8;
  --panel: #ffffff;
  --aside: #f7f9fc;
  --hover: #e7eefc;
  --ghost: #e8eef8;
  --blue: #2563eb;
  --green: #0f9f6e;
  --pink: #fde8ec;
  --ring: #1e2a44;
}
html[data-style="warm"] {
  --ink: #2c241c;
  --muted: #7a6d5e;
  --line: #e6ddd0;
  --bg: #f6f0e6;
  --panel: #fffcf7;
  --aside: #fbf6ee;
  --hover: #f3e8d6;
  --ghost: #f0e6d6;
  --blue: #b45309;
  --green: #3f7d4e;
  --pink: #f8e6e2;
  --red: #b42318;
  --ring: #3b2f24;
  --stm-bg: #fffcf7;
}
html[data-style="contrast"] {
  --ink: #101218;
  --muted: #3a4250;
  --line: #c5cad3;
  --bg: #e8eaee;
  --panel: #ffffff;
  --aside: #ffffff;
  --hover: #dce6ff;
  --ghost: #dce0e8;
  --blue: #0b57d0;
  --green: #0b7a3b;
  --pink: #ffd5da;
  --red: #9b1c1c;
  --ring: #000000;
}

html.theme-dark {
  --ink: #e8edf5;
  --muted: #9aa3b2;
  --line: #2c3444;
  --bg: #12161e;
  --panel: #1a2030;
  --aside: #161b27;
  --hover: #243049;
  --ghost: #242b3a;
  --blue: #6b93ff;
  --green: #3dba70;
  --pink: #3a2428;
  --red: #f07a7a;
  --warn: #3a3420;
  --ring: #2a3144;
  --stm-bg: #1a2030;
  --stm-bd: #2c3444;
}
html.theme-dark[data-style="city"] {
  --bg: #10151f;
  --panel: #182033;
  --aside: #141b2b;
  --hover: #1e2c4c;
  --blue: #6ea0ff;
  --line: #2a3650;
}
html.theme-dark[data-style="warm"] {
  --ink: #f4ece2;
  --muted: #b5a894;
  --line: #3a322a;
  --bg: #1b1713;
  --panel: #26201a;
  --aside: #201b16;
  --hover: #3a3024;
  --ghost: #322b24;
  --blue: #e0a05a;
  --green: #6fbf7a;
  --pink: #3a2824;
  --ring: #3a3228;
  --stm-bg: #26201a;
}
html.theme-dark[data-style="contrast"] {
  --ink: #ffffff;
  --muted: #c5c9d2;
  --line: #4a5060;
  --bg: #000000;
  --panel: #12141a;
  --aside: #0a0b0e;
  --hover: #1a2744;
  --ghost: #1c2028;
  --blue: #8cb0ff;
  --green: #4ad07a;
  --pink: #4a1c22;
  --ring: #ffffff;
}
html.theme-dark .logo { background: #fff; border-radius: 6px; padding: 2px 6px; }

/* ---- Меню: пиктограммы как в старом кабинете ---- */
nav a, nav .exit { display: flex; align-items: center; gap: 8px; }
nav a .nav-ico, nav .group .nav-ico, .exit .nav-ico { flex: 0 0 18px; opacity: .75; }
nav .group { display: flex; align-items: center; gap: 8px; }

/* ---- Живые часы ---- */
.live-clock, .clock-bar { font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: .01em; }
aside .live-clock { margin: 4px 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ghost); font-size: 13px; text-align: center; }
.clock-bar { display: none; }
.theme-dock .live-clock, .auth-clock { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
@media (max-width: 900px) {
  .clock-bar { display: flex; align-items: center; justify-content: center; position: sticky; top: 54px; z-index: 25; height: 28px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 12px; }
  aside .live-clock { margin-bottom: 10px; }
}

/* ---- Страница тем ---- */
.theme-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 12px 0 20px; }
.theme-card, .theme-mode { display: flex; flex-direction: column; gap: 8px; text-align: left; background: var(--panel); color: inherit; border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; }
.theme-card.on, .theme-mode.on { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.theme-preview { display: grid; grid-template-columns: 28px 1fr; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid #d8dde6; }
.theme-preview .tp-aside { background: #fff; border-right: 1px solid #e4e7ed; }
.theme-preview .tp-main { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.theme-preview .tp-bar { height: 10px; border-radius: 4px; width: 70%; }
.theme-preview .tp-line { height: 6px; border-radius: 3px; width: 90%; background: #d9dde6; }
.theme-preview-official { background: #f3f5f8; }
.theme-preview-official .tp-bar { background: #2f6fed; }
.theme-preview-city { background: #eef2f8; }
.theme-preview-city .tp-aside { background: #f7f9fc; }
.theme-preview-city .tp-bar { background: #2563eb; }
.theme-preview-warm { background: #f6f0e6; }
.theme-preview-warm .tp-aside { background: #fbf6ee; }
.theme-preview-warm .tp-bar { background: #b45309; }
.theme-preview-contrast { background: #e8eaee; }
.theme-preview-contrast .tp-bar { background: #0b57d0; }
.theme-preview-contrast .tp-line { background: #101218; }
.theme-mode { min-height: 52px; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; }
.stm i { width: 22px; height: 22px; border-radius: 7px; flex: none; display: inline-block; }
.stm button { display: flex; gap: 10px; align-items: center; }
.sw-official { background: linear-gradient(135deg, #fff 50%, #2f6fed 50%); border: 1px solid #ccd; }
.sw-city { background: linear-gradient(135deg, #eef2f8 50%, #2563eb 50%); }
.sw-warm { background: linear-gradient(135deg, #f6f0e6 50%, #b45309 50%); }
.sw-contrast { background: linear-gradient(135deg, #fff 50%, #0b57d0 50%); border: 1px solid #333; }
.stm-link { display: block; padding: 8px; font-size: 13px; color: var(--blue); font-weight: 500; }

/* ---- Аналитика: итоги ---- */
.mode-switch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.stat-card { background: var(--ghost); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 22px; font-weight: 600; line-height: 1.2; }
table.totals td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.totals tr:last-child td { font-size: 16px; }
.picto { display: inline-flex; vertical-align: middle; margin-right: 4px; opacity: .7; }

/* ---- Документы юрлиц ---- */
.sign-preview { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 8px 0 16px; }
.sign-preview img { max-height: 120px; max-width: 200px; background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 6px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 900px) {
  .stat-card .stat-value { font-size: 18px; }
  .stw .hi { padding: 8px 10px; min-height: 40px; }
}

@media (max-width: 720px) {
  main { max-width: 100vw; overflow-x: auto; }
  .panel { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sign-preview img { max-width: min(200px, 42vw); }
}

/* 2355: larger totals, document cards, install app */
.stat-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.stat-card { padding: 16px 16px 14px; box-shadow: 0 8px 22px rgba(20,30,50,.05); background: var(--panel); }
.stat-card .stat-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.stat-card.featured { grid-column: span 2; background: linear-gradient(180deg, var(--panel), var(--ghost)); border: 2px solid var(--blue); }
.stat-card.featured .stat-value { font-size: 32px; color: var(--blue); }
.stat-card.accent { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.stat-cards-lg { margin-top: 4px; }
.person-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 0 0 18px; }
.person-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.person-card b { font-size: 15px; }
.person-card span { color: var(--muted); font-size: 13px; }
.person-card strong { font-size: 22px; font-weight: 600; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 8px 0 22px; }
.doc-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 10px 24px rgba(20,30,50,.06); min-width: 0; }
.doc-card h3 { margin: 0; font-size: 22px; font-weight: 600; }
.doc-kind { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.doc-card.kind-act .doc-kind { color: #2a7a4a; }
.doc-card.kind-upd .doc-kind { color: #8a5a12; }
.doc-meta, .doc-service { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.doc-sum { font-size: 28px; font-weight: 600; margin: 4px 0 8px; }
.doc-card .doc-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.doc-card .doc-actions .btn { min-width: 96px; text-align: center; justify-content: center; }
.sign-hero { gap: 20px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--ghost); }
.sign-shot { display: flex; flex-direction: column; gap: 6px; }
.sign-shot img { max-height: 140px; max-width: 220px; background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0 6px 16px rgba(20,30,50,.08); }
.doc-link { font-size: 13px; font-weight: 600; }
.install-app { display: flex; align-items: center; justify-content: center; margin: 8px 10px 12px; padding: 10px 12px; min-height: 42px; border: 2px solid var(--blue); border-radius: 12px; color: var(--blue); font-weight: 600; font-size: 14px; text-decoration: none; background: var(--panel); }
.install-app:hover, .install-app:focus { background: var(--hover); }
.install-app.is-installed { border-color: var(--line); color: var(--muted); font-weight: 500; }
.install-hint { position: fixed; inset: 0; z-index: 80; display: grid; place-items: end center; }
.install-hint[hidden] { display: none; }
.install-hint-shade { position: absolute; inset: 0; background: rgba(16,22,32,.45); }
.install-hint-card { position: relative; z-index: 1; width: min(480px, 100%); background: var(--panel); border-radius: 16px 16px 0 0; padding: 20px 20px 28px; box-shadow: 0 -12px 40px rgba(16,22,32,.2); }
.install-hint-card h2 { margin: 0 32px 10px 0; }
.install-hint-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; background: var(--ghost); border-radius: 18px; font-size: 22px; cursor: pointer; color: var(--ink); }
@media (min-width: 721px) {
  .install-hint { place-items: center; }
  .install-hint-card { border-radius: 16px; }
}
@media (max-width: 720px) {
  .stat-card.featured { grid-column: span 1; }
  .stat-card .stat-value, .person-card strong, .doc-sum { font-size: 24px; }
  .stat-card.featured .stat-value { font-size: 26px; }
  .doc-grid { grid-template-columns: 1fr; }
}

.sheet-edit { width: 100%; }
.sheet-edit input { width: 100%; box-sizing: border-box; }


/* Превью в таблицах */
.photo-preview { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--ghost); display: block; }

/* Аналитика: графики и читаемый тёмный режим */
.analytics-filters, .chart-period { flex-wrap: wrap; gap: 8px; align-items: center; }
.chart-period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.chart-card { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 10px; margin: 0 0 16px; }
.chart-card h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: var(--ink); }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--ink); font-size: 11px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; color: var(--ink); font-size: 13px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-bar-0 { fill: var(--blue); background: var(--blue); }
.chart-bar-1 { fill: var(--green); background: var(--green); }
.chart-bar-2 { fill: var(--red); background: var(--red); }
.stat-card, .person-card { color: var(--ink); background: var(--panel); }
.stat-card .stat-value, .person-card strong, .barline, .barline span, .barline b { color: var(--ink); }
.stat-card.featured .stat-value { color: var(--blue); }
html.theme-dark { color-scheme: dark; }
html.theme-dark input, html.theme-dark select, html.theme-dark textarea {
  background: var(--ghost);
  color: var(--ink);
  border-color: var(--line);
  color-scheme: dark;
}
html.theme-dark th { border-bottom-color: var(--line); color: var(--blue); }
html.theme-dark table { color: var(--ink); background: transparent; }
html.theme-dark .sheet-edit input { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }


.perm-list { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; margin: 14px 0 18px; }
.perm-list legend { padding: 0 6px; font-weight: 600; }
.perm-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.perm-item:last-of-type { border-bottom: 0; }
.perm-item b { display: block; }
.perm-item small { display: block; color: var(--muted); font-size: 12px; }


.icon-btn { width: 40px; min-width: 40px; height: 40px; padding: 8px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { display: block; }
.order-search:has(#advsearch:checked) label[for="advsearch"] { background: var(--blue); color: #fff; }
.adv-search .rowline input { width: 140px; max-width: 45%; }
.adv-search { display: none; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 16px; }
.order-search:has(#advsearch:checked) .adv-search { display: block; }
.th-sort { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; }
.sort-arrows { display: inline-flex; flex-direction: column; line-height: 1; margin-left: 4px; vertical-align: middle; }
.sort-arrows a { color: var(--muted); font-size: 11px; text-decoration: none; line-height: 1; }
.sort-arrows a.on { color: var(--blue); font-weight: 700; }


/* Журнал и пароль — общее, без смены десктопной сетки тем */
.pass-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pass-row input[type=password], .pass-row input[type=text] { flex: 1 1 180px; min-width: 0; }
.show-pass { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; }
.journal { margin-top: 22px; }
.journal-table { font-size: 14px; }
.actors { font-size: 12px; }

@media (min-width: 601px) { .order-more { display: none; } }

/* Компактный список заказов и ровные карточки только на телефоне */
@media (max-width: 600px) {
  main { padding: 8px 8px 96px; overflow-x: hidden; }
  .panel { padding: 10px 10px; }
  h1 { font-size: 18px; }
  table.orders-table tr {
    display: grid;
    grid-template-columns: 64px 1fr 1fr;
    gap: 2px 8px;
    padding: 8px 0;
  }
  table.orders-table td { padding: 1px 0; font-size: 13px; }
  table.orders-table td.col-photo { grid-column: 1; grid-row: 1 / span 3; }
  .orders-table td.col-photo .thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
  table.orders-table td.col-num { grid-column: 2; grid-row: 1; font-size: 14px; }
  table.orders-table td.slot { grid-column: 3; grid-row: 1; font-size: 12px; }
  table.orders-table td.col-car { grid-column: 2 / -1; grid-row: 2; font-size: 14px; }
  table.orders-table td.col-client { grid-column: 2; grid-row: 3; }
  table.orders-table td.col-amount, table.orders-table td.col-total { grid-column: 3; grid-row: 3; font-size: 13px; }
  table.orders-table td.col-extra, table.orders-table td.order-id, .orders-table .order-id { display: none; }
  table.orders-table td.col-staff { grid-column: 2 / -1; grid-row: 4; font-size: 12px; }
  table.orders-table td.col-staff .actors { display: none; }
  .order-more { margin-top: 2px; }
  .order-more summary { color: var(--blue); cursor: pointer; font-size: 12px; }
  .order-more div { color: var(--muted); font-size: 12px; }
  .unpaid-label { font-size: 11px; margin-top: 0; }

  .order-card-form .field, .client-card-form .field {
    grid-template-columns: 1fr;
    gap: 4px;
    margin: 8px 0;
  }
  .order-card-form .field > span:first-child, .client-card-form .field > span:first-child {
    font-size: 12px; color: var(--muted);
  }
  .order-card-form input, .order-card-form select, .order-card-form textarea,
  .client-card-form input, .client-card-form select, .client-card-form textarea,
  .pay-block input, .pay-block select {
    width: 100%; min-height: 40px; box-sizing: border-box;
  }
  .pay-block { display: grid; gap: 8px; margin: 8px 0; }
  .pay-block .radios { display: grid; gap: 8px; }
  .pay-block .radios label {
    display: flex; align-items: center; width: 100%;
    min-height: 40px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 8px;
    box-sizing: border-box;
  }
  .order-card-form .rowline, .client-card-form .rowline {
    display: grid; grid-template-columns: 1fr; gap: 8px; align-items: stretch;
  }
  .order-card-form .btn, .client-card-form .btn,
  .order-card-form button.btn, .client-card-form button.btn {
    width: 100%; box-sizing: border-box; text-align: center;
  }
  .tabs { gap: 4px; }
  .tabs a { padding: 8px; font-size: 13px; }
}

/* --- сборка 0240: разделы, дерево меню, бланки, инструкция --- */
.section-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line, #d5dde3);
  background: var(--panel, #fff);
}
.section-banner b { font-size: 15px; letter-spacing: .02em; }
.section-banner span { font-size: 13px; opacity: .85; }
main.is-orders .section-banner { border-left: 5px solid #1b6ea8; background: color-mix(in srgb, #1b6ea8 8%, var(--panel, #fff)); }
main.is-clients .section-banner { border-left: 5px solid #2a8f6f; background: color-mix(in srgb, #2a8f6f 8%, var(--panel, #fff)); }
main.is-money .section-banner { border-left: 5px solid #c48a14; background: color-mix(in srgb, #c48a14 10%, var(--panel, #fff)); }
main.is-docs .section-banner { border-left: 5px solid #8a4ad4; background: color-mix(in srgb, #8a4ad4 8%, var(--panel, #fff)); }
main.is-staff .section-banner { border-left: 5px solid #c45a2a; background: color-mix(in srgb, #c45a2a 8%, var(--panel, #fff)); }
main.is-photos .section-banner { border-left: 5px solid #4a7dd4; background: color-mix(in srgb, #4a7dd4 8%, var(--panel, #fff)); }
main.is-tasks .section-banner { border-left: 5px solid #6a8a2a; background: color-mix(in srgb, #6a8a2a 8%, var(--panel, #fff)); }
main.is-stats .section-banner { border-left: 5px solid #2a8a8a; background: color-mix(in srgb, #2a8a8a 8%, var(--panel, #fff)); }
main.is-settings .section-banner { border-left: 5px solid #5a6570; background: color-mix(in srgb, #5a6570 8%, var(--panel, #fff)); }
.theme-dark main.is-orders .section-banner,
.theme-dark main.is-clients .section-banner,
.theme-dark main.is-money .section-banner,
.theme-dark main.is-docs .section-banner,
.theme-dark main.is-staff .section-banner,
.theme-dark main.is-photos .section-banner,
.theme-dark main.is-tasks .section-banner,
.theme-dark main.is-stats .section-banner,
.theme-dark main.is-settings .section-banner { background: color-mix(in srgb, var(--panel, #1b1f24) 86%, #000); }

details.nav-tree { margin: 0 0 6px; border: 0; }
details.nav-tree > summary.group {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
details.nav-tree > summary.group::-webkit-details-marker { display: none; }
details.nav-tree > summary.group::after {
  content: "▾";
  margin-left: auto;
  font-size: 11px;
  opacity: .7;
}
details.nav-tree:not([open]) > summary.group::after { content: "▸"; }
details.nav-tree .tree-items { display: flex; flex-direction: column; padding: 2px 0 6px 8px; }
button.tree-toggle {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 6px 8px;
  background: transparent;
  border: 1px dashed var(--line, #c5ced6);
  border-radius: 8px;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
button.tree-toggle:hover { background: color-mix(in srgb, var(--accent, #1b6ea8) 8%, transparent); }

.forms-bar {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line, #d5dde3);
  border-left: 5px solid #8a4ad4;
  border-radius: 10px;
  background: color-mix(in srgb, #8a4ad4 7%, var(--panel, #fff));
}
.forms-bar h2 { margin: 0 0 6px; font-size: 17px; }
.forms-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.forms-actions form { margin: 0; }
.theme-dark .forms-bar { background: color-mix(in srgb, #8a4ad4 16%, var(--panel, #1b1f24)); }

a.org-link { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.build-sign { font-weight: 700; letter-spacing: .01em; }
footer.foot .build-sign { white-space: nowrap; }
.guide.settings-help, .panel.guide, div.guide {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line, #d5dde3);
}
.guide h2 { margin: 14px 0 6px; font-size: 16px; }
.guide ul { margin: 8px 0 0; padding-left: 18px; }
.guide li { margin: 0 0 6px; }
.client-jumps { flex-wrap: wrap; margin: 8px 0 12px; }
.client-jumps .btn { min-height: 40px; }
.saved-note { font-weight: 600; }
table.staff-table { overflow-x: auto; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
  .forms-actions, .doc-actions, .client-jumps { display: grid; grid-template-columns: 1fr; }
  .forms-actions .btn, .doc-actions .btn, .client-jumps .btn { width: 100%; text-align: center; }
  .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .tabs a { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 10px; }
  table.staff-table { display: block; overflow-x: auto; }
}

/* --- сборка 0300: явные линии разделов и сворачивание --- */
details.nav-tree {
  margin: 8px 0 10px;
  padding: 0 0 6px;
  border: 1px solid var(--line, #c5ced6);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel, #fff) 88%, var(--line, #c5ced6));
}
details.nav-tree + details.nav-tree { margin-top: 10px; }
details.nav-tree > summary.group {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line, #c5ced6);
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink, inherit);
}
details.nav-tree:not([open]) > summary.group { border-bottom: 0; border-radius: 8px; }
details.nav-tree > summary.group::-webkit-details-marker { display: none; }
details.nav-tree > summary.group::after {
  content: "свернуть ▾";
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: .85;
  white-space: nowrap;
}
details.nav-tree:not([open]) > summary.group::after { content: "развернуть ▸"; }
details.nav-tree .tree-items { display: flex; flex-direction: column; padding: 4px 6px 6px; }
button.tree-toggle,
.btn.tree-toggle {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: var(--ghost, #eef1f6);
  border: 1px solid var(--line, #c5ced6);
  border-radius: 8px;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
button.tree-toggle:hover, .btn.tree-toggle:hover {
  background: color-mix(in srgb, var(--accent, #1b6ea8) 14%, var(--ghost, #eef1f6));
}

details.page-section {
  margin: 0 0 16px;
  border: 1px solid var(--line, #c5ced6);
  border-radius: 10px;
  background: var(--panel, #fff);
}
details.page-section > summary.page-section-head {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--line, #c5ced6);
  display: flex;
  align-items: center;
  gap: 8px;
}
details.page-section:not([open]) > summary.page-section-head { border-bottom: 0; }
details.page-section > summary.page-section-head::-webkit-details-marker { display: none; }
details.page-section > summary.page-section-head::after {
  content: "свернуть ▾";
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #667);
  white-space: nowrap;
}
details.page-section:not([open]) > summary.page-section-head::after { content: "развернуть ▸"; }
details.page-section .page-section-body { padding: 12px 14px 16px; }

.theme-dark details.nav-tree,
.theme-dark details.page-section { background: var(--panel, #1b1f24); }

.perm-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 3px;
  flex: none;
  accent-color: var(--blue, #2f6fed);
  pointer-events: auto;
  cursor: pointer;
}
.perm-item { cursor: pointer; }
a.org-link { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* --- сборка 1415: пошлины, касса, сотрудники, график, подвал, мобильный список, свайп поиска --- */
a.logo-link { display: inline-flex; align-items: center; }
footer.foot { line-height: 1.7; }
.duty-tabs a { padding: 2px 4px; }
.duty-tabs a.on { font-weight: 700; text-decoration: underline; }
.duty-table { width: 100%; border-collapse: collapse; }
.duty-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.duty-row { cursor: pointer; }
.duty-row:hover { background: var(--hover); }
.duty-check { width: 32px; }
.duty-check input { width: 18px; height: 18px; }
.duty-name b { font-weight: 700; }
.duty-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.duty-price { text-align: right; font-size: 20px; font-weight: 600; white-space: nowrap; }
.duty-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 14px 0 18px; font-size: 17px; }
.duty-sum b { font-size: 20px; }
.duty-go { margin-top: 6px; padding: 10px 24px; font-weight: 700; }
.staff-money { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0 0 14px; }
.staff-money h2 { margin: 0 0 8px; font-size: 16px; }
.staff-money tfoot th, .cash-table tfoot th { text-align: left; border-top: 2px solid var(--line); }
.cash-table td.num, .cash-table th.num { text-align: right; white-space: nowrap; }
.cash-table .wallet-row td { color: var(--muted); }
details.cash-new > summary { list-style: none; cursor: pointer; }
details.cash-new > summary::-webkit-details-marker { display: none; }
details.cash-new > summary h1 { margin: 12px 0; }
.cash-new-form { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.combo-bar, .combo-sw-bar { fill: #3b82f6; background: #3b82f6; }
.combo-avg { stroke: #22a55a; stroke-width: 2.2; }
.combo-avg-dot { fill: #22a55a; }
.combo-sum { stroke: #14b8b8; stroke-width: 2.2; }
.combo-sum-dot { fill: #14b8b8; }
.combo-sw-avg { background: #22a55a; }
.combo-sw-sum { background: #14b8b8; }
.combo-axis-avg { fill: #22a55a; }
.combo-axis-sum { fill: #14b8b8; }
.theme-dark .combo-bar, .theme-dark .combo-sw-bar { fill: #5b9cff; background: #5b9cff; }
.adv-handle { display: block; margin: 6px 0 0; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; cursor: pointer; color: var(--blue); font-size: 13px; user-select: none; }
.adv-handle small { color: var(--muted); }
.adv-handle .adv-opened { display: none; }
.order-search:has(#advsearch:checked) .adv-handle .adv-opened { display: inline; }
.order-search:has(#advsearch:checked) .adv-handle .adv-closed { display: none; }
@media (max-width: 600px) {
  .order-search { touch-action: pan-x pan-y; }
  table.orders-table tr.o-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    grid-template-areas: "photo car amount" "photo meta time";
    gap: 0 8px;
    padding: 6px 0;
    align-items: center;
    cursor: pointer;
  }
  table.orders-table tr.o-row td { padding: 0; font-size: 13px; line-height: 1.3; min-height: 0; }
  table.orders-table tr.o-row td::before { display: none; }
  table.orders-table tr.o-row td.col-photo { grid-area: photo; grid-row: 1 / span 2; grid-column: 1; }
  .orders-table tr.o-row td.col-photo .thumb, .orders-table tr.o-row td.col-photo img { width: 48px; height: 36px; object-fit: cover; border-radius: 5px; }
  table.orders-table tr.o-row td.col-car { grid-area: car; grid-column: 2; grid-row: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.orders-table tr.o-row td.col-car .cat, table.orders-table tr.o-row td.col-car .picto { display: none; }
  table.orders-table tr.o-row td.col-car .unpaid-label { display: none; }
  table.orders-table tr.o-row td.col-amount { grid-area: amount; grid-column: 3; grid-row: 1; font-weight: 600; text-align: right; }
  table.orders-table tr.o-row td.slot { grid-area: time; grid-column: 3; grid-row: 2; font-size: 12px; color: var(--muted); text-align: right; }
  table.orders-table tr.o-row td.col-client { grid-column: 2; grid-row: 2; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; display: inline; }
  table.orders-table tr.o-row td.col-staff { grid-column: 2; grid-row: 3; font-size: 12px; color: var(--muted); }
  table.orders-table tr.o-row td.col-num, table.orders-table tr.o-row td.col-extra, table.orders-table tr.o-row td.col-total { display: none; }
  table.orders-table tr.o-row .order-more { display: none; }
  table.orders-table tr.o-row.unpaid td.col-car::before { content: "● "; color: var(--red); display: inline; }
  table.orders-table tr.o-row.open { background: var(--hover); border-radius: 8px; padding: 6px 4px; }
  table.orders-table tr.o-row.open td.col-num, table.orders-table tr.o-row.open td.col-extra, table.orders-table tr.o-row.open td.col-total { display: block; grid-column: 1 / -1; font-size: 12px; grid-area: auto; }
  table.orders-table tr.o-row.open td.col-num, table.orders-table tr.o-row.open td.col-extra, table.orders-table tr.o-row.open td.col-total { grid-row: auto; grid-column: 1 / -1; padding-left: 56px; }
  table.orders-table tr.o-row.open td.col-extra::before, table.orders-table tr.o-row.open td.col-total::before { display: inline; content: attr(data-label) ": "; color: var(--muted); }
  table.orders-table tr.o-row.open .order-more { display: block; }
  table.orders-table tr.o-row.open .order-more > summary { display: none; }
  table.orders-table tr.o-row.open .order-more > div { font-size: 11px; line-height: 1.3; }
  table.orders-table tr.o-row.open .order-id { display: inline; font-size: 11px; margin-left: 6px; }
  .duty-price { font-size: 16px; }
  .staff-money table, .cash-table { display: block; overflow-x: auto; }
}

/* ===== Бланки 2026 и редактор «как Excel» ===== */
.xl { --xl-ink: #000; --xl-paper: #fff; --xl-grid: #d9d9d9; --xl-head: #f3f3f3; --xl-head-ink: #444; --xl-acc: #217346; --xl-sel: rgba(33,115,70,.12); --xl-rib: #f8f8f8;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--xl-rib); margin: 10px 0; }
html.theme-dark .xl { --xl-ink: #e8e8e8; --xl-paper: #1f1f1f; --xl-grid: #3a3a3a; --xl-head: #2b2b2b; --xl-head-ink: #bbb; --xl-acc: #4caf7a; --xl-sel: rgba(76,175,122,.18); --xl-rib: #262626; }
.xl-ribbon { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--xl-grid); background: var(--xl-rib); padding: 4px 2px 0; scrollbar-width: thin; }
.xl-group { display: flex; flex-direction: column; align-items: center; padding: 2px 8px; border-right: 1px solid var(--xl-grid); flex: 0 0 auto; }
.xl-group:last-child { border-right: 0; }
.xl-row { display: flex; gap: 2px; }
.xl-glabel { font-size: 11px; color: var(--muted); margin-top: 2px; padding-bottom: 3px; }
.xl-btn { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--xl-ink); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.xl-btn:hover { background: var(--xl-sel); border-color: var(--xl-grid); }
.xl-btn.on { background: var(--xl-sel); border-color: var(--xl-acc); }
.xl-btn.xl-save { color: #fff; background: var(--xl-acc); }
.xl.dirty .xl-btn.xl-save { box-shadow: 0 0 0 2px #f5b301; }
.xl-formula { display: flex; align-items: stretch; border-bottom: 1px solid var(--xl-grid); background: var(--xl-paper); }
.xl-name { width: 86px; border: 0; border-right: 1px solid var(--xl-grid); padding: 4px 6px; font: 13px/1.4 Consolas, monospace; background: var(--xl-paper); color: var(--xl-ink); }
.xl-fxl { padding: 4px 10px; font-style: italic; color: var(--muted); border-right: 1px solid var(--xl-grid); font-family: Georgia, serif; }
.xl-fx { flex: 1; min-width: 0; border: 0; padding: 4px 8px; font: 13px/1.4 Consolas, monospace; background: var(--xl-paper); color: var(--xl-ink); }
.xl-name:focus, .xl-fx:focus { outline: 2px solid var(--xl-acc); outline-offset: -2px; }
.xl-scroll { position: relative; overflow: auto; max-height: 70vh; background: var(--xl-paper); outline: none; -webkit-overflow-scrolling: touch; }
.xl-grid { border-collapse: collapse; table-layout: fixed; font-family: Arial, "Liberation Sans", sans-serif; font-size: 12px; color: var(--xl-ink); background: var(--xl-paper); }
.xl-grid td { padding: 1px 3px; vertical-align: bottom; overflow: hidden; line-height: 1.2; word-wrap: break-word; white-space: pre-wrap; }
.xl-sheet td { border: 1px solid var(--xl-grid); cursor: cell; user-select: none; }
.xl-sheet th { position: sticky; background: var(--xl-head); color: var(--xl-head-ink); font-weight: 400; font-size: 11px; border: 1px solid var(--xl-grid); z-index: 2; user-select: none; }
.xl-sheet thead th { top: 0; height: 20px; text-align: center; }
.xl-sheet th.xl-rh { left: 0; text-align: center; z-index: 1; }
.xl-sheet th.xl-corner { left: 0; top: 0; z-index: 3; }
.xl-sheet th.xl-hc { background: color-mix(in srgb, var(--xl-acc) 22%, var(--xl-head)); color: var(--xl-acc); font-weight: 700; border-bottom-color: var(--xl-acc); }
.xl-sheet td.xl-in { background-color: var(--xl-sel) !important; }
.xl-sheet td.xl-on { outline: 2px solid var(--xl-acc); outline-offset: -2px; }
.xl-grid .xb { font-weight: 700; } .xl-grid .xi { font-style: italic; } .xl-grid .xu { text-decoration: underline; }
.xl-grid .xal { text-align: left; } .xl-grid .xac { text-align: center; } .xl-grid .xar { text-align: right; }
.xl-grid .xvt { vertical-align: top; } .xl-grid .xvm { vertical-align: middle; } .xl-grid .xvb { vertical-align: bottom; }
.xl-grid .xnw { white-space: nowrap; }
.xl-editor { position: absolute; z-index: 5; font: 12px/1.2 Arial, sans-serif; padding: 1px 3px; border: 2px solid var(--xl-acc); background: var(--xl-paper); color: var(--xl-ink); resize: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.xl-tabs { display: flex; gap: 2px; align-items: flex-end; padding: 0 8px; background: var(--xl-head); border-top: 1px solid var(--xl-grid); overflow-x: auto; }
.xl-tab-form { margin: 0; }
.xl-tab { display: inline-block; padding: 6px 14px; font-size: 13px; color: var(--xl-head-ink); text-decoration: none; border: 1px solid transparent; border-top: 0; background: transparent; font-family: inherit; cursor: pointer; white-space: nowrap; }
.xl-tab.on { background: var(--xl-paper); color: var(--xl-acc); font-weight: 700; border-color: var(--xl-grid); border-bottom: 3px solid var(--xl-acc); }
.xl-tab.add { color: var(--muted); font-style: italic; }
.xl-tab:hover { color: var(--xl-acc); }
.xl-status { display: flex; justify-content: space-between; gap: 10px; padding: 3px 10px; font-size: 12px; background: var(--xl-acc); color: #fff; }
.xl-help code { background: var(--chip, rgba(0,0,0,.06)); padding: 0 4px; border-radius: 3px; }
.doc-head h1 { margin: 0; font-size: 20px; }
.pay-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pay-badge.paid { background: #e3f4e8; color: #1d6b3a; } .pay-badge.unpaid { background: #fde9e7; color: #a3291b; }
html.theme-dark .pay-badge.paid { background: #1d3b28; color: #8fd7a7; } html.theme-dark .pay-badge.unpaid { background: #4a2420; color: #f3a69c; }
.pay-form { margin: 8px 0; gap: 8px; flex-wrap: wrap; align-items: center; }
.doc-journal td.num { text-align: right; white-space: nowrap; }
.doc-journal .doc-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.doc-journal .doc-acts .btn { padding: 4px 8px; font-size: 12px; }
.seg-tabs { gap: 4px; flex-wrap: wrap; margin: 10px 0; }
.seg-tabs a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: inherit; font-size: 13px; }
.seg-tabs a.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.seg-tabs .sep { width: 10px; }
.doc-new, .doc-req { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: end; }
.doc-new .inn-row { gap: 4px; flex-wrap: nowrap; } .doc-new .inn-row input { min-width: 0; }
.doc-req .note, .doc-req .btn { grid-column: 1 / -1; justify-self: start; }
/* печатная форма */
.print-page .paper { background: #fff; color: #000; margin: 0 auto; width: max-content; max-width: 100%; overflow-x: auto; }
.xl-print { --xl-ink: #000; --xl-paper: #fff; }
.xl-print td { position: relative; overflow: visible; }
.pm-sign { position: absolute; left: 4px; bottom: -6px; height: 42px; mix-blend-mode: multiply; pointer-events: none; }
.pm-stamp { position: absolute; left: 0; top: -40px; width: 120px; opacity: .9; mix-blend-mode: multiply; pointer-events: none; }
@media print { .print-page .paper { width: 100%; overflow: visible; } .xl-print { width: 100%; } }
@media (max-width: 700px) {
  .xl-scroll { max-height: 62vh; }
  .xl-glabel { display: none; }
  .xl-btn { min-width: 36px; height: 36px; }
  .doc-journal .doc-acts .btn.ghost { display: none; }
}
.doc-new .field, .doc-req .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.doc-new .field > span:first-child, .doc-req .field > span:first-child { font-size: 12px; color: var(--muted); }
.doc-new select, .doc-new input, .doc-req select, .doc-req input { width: 100%; box-sizing: border-box; }
.doc-new .inn-row .btn { flex: 0 0 auto; }
.doc-new > .btn { align-self: end; }
.xl-scroll { max-height: 76vh; }

/* ===== Чат пункта (по образцу chat.on-ok.ru) ===== */
.chat-badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #ef3b3b; color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; vertical-align: middle; }
.chat-badge[hidden] { display: none; }
.bottombar a { position: relative; }
.bottombar .chat-badge { position: absolute; top: 2px; right: 50%; transform: translateX(26px); margin: 0; }
.oc { --oc-blue: #2f8cf5; --oc-blue2: #1f6fe0; --oc-bg: #dbe9f6; --oc-in: #fff; --oc-ink: #12202f; --oc-mut: #7b8794; --oc-line: #e4e9ef; --oc-panel: #fff;
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; height: calc(100vh - 120px); min-height: 520px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--oc-panel); color: var(--oc-ink); }
html.theme-dark .oc { --oc-bg: #0f1b27; --oc-in: #1f2b38; --oc-ink: #e7edf3; --oc-mut: #8d9aa8; --oc-line: #26323f; --oc-panel: #17212b; }
.oc-list { display: flex; flex-direction: column; border-right: 1px solid var(--oc-line); min-height: 0; }
.oc-list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.oc-list-head h1 { margin: 0; font-size: 26px; }
.oc-icon { border: 0; background: transparent; color: var(--oc-blue); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 8px; text-decoration: none; }
.oc-strip { display: flex; gap: 12px; overflow-x: auto; padding: 6px 14px 10px; scrollbar-width: none; }
.oc-chip { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--oc-ink); cursor: pointer; padding: 0; }
.oc-chip .oc-ava { width: 54px; height: 54px; font-size: 18px; box-shadow: 0 0 0 2px var(--oc-panel), 0 0 0 4px color-mix(in srgb, var(--oc-blue) 55%, transparent); }
.oc-chip small { font-size: 12px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-chip .oc-badge { position: absolute; top: -2px; right: -2px; }
.oc-search { display: flex; align-items: center; gap: 8px; margin: 2px 14px 8px; padding: 8px 14px; border-radius: 22px; background: color-mix(in srgb, var(--oc-blue) 9%, var(--oc-panel)); color: var(--oc-mut); }
.oc-search input { flex: 1; border: 0; background: transparent; color: var(--oc-ink); font: inherit; outline: none; min-width: 0; }
.oc-rooms { flex: 1; overflow-y: auto; padding: 0 6px 10px; }
.oc-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; background: transparent; color: var(--oc-ink); text-align: left; border-radius: 12px; cursor: pointer; font: inherit; }
.oc-row:hover { background: color-mix(in srgb, var(--oc-blue) 7%, transparent); }
.oc-row.on { background: color-mix(in srgb, var(--oc-blue) 15%, transparent); }
.oc-row > .oc-badge { position: absolute; left: 46px; top: 6px; }
.oc-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.oc-row-top { display: flex; justify-content: space-between; gap: 8px; }
.oc-row-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-row-top time { font-size: 12px; color: var(--oc-mut); white-space: nowrap; }
.oc-row-top time.fresh { color: var(--oc-blue); font-weight: 700; }
.oc-row-last { font-size: 14px; color: var(--oc-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-row-last em { font-style: normal; color: var(--oc-blue); } .oc-row-last em.who { color: var(--oc-ink); }
.oc-sep { padding: 10px 12px 4px; font-size: 12px; text-transform: lowercase; color: var(--oc-mut); }
.oc-ava { --h: 210; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 16px; background: linear-gradient(135deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 25) 75% 45%)); }
.oc-ava.group { background: linear-gradient(135deg, #2ec4c4, #1a8fb0); }
.oc-badge { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ef3b3b; color: #fff; font-size: 12px; font-style: normal; line-height: 20px; text-align: center; font-weight: 700; box-shadow: 0 0 0 2px var(--oc-panel); }
.oc-ticks { color: var(--oc-blue); letter-spacing: -3px; margin-left: 4px; }
.oc-room { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background-color: var(--oc-bg);
  background-image: radial-gradient(circle at 20px 20px, color-mix(in srgb, var(--oc-blue) 13%, transparent) 2.5px, transparent 3px), radial-gradient(circle at 60px 64px, color-mix(in srgb, var(--oc-blue) 10%, transparent) 6px, transparent 7px);
  background-size: 84px 84px; }
.oc-room[hidden], .oc-empty[hidden] { display: none; }
.oc-room-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--oc-panel); border-bottom: 1px solid var(--oc-line); }
.oc-room-head .oc-ava { width: 42px; height: 42px; }
.oc-room-head .note { font-size: 13px; color: var(--oc-mut); }
.oc-room-head .oc-order-link { margin-left: auto; font-size: 14px; border: 1px solid var(--oc-blue); }
.oc-back { display: none; border: 0; background: transparent; font-size: 24px; color: var(--oc-ink); cursor: pointer; padding: 0 6px; }
.oc-feed { flex: 1; overflow-y: auto; padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.oc-none { text-align: center; color: var(--oc-mut); margin: auto; background: color-mix(in srgb, var(--oc-panel) 80%, transparent); padding: 8px 14px; border-radius: 14px; }
.oc-day { text-align: center; margin: 8px 0; } .oc-day span { background: color-mix(in srgb, #000 18%, transparent); color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.oc-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 78%; }
.oc-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.oc-bubble { position: relative; padding: 7px 10px 6px; border-radius: 18px; background: var(--oc-in); color: var(--oc-ink); box-shadow: 0 1px 1px rgba(0,0,0,.06); min-width: 70px; overflow-wrap: anywhere; }
.oc-msg.mine .oc-bubble { background: linear-gradient(135deg, var(--oc-blue), var(--oc-blue2)); color: #fff; border-bottom-right-radius: 6px; }
.oc-msg:not(.mine) .oc-bubble { border-bottom-left-radius: 6px; }
.oc-msg.mine .oc-bubble a { color: #fff; }
.oc-who { --h: 210; display: block; font-size: 13px; color: hsl(var(--h) 65% 45%); margin-bottom: 1px; }
.oc-text { white-space: normal; }
.oc-meta { float: right; margin: 6px 0 -2px 10px; font-size: 11px; opacity: .75; white-space: nowrap; }
.oc-msg.mine .oc-ticks { color: #fff; opacity: .7; } .oc-msg.mine .oc-ticks.read { opacity: 1; }
.oc-photo { display: block; max-width: 260px; max-height: 260px; border-radius: 12px; margin: 2px 0 4px; }
.oc-task { display: block; padding: 6px 10px; margin: 2px 0 2px; border-left: 3px solid #f5a623; background: color-mix(in srgb, #f5a623 14%, transparent); border-radius: 8px; color: inherit; text-decoration: none; font-weight: 600; }
.oc-task small { display: block; font-weight: 400; opacity: .85; }
.oc-task.done { text-decoration: line-through; opacity: .7; }
.oc-mk { opacity: 0; border: 0; background: var(--oc-panel); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: opacity .15s; }
.oc-msg:hover .oc-mk, .oc-mk:focus { opacity: 1; }
@media (hover: none) { .oc-mk { opacity: .7; } }
.oc-jump { position: absolute; right: 18px; bottom: 80px; border: 0; border-radius: 18px; padding: 7px 14px; background: var(--oc-panel); color: var(--oc-blue); box-shadow: 0 2px 8px rgba(0,0,0,.2); cursor: pointer; }
.oc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 12px; }
.oc-attach { flex: 0 0 auto; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--oc-panel); cursor: pointer; font-size: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.oc-input { flex: 1; min-width: 0; background: var(--oc-panel); border-radius: 22px; padding: 4px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.oc-input textarea { width: 100%; border: 0; background: transparent; color: var(--oc-ink); resize: none; font: 16px/1.35 inherit; font-family: inherit; padding: 8px 0; outline: none; max-height: 140px; }
.oc-preview { position: relative; display: inline-block; margin-top: 6px; } .oc-preview img { max-height: 90px; border-radius: 10px; }
.oc-preview button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #ef3b3b; color: #fff; cursor: pointer; }
.oc-send { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0; color: #fff; font-size: 18px; cursor: pointer; background: linear-gradient(135deg, var(--oc-blue), var(--oc-blue2)); box-shadow: 0 2px 6px rgba(31,111,224,.4); }
.oc-empty { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--oc-mut); background: var(--oc-bg); padding: 20px; }
.oc-empty-ico { font-size: 54px; }
.oc-dialog { border: 0; border-radius: 16px; padding: 18px; width: min(440px, 92vw); background: var(--panel); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.oc-dialog::backdrop { background: rgba(10,20,30,.45); }
.oc-dialog h2 { margin: 0 0 10px; font-size: 18px; }
.oc-dialog .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.oc-dialog textarea, .oc-dialog input, .oc-dialog select { width: 100%; box-sizing: border-box; }
.oc-people { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; max-height: 50vh; overflow: auto; }
.oc-person { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: inherit; padding: 6px; border-radius: 10px; cursor: pointer; font: inherit; text-align: left; }
.oc-person:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.oc-person .oc-ava { width: 38px; height: 38px; font-size: 14px; }
@media (max-width: 820px) {
  .oc { grid-template-columns: 1fr; height: calc(100dvh - 150px); min-height: 420px; border-radius: 0; border-left: 0; border-right: 0; margin: 0 -12px; }
  .oc .oc-empty { display: none; }
  .oc.in-room .oc-list { display: none; }
  .oc:not(.in-room) .oc-room { display: none; }
  .oc-back { display: inline-block; }
  .oc-msg { max-width: 88%; }
  .oc-photo { max-width: 200px; }
}
body:has(.oc) #helper { display: none; }
.doc-new .field:nth-child(3) { grid-column: span 2; }
@media (max-width: 700px) { .doc-new .field:nth-child(3) { grid-column: auto; } }
.xl-grid { width: max-content; margin: 0; }
.xl-grid td, .xl-grid th { border-top: 0; border-bottom: 0; border-left: 0; border-right: 0; }
.xl-sheet td { border: 1px solid var(--xl-grid); }
.xl-sheet th { border: 1px solid var(--xl-grid); }
.xl-grid tr:hover td { background: inherit; }
.print-page .paper { width: 760px; } .print-page .paper.land { width: 1120px; }
.print-page .xl-print { width: 100%; }
main.is-chat > .section-banner { display: none; }
.shell main:has(.xl-page), .shell main:has(.oc) { min-width: 0; }
.xl-page, .xl { min-width: 0; max-width: 100%; box-sizing: border-box; }
.xl-scroll { max-width: 100%; }

/* ===== сборка ops: подписи, корзина, журнал, запись, смена, осмотр, зарплата, окно чата ===== */
.who-line { display: inline-block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.who-sign { margin: 8px 0; }
.trash-form { display: inline-block; margin: 2px 0; }
.btn.danger, .btn.ghost.danger { color: var(--red); }
.trash-row { margin-top: 14px; justify-content: flex-end; }
td .trash-form .btn { padding: 2px 8px; font-size: 12px; }
.ok-note { background: #e8f6ee; color: #1d6b3a; padding: 8px 12px; border-radius: 8px; }
html.theme-dark .ok-note { background: #1d3b28; color: #a6e3bb; }
td.neg, .neg { color: var(--red); }
.filter-row input, .filter-row select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel); color: var(--ink); }
.wrap-line > * { flex: 0 1 auto; }
.wrap-line input, .wrap-line select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--panel); color: var(--ink); }
.doc-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.doc-acts form { display: inline; }
/* онлайн-запись */
.bk-grid { border-collapse: separate; border-spacing: 4px; min-width: 520px; }
.bk-grid th { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bk-grid td { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; min-width: 150px; font-size: 13px; vertical-align: top; }
.bk-free { text-align: center; background: transparent; }
.bk-add { border: 1px dashed var(--line); background: transparent; color: var(--muted); width: 100%; border-radius: 8px; padding: 6px; cursor: pointer; font-size: 16px; }
.bk-add:hover { border-color: var(--blue); color: var(--blue); }
.bk-cell.st-new { background: #fff6df; } .bk-cell.st-confirmed { background: #e8f0ff; } .bk-cell.st-came { background: #e8f6ee; } .bk-cell.st-noshow { background: #fde9e7; } .bk-cell.st-cancelled { opacity: .55; }
html.theme-dark .bk-cell.st-new { background: #3b3220; } html.theme-dark .bk-cell.st-confirmed { background: #1f2b44; } html.theme-dark .bk-cell.st-came { background: #1d3b28; } html.theme-dark .bk-cell.st-noshow { background: #4a2420; }
.bk-acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.bk-acts .btn { padding: 2px 8px; font-size: 12px; }
/* публичная страница записи */
body.pb { background: var(--bg); color: var(--ink); }
.pb-main { max-width: 640px; margin: 0 auto; padding: 18px 14px 40px; }
.pb-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.pb-head .logo { width: 56px; height: 56px; }
.pb-head h1 { margin: 0; font-size: 22px; } .pb-head p { margin: 2px 0 0; color: var(--muted); }
.pb h2 { font-size: 16px; margin: 18px 0 8px; }
.pb-days, .pb-slots { display: flex; gap: 8px; flex-wrap: wrap; }
.pb-days a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); text-decoration: none; font-size: 14px; }
.pb-days a.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.pb-slots label { position: relative; }
.pb-slots input { position: absolute; opacity: 0; }
.pb-slots span { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.pb-slots input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.pb-form > label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 14px; }
.pb-form > label input:not([type=checkbox]) { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-size: 16px; }
.pb-form .pb-consent { flex-direction: row; align-items: center; gap: 8px; }
.pb-hp { position: absolute; left: -9999px; }
.pb-go { width: 100%; padding: 14px; font-size: 17px; margin-top: 8px; }
.pb-done { text-align: center; padding: 30px 10px; background: var(--panel); border-radius: 16px; }
.pb-ok { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--green); color: #fff; font-size: 36px; display: grid; place-items: center; }
.pb-foot { margin-top: 30px; color: var(--muted); font-size: 13px; text-align: center; }
/* акт осмотра */
.insp-progress { height: 8px; border-radius: 4px; background: var(--ghost); overflow: hidden; margin: 8px 0; }
.insp-progress span { display: block; height: 100%; background: var(--green); }
.insp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.insp-tile { border: 2px dashed var(--line); border-radius: 14px; padding: 8px; background: var(--panel); text-align: center; }
.insp-tile.done { border-style: solid; border-color: var(--green); }
.insp-tile label { display: flex; flex-direction: column; gap: 4px; align-items: center; cursor: pointer; }
.insp-tile input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.insp-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.insp-ico { font-size: 40px; line-height: 1; padding: 22px 0; }
.insp-tile small { color: var(--muted); font-size: 12px; }
/* плавающее окно чата */
.chat-fab { position: fixed; right: 84px; bottom: 20px; z-index: 41; }
.chat-fab-btn { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; background: #2f8cf5; color: #fff; font-size: 24px; box-shadow: 0 6px 20px rgba(20,30,50,.25); cursor: pointer; }
.chat-fab-btn .chat-badge { position: absolute; top: -2px; right: -2px; }
.chat-fab-panel { position: fixed; right: 20px; bottom: 84px; width: min(420px, calc(100vw - 24px)); height: min(640px, calc(100vh - 120px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 50px rgba(10,20,40,.35); display: flex; flex-direction: column; overflow: hidden; }
.chat-fab-panel[hidden] { display: none; }
.chat-fab-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chat-fab-head b { flex: 1; }
.chat-fab-head a, .chat-fab-head button { border: 0; background: transparent; color: var(--ink); font-size: 20px; cursor: pointer; text-decoration: none; line-height: 1; }
.chat-fab-panel iframe { flex: 1; border: 0; width: 100%; background: var(--panel); }
body.embed { background: var(--panel); margin: 0; }
body.embed .oc.oc-embed { height: 100dvh; min-height: 0; border: 0; border-radius: 0; margin: 0; grid-template-columns: 1fr; }
body.embed .oc.oc-embed .oc-empty { display: none; }
body.embed .oc.oc-embed.in-room .oc-list { display: none; }
body.embed .oc.oc-embed:not(.in-room) .oc-room { display: none; }
body.embed .oc.oc-embed .oc-back { display: inline-block; }
.oc-remind { border: 0; background: transparent; font-size: 20px; cursor: pointer; padding: 0 4px; align-self: center; }
.oc-who.bot { color: #8a5cf6 !important; } .oc-who.bridge { color: #0e9f8e !important; }
@media (max-width: 820px) {
  .chat-fab { right: 72px; bottom: 74px; }
  .chat-fab-btn { width: 48px; height: 48px; font-size: 22px; }
  .chat-fab-panel { right: 6px; left: 6px; width: auto; bottom: 130px; height: calc(100dvh - 190px); }
  .bk-grid td { min-width: 130px; }
}
@media print { .chat-fab, .trash-form { display: none !important; } }
.trash-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 60; background: #243044; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; max-width: 92vw; }
.trash-toast a { color: #9cc3ff; }
@media (max-width: 820px) { .trash-toast { bottom: 140px; } }

/* ===== 20261124: компактный список заказов на телефоне ===== */
.m-orders { display: none; }
.adv-handle .ms-sum { color: var(--ink); font-weight: 500; }
@media (min-width: 601px) { .adv-handle .ms-sum { display: none; } }
@media (max-width: 600px) {
  main.is-orders .section-banner { display: none; }
  .order-search { margin-top: 6px !important; }
  .order-search > .rowline { flex-wrap: nowrap; gap: 6px; }
  .order-search > .rowline > input[name="search_text"] { flex: 1 1 auto; min-width: 0; width: auto; }
  .order-search:not(:has(#advsearch:checked)) .ms-more { display: none !important; }
  .order-search:has(#advsearch:checked) > .rowline { flex-wrap: wrap; }
  .order-search .adv-handle { margin-top: 6px; padding: 5px 10px; touch-action: pan-x; }
  .order-search .adv-handle .ms-hint { display: none; }
  .order-search > .rowline > .icon-btn { display: none !important; }
  table.orders-table { display: none !important; }
  .m-orders { display: block; margin: 8px -6px 0; }
  .m-order { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 0 10px; align-items: center; min-height: 64px; max-height: 72px; padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow: hidden; }
  .m-order:active { background: var(--hover); }
  .m-order.unpaid { box-shadow: inset 3px 0 0 var(--red); }
  .mo-pic { width: 60px; height: 46px; border-radius: 6px; object-fit: cover; display: block; background: var(--ghost); }
  .mo-nopic { display: flex; align-items: center; justify-content: center; color: var(--muted); }
  .mo-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .mo-plate { font-size: 16px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mo-car, .mo-who { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mo-who svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
  .mo-cat { font-style: normal; font-size: 10px; font-weight: 700; padding: 0 4px; margin-right: 4px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); }
  .mo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
  .mo-price { font-size: 15px; font-weight: 700; }
  .mo-pay { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 10px; }
  .mo-pay.ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
  .mo-pay.no { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
}

/* «Скачать чат» — установка мессенджера chatto.on-ok.ru */
.install-app.install-chat { margin-top: -4px; border-color: var(--green); color: var(--green); }
.oc-install { margin-left: auto; margin-right: 6px; padding: 4px 10px; border: 1.5px solid var(--blue); border-radius: 10px; color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.oc-install:hover { background: var(--hover); }
.install-chat-btn { text-decoration: none; }
