/* Кабинет клиники «Элемент Лаб» - в стиле сайта elementlab.pro (вариант «Г»): те же цвета и шрифт. */

:root {
  --font: 'Golos Text', system-ui, sans-serif;
  --maxw: 1180px;
  --gutter: 20px;
  --radius: 14px;
  --bg: #f2efea;
  --bg-alt: #ebe6de;
  --card: #fbfaf8;
  --text: #26343b;
  --muted: #5a6b73;
  --head: #495C65;
  --line: #CBDCE5;
  --accent: #00ACE5;
  --accent-2: #00B6EB;
  --tint: #D6F2FA;
  --tint-2: #BEEAF7;
  --btn-text: #0d2833;
  --ok: #2f8a57;
  --ok-bg: #e2f3e8;
  --warn: #9a6a00;
  --warn-bg: #fbefd2;
  --bad: #b3261e;
  --bad-bg: #f9e0de;
  --shadow: 0 1px 2px rgba(38, 52, 59, .05), 0 10px 30px rgba(38, 52, 59, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--head); }
a:hover { color: var(--accent); }
h1, h2, h3 { color: var(--head); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 3vw, 32px); }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* Шапка */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 68px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.logo svg { width: 84px; height: 40px; }
.logo span { font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; line-height: 1.2; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; color: var(--head); }
.nav a:hover { background: var(--tint); color: var(--head); }
.nav a.on { background: var(--tint); }
.who { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.who form { margin: 0; }
.who b { display: block; color: var(--head); }

main { padding: 28px 0 56px; }
.foot { border-top: 1px solid var(--line); padding: 18px 0 28px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }

/* Карточки и сетка */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }
.narrow { max-width: 480px; margin: 20px auto; }
.grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; margin: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts + h3 { margin-top: 16px; }

/* Кнопки */
.btn, button, input[type=submit] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: 15px; border-radius: 10px; border: 2px solid var(--accent); background: var(--accent); color: var(--btn-text); text-decoration: none; cursor: pointer; }
.btn:hover, button:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--btn-text); }
.btn.ghost, button.ghost { background: transparent; color: var(--head); border-color: var(--line); }
.btn.ghost:hover, button.ghost:hover { border-color: var(--accent); background: var(--tint); }
.btn.danger, button.danger { background: transparent; color: var(--bad); border-color: var(--bad-bg); }
.btn.small, button.small { padding: 6px 12px; font-size: 14px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Формы */
label { display: block; font-weight: 600; font-size: 14px; color: var(--head); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tint); border-color: var(--accent); }
input[disabled] { background: var(--bg-alt); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; }
.field { margin-bottom: 14px; }
.field.check label { display: inline; margin-left: 6px; }
.helptext, .help, form p > span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.errorlist { list-style: none; margin: 0 0 6px; padding: 0; color: var(--bad); font-size: 14px; font-weight: 600; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
form p { margin: 0 0 14px; }

/* Сообщения */
.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { padding: 12px 16px; border-radius: 10px; background: var(--tint); margin-bottom: 8px; }
.messages li.success { background: var(--ok-bg); }
.messages li.error { background: var(--bad-bg); }
.messages code { word-break: break-all; }
.note { background: var(--tint); border-radius: 10px; padding: 12px 16px; font-size: 14px; }

/* Таблицы */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link-row:hover td { background: var(--tint); }
/* Правки отправленного наряда: добавлено - зелёным, убрано - красным и зачёркнуто (владелец, 02.10.2026) */
.table tr.item-added td { background: var(--ok-bg); }
.table tr.item-removed td { background: var(--bad-bg); color: var(--bad); }
.table tr.item-removed td:not(:has(.item-name)), .table tr.item-removed .item-name { text-decoration: line-through; }
.item-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.changes-legend span { display: inline-block; padding: 1px 8px; border-radius: 6px; margin-right: 4px; }
.changes-legend .item-added { background: var(--ok-bg); color: var(--ok); }
.changes-legend .item-removed { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
/* Вся строка открывает наряд - щелчком (cabinet.js). Растянутая на строку ссылка (::after) не годится:
   Safari на iPhone растягивал её на всю страницу, и «Новый наряд» открывал чужой наряд (11.10.2026). */
.table tr.link-row { cursor: pointer; }
.table-scroll { overflow-x: auto; }

/* Статусы */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--bg-alt); color: var(--head); }
.badge.new { background: var(--tint); }
.badge.accepted, .badge.in_work { background: #e3ecf8; color: #2f5a8a; }
.badge.question { background: var(--warn-bg); color: var(--warn); }
.badge.fitting { background: #efe6f7; color: #6a3f8f; }
.badge.ready, .badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.delivered { background: var(--bg-alt); color: var(--muted); }
.badge.cancelled { background: var(--bad-bg); color: var(--bad); }
.badge.urgent { background: var(--bad-bg); color: var(--bad); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips a { text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; background: var(--card); }
.chips a.on { background: var(--head); color: #fff; border-color: var(--head); }
.chips a span { opacity: .7; margin-left: 4px; }
.table select { width: auto; padding: 6px 8px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 220px; }

/* Работы в наряде: строка в одну линию */
.items-head, .item-row .row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 56px 28px; gap: 6px; align-items: center; }
.items-head { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.item-row { margin: 0 0 6px; }
.item-row select, .item-row input { padding: 6px 8px; font-size: 14px; border-radius: 8px; }
.item-row.removed { display: none; }
.row-errors .errorlist { margin: 0 0 2px; font-size: 13px; }
.row-remove { width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.row-remove:hover { background: var(--bad-bg); color: var(--bad); border: 0; }

/* Зубная формула: общая в наряде и в карточке */
.formula { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; margin: 4px 0 10px; }
.formula .tooth { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; padding: 4px 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--head); font: inherit; font-size: 14px; }
.formula .tooth b { font-weight: 700; }
.formula .tooth small { font-size: 10px; line-height: 1.1; min-height: 11px; color: var(--muted); font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.formula button.tooth { cursor: pointer; }
.formula button.tooth:hover { border-color: var(--accent); background: #fff; color: var(--head); }
.formula .tooth.mid { margin-right: 6px; }
.formula .tooth.has { background: var(--tint); border-color: var(--tint-2, #BEEAF7); }
.formula .tooth.has small { color: var(--head); }
.formula .tooth.sel, .formula button.tooth.sel:hover { background: var(--accent); border-color: var(--accent); color: var(--btn-text); }
.formula .tooth.sel small { color: var(--btn-text); }
.formula .jaw-gap { grid-column: span 16; height: 6px; border-top: 1px dashed var(--line); margin-top: 4px; }
.formula.view .tooth { min-height: 40px; }
.card.implant-card { padding: 12px 14px; }
.implant-card h2 { font-size: 17px; margin-bottom: 10px; }
.implant-rows { display: grid; gap: 10px; }
.implant-row { display: flex; align-items: end; gap: 8px; }
.implant-position { flex: 0 0 28px; line-height: 32px; font-size: 13px; font-weight: 600; color: var(--head); }
.implant-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); align-items: end; gap: 8px; }
.implant-row .implant-copy { flex: 0 0 106px; padding: 5px; min-height: 32px; font-size: 12px; white-space: nowrap; }
.implant-copy-first { visibility: hidden; }
.implant-fields label { min-width: 0; margin: 0; font-size: 12px; line-height: 1.3; }
.implant-fields input { display: block; width: 100%; min-width: 0; height: 32px; margin-top: 4px; padding: 5px 7px; border-radius: 6px; font-size: 14px; font-weight: 400; }
.implant-editor { display: block; position: relative; }
.implant-options { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; max-height: 180px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.implant-options button { display: block; width: 100%; border: 0; border-radius: 0; padding: 7px; background: #fff; color: var(--text); text-align: left; font-size: 14px; font-weight: 400; overflow-wrap: anywhere; }
.implant-options button:hover, .implant-options button[aria-selected="true"] { background: var(--tint); }
@media (max-width: 580px) {
  .implant-row { flex-wrap: wrap; }
  .implant-position { align-self: start; margin-top: 20px; }
  .implant-fields { flex-basis: calc(100% - 36px); grid-template-columns: minmax(0, 1fr) 80px; }
  .implant-fields label:last-child { grid-column: 1 / -1; }
  .implant-copy { margin-left: 36px; }
  .implant-copy-first { display: none; }
}
.items-title { margin-top: 20px; }
select.needs-choice { border-color: var(--warn); outline: 2px solid var(--warn-bg); }

/* Уровень: Стандарт / Эксперт */
.tier-card h2 { margin-bottom: 10px; }
.tier-switch { display: flex; gap: 10px; flex-wrap: wrap; }
.tier-option { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 16px; margin: 0; }
.tier-option:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.tier-option input { accent-color: var(--accent); width: 18px; height: 18px; }
.badge.tier-standard { background: var(--bg-alt); color: var(--head); }
.badge.tier-expert { background: #2f3f47; color: #fff; }

/* Переписка */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.msg { align-self: flex-start; }
.msg.own { align-self: flex-end; background: var(--tint); border-color: var(--tint); }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form textarea { margin-bottom: 8px; }

/* История */
.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline time { color: var(--muted); font-size: 13px; display: block; }

.files { list-style: none; margin: 0 0 14px; padding: 0; }
.files li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.files li:last-child { border-bottom: 0; }

.price-note { font-size: 13px; color: var(--muted); }
.qr img { display: block; width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 10px; margin-bottom: 12px; }

@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .nav { order: 3; flex-basis: 100%; }
  .nav a { padding: 6px 10px; }
  .who { margin-left: auto; gap: 10px; }
  .who > div { display: none; }
  .card { padding: 16px; }
  .msg { max-width: 92%; }
  .items-head, .item-row .row { grid-template-columns: minmax(0, 1fr) 84px 44px 24px; }
  .fields-2 { grid-template-columns: 1fr; }
  .top .wrap { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .formula { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .formula .jaw-gap { grid-column: span 8; }
  .formula .tooth.mid { margin-right: 0; }
  .formula-modes .formula-target { flex-basis: 100%; }
  .filters input, .filters select { min-width: 0; width: 100%; }
}

/* Страницы входа и второго фактора */
.card form img { display: block; width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 10px; margin: 0 0 14px; border: 1px solid var(--line); }
.card form ul { padding-left: 18px; }
.card section { margin-bottom: 18px; }

.test-mode { background: var(--warn-bg); color: var(--warn); font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.test-banner { background: var(--warn-bg); color: var(--warn); font-weight: 700; text-align: center; padding: 8px var(--gutter); font-size: 14px; }
/* Страница «Кабинет клиники» для тех, кто ещё не вошёл */
.landing-head { padding: 24px 0 8px; max-width: 760px; }
.landing-head h1 { font-size: 40px; margin-bottom: 12px; }
.landing-head .lead { font-size: 18px; color: var(--muted); margin-bottom: 20px; }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 28px 0 8px; }
.landing-grid .card { margin-bottom: 0; }
.landing-grid h2 { font-size: 18px; }

/* Режимы формулы: 1 зуб / несколько зубов / ПР */
.formula-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.formula-modes .mode { display: inline-flex; flex-direction: column; align-items: center; min-width: 56px; padding: 7px 14px; font-size: 14px; background: #fff; color: var(--head); border: 2px solid var(--line); border-radius: 10px; }
.formula-modes .mode:hover { background: var(--tint); border-color: var(--accent); color: var(--head); }
.formula-modes .mode.on { background: var(--head); border-color: var(--head); color: #fff; }
.formula-modes .mode small { font-size: 10px; font-weight: 600; line-height: 1.1; }
.formula-modes .mode.area { min-width: 48px; padding: 7px 10px; }
.formula-modes .mode small:empty { display: none; }
.formula-target { font-size: 14px; font-weight: 600; color: var(--head); padding: 4px 10px; border-radius: 8px; background: var(--tint); }
.formula-target.warn { background: var(--warn-bg); color: var(--warn); }
.mouth-line { font-size: 14px; margin: 0 0 12px; }
.mouth-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--tint); color: var(--head); font-weight: 700; margin-right: 4px; }

/* Выбор работ: поиск и компактный выпадающий список с галочками */
.picker { position: relative; margin-top: 8px; }
.picker-bar { display: flex; gap: 8px; }
.picker-bar input[type=search] { flex: 1; min-width: 0; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.picker-list { position: absolute; left: 0; right: 0; top: 46px; z-index: 30; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 2px 0; }
.picker-section { position: sticky; top: -2px; background: var(--bg-alt); color: var(--head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; }
.picker-item { display: grid; grid-template-columns: 16px 44px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 3px 10px; margin: 0; font-weight: 400; font-size: 13px; line-height: 1.35; color: var(--text); cursor: pointer; }
.picker-item:hover { background: var(--tint); }
.picker-item:has(input:checked) { background: var(--tint); }
.picker-item input { width: 14px; height: 14px; margin: 0; }
.picker-item .code { font-weight: 700; color: var(--head); }
.picker-item .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item .price { color: var(--muted); white-space: nowrap; font-size: 12px; }
.picker-empty { padding: 6px 10px; margin: 0; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.picker-chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 2px 2px 10px; border-radius: 999px; background: var(--tint); color: var(--head); font-size: 12px; font-weight: 600; }
.chip-remove { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--head); font-size: 15px; line-height: 1; }
.chip-remove:hover { background: var(--bad-bg); color: var(--bad); }

/* Пациент: подсказки и продолжение работы */
.patient-field { position: relative; }
.suggest-box { position: absolute; left: 0; right: 0; z-index: 30; margin-top: 4px; max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px 8px; }
.suggest-box:empty { display: none; }
.suggest { list-style: none; margin: 0; padding: 0; }
.suggest li { padding: 6px 0; border-bottom: 1px solid var(--ph); }
.suggest-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.suggest-name { padding: 0; border: 0; background: none; color: var(--head); font-size: 15px; font-weight: 700; text-align: left; }
.suggest-name:hover { background: none; color: var(--accent); }
.suggest-orders { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.suggest-order { padding: 2px 8px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--head); }
.suggest-order:hover { background: var(--tint); border-color: var(--accent); color: var(--head); }
.suggest-note { margin: 6px 0 2px; }
.kind-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.continuation { margin-bottom: 8px; }
.datetime { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }

/* Шкала цвета */
.label { display: block; font-weight: 600; font-size: 14px; color: var(--head); margin-bottom: 4px; }
.shade-guides { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.shade-option { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; margin: 0; }
.shade-option:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.shade-option input { accent-color: var(--accent); }
.nav a.nav-new { background: var(--accent); color: var(--btn-text); }
.nav a.nav-new:hover { background: var(--accent-2); color: var(--btn-text); }
.accept-card { border-color: var(--accent); background: var(--tint); }
.accept-card p { margin-top: 0; }
.tier-option.off { opacity: .4; cursor: not-allowed; }
.radio-list > div { display: grid; gap: 6px; }
.radio-list label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.radio-list input { width: auto; margin: 0; accent-color: var(--accent); }
.claim-source { min-inline-size: 0; margin-inline: 0; padding: 0; border: 0; }
.claim-source legend { padding: 0; }
.claim-source input[type=checkbox] { width: 18px; flex: none; }
.attachment-column { min-width: 0; }
.attachment-column .dz-list li span { overflow-wrap: anywhere; }
.attachment-column [data-saved-attachments] .dz-list:empty { display: none; }
.stack { display: grid; gap: 8px; margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.steps li { margin-bottom: 10px; }
.steps .code { font-size: 20px; letter-spacing: 2px; }  /* код привязки MAX; общий .code - это коды работ в прайсе */
.shade-input { min-height: 44px; resize: vertical; overflow: hidden; }
.shade-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.shade-chips[hidden] { display: none; }
.shade-chip { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--head); font-size: 13px; font-weight: 600; cursor: pointer; min-height: 0; }
.shade-chip:hover { border-color: var(--accent); background: var(--tint); }

/* Зоны загрузки */
.dropzones { gap: 12px; }
.dropzone { margin-bottom: 12px; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dz-area { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center; min-height: 120px; padding: 16px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; color: var(--muted); font-weight: 400; cursor: pointer; margin: 0; transition: border-color .15s, background .15s; }
.dz-area b { color: var(--head); font-size: 16px; }
.dz-area u { color: var(--head); }
.dz-area small { font-size: 12px; }
.dropzone.over .dz-area, .dz-area:hover { border-color: var(--accent); background: var(--tint); }
.dropzone input[type=file]:focus-visible + .dz-area { outline: 2px solid var(--accent); }
.dz-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }
.dz-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--ph); }
.dz-remove { padding: 0 6px; font-size: 13px; font-weight: 600; background: none; border: 0; color: var(--bad); }
.dz-remove:hover { background: none; color: var(--bad); text-decoration: underline; }
.dz-error { color: var(--bad); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.files-title { font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
.upload-form .dz-area { min-height: 80px; }
/* Кнопка «Написать» (Telegram / MAX) */
.msgr { position: fixed; right: 18px; bottom: 18px; z-index: 50; }
.msgr summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: #d62839; color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgba(13, 40, 51, .22); }
.msgr summary::-webkit-details-marker { display: none; }
.msgr summary:hover { background: #b81f2f; }
.msgr summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.msgr summary:focus-visible { outline: 2px solid var(--head); outline-offset: 2px; }
.msgr-panel { position: absolute; right: 0; bottom: 56px; width: min(320px, calc(100vw - 36px)); display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 10px 28px rgba(13, 40, 51, .2); }
.msgr-panel b { color: var(--head); }
.msgr-link { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; text-decoration: none; }
.msgr-link small { color: var(--muted); font-weight: 400; font-size: 13px; }
.msgr-link:hover { border-color: var(--accent); background: var(--tint); }
.msgr-link.tg { border-left: 4px solid #229ed9; }
.msgr-link.mx { border-left: 4px solid #7a4cff; }
.msgr-note { margin: 0; font-size: 12.5px; color: var(--muted); }
@media print { .msgr { display: none; } }

/* Обновление прайса файлом */
.steps { padding-left: 18px; margin: 0 0 12px; }
.steps li { margin-bottom: 4px; }
.price-admin .dz-area { min-height: 84px; }
.table.compact td, .table.compact th { padding: 5px 8px; font-size: 14px; }
.diff { color: var(--head); font-size: 13px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }

/* Выбор клиники (врач в нескольких клиниках) */
.clinic-choices { display: grid; gap: 10px; margin-top: 14px; }
.clinic-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 14px 16px; text-align: left; font: inherit; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); cursor: pointer; }
.clinic-choice:hover { border-color: var(--accent); background: var(--tint); }
.clinic-choice.on { border-color: var(--head); }
.clinic-choice b { font-size: 17px; color: var(--head); }
.field ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.field ul li label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0 14px; }
.passkey-btn { width: 100%; }
a.clinic-choice { text-decoration: none; }
#logout-from-stage { margin-top: 16px; }

/* Операции наряда (кабинет техника, фаза 2): кто делает и к какой дате */
.ops-tiles { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ops-tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 14px; }
.ops-tile b { font-size: 17px; color: var(--head); }
.ops-tile.ok { background: var(--ok-bg); border-color: #b9dfc6; }
.ops-tile.need { background: var(--warn-bg); border-color: #ecd59c; }
.ops-tile.bad { background: var(--bad-bg); border-color: #efb9b4; color: var(--bad); font-weight: 700; }
.note.ops-warn { background: var(--warn-bg); margin-bottom: 10px; }
.ops-default { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ops-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--tint); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.ops-bar select, .ops-lead select { width: auto; max-width: 100%; }
.ops-lead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.ops-table { font-size: 14px; }
.ops-table td { padding: 6px 8px; vertical-align: middle; }
.ops-table select, .ops-table input[type=text], .ops-table input[type=date] { padding: 5px 8px; font-size: 14px; min-width: 150px; }
.ops-table input[type=date] { min-width: 130px; }
.ops-table .ops-work { white-space: nowrap; color: var(--head); vertical-align: top; }
.ops-table tr.ops-need td { background: var(--warn-bg); }
.ops-table tr.ops-done td { color: var(--muted); }
.ops-note { font-size: 12px; color: var(--ok); font-weight: 600; }
.ops-why { font-size: 12px; color: var(--warn); font-weight: 600; }
.ops-add { margin: 12px 0; }
.ops-add summary { cursor: pointer; font-weight: 700; color: var(--head); }
.ops-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ops-add-row select, .ops-add-row input { width: auto; flex: 1 1 160px; }
.ops-add-row .ops-code-input { flex: 0 0 90px; }
.ops-actions { margin: 12px 0 6px; }
.route { --route-action-width: 34px; display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(90px, 140px) 52px var(--route-action-width); column-gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.route-with-correction { --route-action-width: 116px; }
.route li { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.route-done { display: flex; align-items: center; gap: 6px; margin: 0; }
button.operation-check { --check-color: var(--accent); --check-tint: var(--tint); display: inline-flex; flex: 0 0 34px; width: 34px; height: 34px; padding: 5px; border: 1px solid transparent; background: transparent; color: var(--check-color); }
button.operation-check.is-sent { --check-color: var(--warn); --check-tint: var(--warn-bg); }
button.operation-check.is-done { --check-color: var(--ok); --check-tint: var(--ok-bg); }
button.operation-check.is-done:hover, button.operation-check.is-done:focus-visible { --check-color: var(--bad); --check-tint: var(--bad-bg); }
button.operation-check:hover, button.operation-check:focus-visible { color: var(--check-color); border-color: var(--check-color); background: var(--check-tint); box-shadow: 0 0 0 3px var(--check-tint), 0 0 8px var(--check-tint); outline: none; }
.route-photo .btn { width: 34px; height: 34px; padding: 6px; }
.route-photo, .route-action { display: flex; align-items: center; }
.route-with-correction .route-action { justify-content: flex-end; min-height: 34px; }
.route-action [data-route-correct] { height: 34px; white-space: nowrap; }
@media (max-width: 600px) {
  .route { grid-template-columns: 34px minmax(0, 1fr) 52px var(--route-action-width); }
  .route .route-name { grid-column: 1 / -1; margin-bottom: 4px; }
  .route .route-who { font-size: 13px; color: var(--muted); }
}
.route li:last-child { border-bottom: 0; }
.route li.done { background: var(--ok-bg); border-radius: 8px; }
.route li.sent { background: var(--warn-bg); border-radius: 8px; }
.route li.done :is(.route-name, .route-who, .route-date) { text-decoration: line-through 2px; }
.route li.mine { background: var(--tint); border-radius: 8px; padding: 5px 6px; }
.route .route-who { color: var(--head); overflow-wrap: anywhere; }
.route .route-date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.route li.route-request { background: var(--warn-bg); border-radius: 8px; }
.route-request-state { display: block; color: var(--warn); font-size: 12px; font-weight: 600; }
.route-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.route-heading h2 { margin: 0; }
.route-heading [data-route-mode][aria-pressed="true"] { background: var(--warn-bg); border-color: #dfb756; color: var(--warn); }
.route-heading [data-route-mode]:disabled { opacity: .5; cursor: default; }
.route-editing .route-done, .route-editing .route-photo > * { display: none; }
.route-editor-footer { margin-top: 12px; justify-content: flex-end; }
.route-correction, .route-new > .route-editor-row { grid-column: 1 / -1; }
.route-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 90px auto; align-items: end; gap: 8px; padding: 8px 0; }
.route-editor-row label { display: grid; gap: 4px; margin: 0; }
.route-editor-row select { min-width: 0; }
.route-editor-row[data-removed] { background: var(--warn-bg); }
.route-editor-row[data-removed] select, .route-editor-row[data-removed] input { text-decoration: line-through; }
@media (max-width: 680px) {
  .route-editor-row { grid-template-columns: minmax(0, 120px) minmax(0, 86px) auto; }
  .route-editor-row label:first-child { grid-column: 1 / -1; }
}
.stage-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
#claim-dialog { width: min(820px, calc(100vw - 24px)); }
.stage-dialog::backdrop { background: rgba(38, 52, 59, .45); }
.stage-dialog-close { display: flex; margin-left: auto; width: 34px; height: 34px; padding: 0; font-size: 24px; }
.stage-dialog .stage-card { max-width: none; margin: 0; padding: 10px 0 0; border: 0; box-shadow: none; }
.stage-dialog .stage-card h1, .stage-dialog > h2 { font-size: 23px; }

.upload-flag { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0; }

/* Операции: справочник и сводка (фаза 9) */
.cat-tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.cat-search { display: flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
.cat-search input[type=text] { width: 280px; max-width: 100%; }
.cat-work h2 { font-size: 16px; }
.kod-work { background: var(--tint); border-radius: 6px; padding: 1px 7px; margin-right: 4px; }
.cat-table td { padding: 3px 6px; vertical-align: middle; }
.cat-row { display: flex; gap: 6px; align-items: center; margin: 0; }
.cat-row input[type=text] { flex: 1; min-width: 120px; padding: 4px 8px; font-size: 14px; }
.cat-row select { padding: 4px 6px; font-size: 13px; max-width: 260px; }
.cat-qty { width: 64px !important; flex: 0 0 64px !important; padding: 4px 6px !important; }
.cat-add { margin-top: 6px; }
.cal-month { color: var(--head); text-transform: capitalize; }
.sum-table td { padding: 5px 8px; font-size: 14px; }
.sum-total td { font-weight: 700; border-top: 2px solid var(--line); }
.bad-text { color: var(--bad); font-weight: 700; }
.route-change { margin-top: 8px; font-size: 14px; }
.route-change summary { cursor: pointer; font-weight: 700; color: var(--head); }
.route-change form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.route-change select, .route-change input { width: auto; flex: 1 1 140px; padding: 5px 8px; font-size: 14px; }
.route-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.route-pending-description { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.route-pending-work-link { display: inline-block; margin-left: 6px; }
.route-pending-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin: 0 0 0 auto; }

/* Регламенты на этапах (фаза 8) */
.reg-upload { display: flex; gap: 6px; align-items: center; margin: 0; }
.reg-upload input[type=file] { max-width: 220px; font-size: 13px; }
.stage-card h1 { font-size: 21px; }
.stage-reg { display: flex; align-items: center; gap: 8px; background: #e6ecf8; border: 1px solid #c5d2ee; border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 14px; color: #3d5a99; font-weight: 700; text-decoration: none; }
.stage-reg span { margin-left: auto; font-size: 12px; }
.stage-points { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.stage-points label { display: flex; gap: 8px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 14px; font-weight: 400; cursor: pointer; }
.stage-points label:has(input:checked) { background: var(--ok-bg); border-color: #b9dfc6; }
.stage-points input { margin-top: 2px; }
.route-reg { font-size: 12px; font-weight: 700; color: #3d5a99; text-decoration: none; white-space: nowrap; }
.route-sens { font-size: 11px; font-weight: 700; color: var(--bad); }

/* «Контроль сроков» (фаза 7) */
.ctl-table td { vertical-align: middle; font-size: 14px; }
.ctl-pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.ctl-pill.r { background: var(--bad-bg); color: var(--bad); }
.ctl-pill.y { background: var(--warn-bg); color: var(--warn); }
.ctl-list { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
.ctl-list li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.ctl-list li:last-child { border-bottom: 0; }
.ok-text { color: var(--ok); font-weight: 700; margin: 0; }

/* «Шлагбаум» техника (фаза 5) */
.gate-head { background: var(--bad-bg); border: 1px solid #efb9b4; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
.gate-head h1 { color: var(--bad); font-size: 22px; margin: 0 0 4px; }
.gate-head p { margin: 0; font-size: 14px; }
.card.gate-card.late { border: 2px solid #efb9b4; }
.gate-card h2 { font-size: 17px; margin-bottom: 2px; }
.gate-q { font-weight: 700; color: var(--head); margin: 8px 0 6px; font-size: 14px; }
.gate-reasons { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.gate-reasons label { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 14px; cursor: pointer; }
.gate-reasons label:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.gate-reasons label { font-weight: 600; }
.gate-reasons span { flex: 1; }
.gate-reasons small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.gate-reasons .tag { font-style: normal; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 0 6px; white-space: nowrap; }
.gate-reasons .tag.ok { background: var(--ok-bg); color: var(--ok); }
.gate-reasons .tag.bad { background: var(--bad-bg); color: var(--bad); }

/* Календарь техника (фаза 4) */
.cal-pick { display: flex; gap: 6px; align-items: center; margin: 0; }
.cal-pick select { width: auto; }
.cal-must { background: var(--bad-bg); border: 1px solid #efb9b4; border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.cal-must b { color: var(--bad); }
.cal-must ul { margin: 4px 0 0; padding-left: 18px; }
.cal-legend { font-size: 13px; color: var(--muted); display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: -6px; }
.cal-dot.mine { background: var(--accent); } .cal-dot.wait { background: #aab7bd; } .cal-dot.late { background: var(--bad); } .cal-dot.done { background: var(--ok); }
.cal-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 160px; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--tint); }
.cal-dh { display: flex; justify-content: space-between; color: var(--head); font-size: 14px; margin-bottom: 4px; }
.cal-dh span { color: var(--muted); }
.cal-load { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cal-op { border-left: 4px solid var(--accent); background: #fff; border-radius: 8px; padding: 5px 7px; margin-bottom: 6px; font-size: 13px; line-height: 1.3; }
.cal-op a { text-decoration: none; color: var(--text); }
.cal-op.done { border-left-color: var(--ok); background: var(--ok-bg); } .cal-op.done .cal-name { text-decoration: line-through; }
.cal-op.late { border-left-color: var(--bad); background: var(--bad-bg); }
.cal-op.wait { border-left-color: #aab7bd; background: #f1f4f5; }
.cal-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 3px 0; border-top: 1px dashed var(--line); }
.cal-line.done { background: var(--ok-bg); border-radius: 4px; }
.cal-line.done .cal-name { text-decoration: line-through; color: var(--text); }
.cal-line.late .cal-name { color: var(--bad); }
.cal-line.wait .cal-name { color: var(--muted); }
.cal-line form { margin: 0; } .cal-line button { padding: 1px 9px; font-size: 13px; }
.cal-check { color: var(--ok); font-weight: 700; }
.cal-note { font-size: 12px; color: var(--muted); }
.cal-due { display: block; font-size: 12.5px; font-weight: 700; color: var(--bad); text-decoration: none; border: 1px dashed #efb9b4; border-radius: 8px; padding: 4px 6px; margin-bottom: 6px; }
.cal-due.fit { color: var(--warn); border-color: #ecd59c; }
.my-orders td { vertical-align: middle; }
.my-orders tr.my-late td { background: var(--bad-bg); }
.my-late-text { color: var(--bad); font-weight: 700; }
@media (max-width: 700px) { .cal-week { grid-template-columns: 1fr; } .cal-day { min-height: 0; } }
@media (max-width: 600px) {
  .my-orders thead { display: none; }
  .my-orders tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .my-orders td { display: block; border: 0; padding: 2px 6px; }
  .my-orders td.nowrap:last-child::before { content: "Мои операции: "; color: var(--muted); }
  .my-orders td.nowrap:nth-child(3)::before { content: "Сдача: "; color: var(--muted); }
}

/* Приёмка комплекта (фаза 3) */
.card.kit-pending { border: 2px solid #ecd59c; }
.card.kit-missing { border: 2px solid #efb9b4; }
.kit-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 10px; }
.kit-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.kit-table tr.kit-done td { background: var(--ok-bg); }
.kit-table tr.kit-no td { background: var(--bad-bg); }
.kit-choice { white-space: nowrap; text-align: right; }
.kit-choice label { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 13px; }
.kit-choice input[type=radio] { accent-color: var(--accent); }
.kit-list { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
.kit-list li { padding: 2px 0; }
.kit-list li.kit-no { color: var(--bad); font-weight: 700; }
.kit-decide { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.kit-decide select, .kit-decide input { width: auto; flex: 1 1 200px; }
.kit-dates { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.kit-dates h3 { font-size: 15px; margin: 0 0 6px; }
.kit-date-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; padding: 3px 0; }
.kit-date-row input { width: auto; padding: 4px 8px; }
.kit-table .small { font-size: 12px; line-height: 1.3; }
@media (max-width: 600px) {
  .kit-table { font-size: 13.5px; }
  .kit-table tr { display: block; border-bottom: 1px solid var(--line); padding: 4px 2px; }
  .kit-table td { display: block; border: 0; padding: 0 2px; line-height: 1.3; }
  .kit-choice { text-align: left; margin-top: 2px; }
  .kit-choice label { margin: 0 12px 0 0; font-size: 13px; }
}

/* Меню - тонкая полоса под логотипом (владелец, 20.10.2026: «верхний блок громоздкий»). Три блока разделены
   чертой, у каждого свой цвет подчёркивания: наряды - голубой, контроль - зелёный, администрирование - охра. */
.nav.nav-strip { order: 3; flex-basis: 100%; gap: 0; align-items: stretch; border-top: 1px solid var(--line); margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 8px); }
.top .wrap:has(.nav-strip) { row-gap: 0; padding-top: 8px; min-height: 0; }
.nav-strip .nav-grp { display: flex; flex-wrap: wrap; align-items: stretch; --grp: var(--accent); }
.nav-strip .nav-grp + .nav-grp { border-left: 1px solid var(--line); margin-left: 6px; padding-left: 6px; }
.nav-strip .grp-control { --grp: #2f8a57; }
.nav-strip .grp-admin { --grp: #c08a1e; margin-left: auto !important; border-left: 0 !important; }
.nav-strip a, .nav-strip .nav-drop-btn { display: flex; align-items: center; padding: 11px 5px 9px; font-size: 14px; border-radius: 0; border-bottom: 3px solid transparent; background: none; }
.nav-strip a:hover, .nav-strip .nav-drop-btn:hover { background: none; color: var(--grp); }
.nav-strip a.on, .nav-strip .nav-drop-btn.on { background: none; border-bottom-color: var(--grp); color: var(--text); }
.nav-strip a.nav-new { background: none; color: var(--text); }
.nav-count { display: inline-block; min-width: 20px; margin-left: 5px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--btn-text); font-size: 12.5px; font-weight: 700; line-height: 20px; text-align: center; }
.nav-count-warning { padding-inline: 5px; background: #f5cf54; }
.grp-control .nav-count { background: var(--bad); color: #fff; }
.nav-drop { position: relative; }
.nav-drop-btn { border: 0; font: inherit; font-weight: 600; color: var(--head); cursor: pointer; }
.nav-menu { display: none; position: absolute; right: 0; top: 100%; z-index: 30; flex-direction: column; min-width: 250px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid #c08a1e; border-radius: 0 0 12px 12px; box-shadow: var(--shadow); padding: 6px; }
.nav-drop:hover .nav-menu, .nav-drop:focus-within .nav-menu, .nav-drop.open .nav-menu { display: flex; }
.nav-menu a { border-bottom: 0 !important; padding: 8px 10px !important; border-radius: 8px !important; }
.nav-menu a:hover, .nav-menu a.on { background: #fbefd2 !important; color: var(--text) !important; }
@media (max-width: 860px) {
  .nav.nav-strip { padding: 0 calc(var(--gutter) - 6px); }
  .nav-strip .nav-grp + .nav-grp { border-left: 0; margin-left: 0; padding-left: 0; }
  .nav-strip .grp-admin { margin-left: 0 !important; }
  .nav-strip a, .nav-strip .nav-drop-btn { padding: 8px 7px 6px; font-size: 14px; }
  .nav-menu { right: auto; left: 0; }
}
.adm-courier { border-left-color: var(--warn); }
.rep-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }

/* Календарь техников у лаборатории: техники кнопками, несколько сразу - у каждого свой цвет (20.10.2026) */
.tech-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tech-chip { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; overflow: hidden; }
.tech-chip a { text-decoration: none; padding: 5px 10px; color: var(--head); }
.tech-chip .tech-plus { padding: 5px 9px; border-left: 1px solid var(--line); color: var(--muted); }
.tech-chip.on { border-color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc); background: var(--tc-bg); }
.tc0 { --tc: #00ACE5; --tc-bg: #e3f6fc; } .tc1 { --tc: #8a5cc7; --tc-bg: #f0e9f9; } .tc2 { --tc: #d9822b; --tc-bg: #fbeedd; }
.tc3 { --tc: #2f8a57; --tc-bg: #e2f3e8; } .tc4 { --tc: #c2477a; --tc-bg: #f9e3ec; } .tc5 { --tc: #5a6b73; --tc-bg: #eceff1; }
.cal-op[class*="tc"]:not(.late):not(.done):not(.wait) { border-left-color: var(--tc); }
.cal-who { font-size: 11.5px; font-weight: 700; color: var(--tc, var(--head)); text-transform: uppercase; letter-spacing: .02em; }
.cal-op[draggable="true"] { cursor: grab; }
.cal-op.dragging { opacity: .4; }
.cal-day.drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--tint); }
.cal-exec { flex: 1; min-width: 0; }
.cal-exec summary { cursor: pointer; list-style: none; }
.cal-exec summary::-webkit-details-marker { display: none; }
.cal-exec form { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.cal-exec select { font-size: 13px; padding: 3px 6px; }

/* Календарь администратора: сдачи, примерки, готовность и задачи (20.10.2026) */
.cal-due.rdy { color: var(--head); border-color: var(--line); font-weight: 600; }
.cal-due.adm-done { opacity: .55; }
.adm-works { font-weight: 400; }
.adm-k { font-size: 12px; font-weight: 700; border: 1px dashed var(--line); border-radius: 6px; padding: 0 5px; }
.adm-k.fit { color: var(--warn); border-color: #ecd59c; } .adm-k.hand { color: var(--bad); border-color: #efb9b4; } .adm-k.rdy { color: var(--head); }
.adm-task { display: flex; align-items: flex-start; gap: 4px; font-size: 13px; line-height: 1.3; background: #fbf3e2; border-radius: 8px; padding: 4px 6px; margin-bottom: 6px; }
.adm-task form { margin: 0; }
.adm-task .adm-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.adm-task.done, .adm-task.moved { opacity: .55; } .adm-task.done .adm-title { text-decoration: line-through; }
.adm-check, .adm-del { background: none; border: 0; padding: 0 2px; font-size: 15px; line-height: 1.2; cursor: pointer; color: var(--head); }
.adm-del { color: var(--muted); }
.adm-add { margin-top: 2px; }
.adm-task-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.adm-task-form input[type="text"] { flex: 1 1 260px; min-width: 0; width: auto; }
.adm-task-form input[type="date"] { width: auto; flex: 0 0 auto; }
.adm-task-form select { width: auto; max-width: 260px; flex: 0 1 auto; }
/* Шапка лаборатории: «Уведомления · Защита входа · Выйти» - справа; «Не приняты» - как остальные пункты (20.10.2026) */
.top .wrap:has(.nav-strip) .who { margin-left: auto; }
.nav-strip a.nav-new, .nav-strip a.nav-new:hover, .nav-strip a.nav-new:focus, .nav-strip a.nav-new:active { background: none; color: var(--text); }
.nav-strip a.nav-new:hover { color: var(--grp); }
.nav-strip a.nav-new.on { border-bottom-color: var(--grp); }
/* Календарь техников: несделанное прошлых дней - на «сегодня», в своём дне бледно (20.10.2026) */
.cal-op.moved { border-left-color: #c9d3d8; background: #f6f7f8; opacity: .55; }
.cal-line.moved .cal-name { color: var(--muted); }
.cal-note.late-note { color: var(--bad); font-weight: 700; }
/* Регламенты папками: техники / администратор, видео - ссылкой на Облако (21.10.2026) */
.reg-folder > summary { cursor: pointer; list-style: none; }
.reg-folder > summary::-webkit-details-marker { display: none; }
.reg-folder > summary h2 { margin: 0; }
.reg-folder > summary h2::before { content: "▸ "; color: var(--muted); }
.reg-folder[open] > summary h2::before { content: "▾ "; }
.reg-list { list-style: none; margin: 10px 0 0; padding: 0; }
.reg-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.reg-list .reg-name { flex: 1 1 280px; font-weight: 600; }
.reg-list .reg-upload { display: flex; gap: 6px; align-items: center; margin: 0; }
.reg-list input[type="url"] { width: 280px; font-size: 13px; padding: 4px 8px; }
.reg-edit > summary { cursor: pointer; color: var(--muted); text-decoration: underline dotted; list-style: none; }
.reg-edit > summary::-webkit-details-marker { display: none; }
.reg-edit[open] { flex-basis: 100%; }
.reg-edit[open] > summary { margin-bottom: 4px; }
/* Режим руководителя (владелец, 21.10.2026) - видно, что права расширены, и как вернуться в кабинет врача */
.owner-badge { display: flex; align-items: center; gap: 8px; margin: 0; padding: 3px 4px 3px 10px; border-radius: 999px; background: #fbefd2; box-shadow: inset 0 0 0 1px #ecd59c; font-size: 13px; font-weight: 700; color: #7a5300; }

/* Наряд у лаборатории и техника: маршрут крупно, остальное - узкой компактной колонкой (владелец, 22.10.2026) */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 14px; align-items: start; }
.order-main, .order-main-column { min-width: 0; }
.order-main #route, .claim-origin { padding: 14px 16px; }
.order-main #route > h2, .claim-origin > h2 { margin: 0 0 8px; font-size: 19px; }
.claim-origin details + details { margin-top: 6px; }
.claim-origin details > p { margin: 4px 0 0; }
.ops-embedded .ops-tiles, .order-main .ops-tiles { margin-bottom: 8px; }
.order-side { min-width: 0; font-size: 13px; }
.order-side .card { padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; }
.order-side h2 { font-size: 15px; margin: 0 0 6px; }
.order-side h3 { font-size: 13px; margin: 6px 0 2px; }
.order-side .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.order-side .facts dt { font-size: 11.5px; }
.order-side .facts dd { font-size: 13px; }
.order-side .formula { gap: 2px; margin: 2px 0 6px; }
.order-side .formula .tooth { min-height: 26px; padding: 1px 0; font-size: 10.5px; border-radius: 5px; }
.order-side .formula .tooth small { font-size: 8px; min-height: 8px; }
.order-side .formula.view .tooth small { display: none; }
.order-side .formula .tooth.mid { margin-right: 3px; }
.order-side .table { font-size: 12.5px; }
.order-side .table th, .order-side .table td { padding: 4px 5px; }
.order-side .item-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order-side .price-note { font-size: 11.5px; }
.order-side .files { margin-bottom: 6px; }
.order-side .files li { padding: 3px 0; font-size: 12.5px; }
.order-side .files li a { overflow-wrap: anywhere; }
/* Узкая колонка: имя файла - строкой целиком, пометка и размер - под ним (иначе пометка сжимала имя в столбик) */
.order-side .files li { flex-wrap: wrap; align-items: center; justify-content: flex-start; column-gap: 8px; row-gap: 2px; }
.order-side .files li a { flex: 1 1 100%; }
.order-side .files-title { margin-top: 4px; }
.order-side .timeline { font-size: 12.5px; max-height: 220px; overflow-y: auto; }
.order-side .timeline li { padding: 3px 0 3px 12px; }
.order-side .timeline li::before { width: 7px; height: 7px; left: -4.5px; top: 8px; }
.order-side .timeline time { font-size: 11.5px; }
.order-side .chat-form textarea { min-height: 60px; }
.upload-details > summary { list-style: none; display: inline-block; cursor: pointer; }
.upload-details > summary::-webkit-details-marker { display: none; }
.upload-details[open] > summary { margin-bottom: 8px; }
.order-attachment-list > summary { color: var(--head); font-weight: 600; cursor: pointer; padding: 4px 0; }
.order-attachment-controls { display: grid; gap: 6px; margin-top: 8px; }
.order-attachment-controls > button, .order-attachment-controls .upload-details > summary { width: 100%; min-height: 36px; }
.order-attachment-controls .upload-details > summary { display: inline-flex; }
.order-attachment-actions { gap: 6px; margin-bottom: 8px; }
.order-attachment-dialog { overflow-y: auto; }
.order-attachment-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.order-attachment-head h2, .order-attachment-head form { margin: 0; }
.order-photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.order-photo-gallery li { align-content: start; border-bottom: 0; }
.order-photo-preview img { display: block; width: 100%; height: 110px; object-fit: contain; border-radius: 8px; background: var(--bg); }
.status-inline { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: flex-end; }
.status-inline .si-field { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); flex: 1 1 120px; min-width: 0; }
.status-inline select, .status-inline input { padding: 4px 6px; font-size: 13px; width: 100%; }
.accept-card.side-compact { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.accept-card.side-compact form { margin: 0; }
@media (max-width: 980px) { .order-layout { grid-template-columns: 1fr; } }
.ops-embedded .ops-table select, .ops-embedded .ops-table input[type=text] { min-width: 180px; width: 100%; max-width: 260px; }
.ops-embedded .ops-table td:nth-child(2) { min-width: 200px; }
.ops-embedded .ops-table input[type=date] { min-width: 0; width: 130px; }
/* «Операции» в наряде - компактнее (владелец, 22.10.2026) */
.ops-embedded .ops-bar { padding: 5px 8px; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.ops-embedded .ops-bar select { padding: 4px 6px; font-size: 13px; max-width: 220px; }
.ops-bar-sep { flex: 0 0 1px; align-self: stretch; background: #bfe6f4; margin: 0 4px; }
.ops-embedded ~ .ops-tiles, .order-main .ops-tiles { gap: 6px; }
.order-main .ops-tile { padding: 3px 8px; font-size: 12.5px; }
.order-main .ops-tile b { font-size: 14px; }
.ops-embedded .ops-table { font-size: 13px; }
.ops-embedded .ops-table th { padding: 4px 6px; font-size: 12px; }
.ops-embedded .ops-table td { padding: 3px 6px; }
.ops-embedded .ops-table select, .ops-embedded .ops-table input[type=text], .ops-embedded .ops-table input[type=date] { padding: 3px 6px; font-size: 13px; }
.ops-embedded .ops-table button.small { padding: 4px 10px; font-size: 12.5px; }
.ops-embedded .ops-add { margin: 6px 0; font-size: 13px; }
.ops-embedded .ops-actions { margin: 6px 0 4px; gap: 6px; }
.ops-embedded .ops-actions button { padding: 6px 12px; font-size: 13px; }
.ops-embedded .ops-hint { font-size: 11.5px; margin: 2px 0 0; }
.order-main .ops-warn { padding: 6px 10px; font-size: 13px; margin: 0 0 6px; }
.items-edit { margin: 4px 0 6px; }
.items-edit > summary { list-style: none; display: inline-block; cursor: pointer; }
.items-edit > summary::-webkit-details-marker { display: none; }
.items-edit[open] > summary { margin-bottom: 6px; }
.ie-row { display: flex; gap: 4px; align-items: center; margin: 0 0 4px; flex-wrap: wrap; }
.ie-row b { min-width: 42px; font-size: 12.5px; }
.ie-row input, .ie-row select { padding: 3px 5px; font-size: 12.5px; width: auto; }
.ie-row .ie-teeth { flex: 1 1 70px; min-width: 0; }
.ie-row .ie-qty { width: 48px; }
.ie-row select { flex: 1 1 100%; min-width: 0; }
.ie-row button.small { padding: 3px 8px; font-size: 12.5px; }
.ie-add { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 4px; }
/* Переключатель «Вручную по специальностям / Автоматически» (владелец, 22.10.2026) */
.ops-switch { display: inline-flex; border: 1px solid #bfe6f4; border-radius: 999px; overflow: hidden; background: #fff; }
.ops-mode-btn { background: none; border: 0; padding: 4px 10px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--head); cursor: pointer; border-radius: 0; box-shadow: none; }
.ops-mode-btn.on { background: var(--accent); color: #fff; }
.ops-mode { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ops-mode[hidden] { display: none; }
.ops-role { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; }
.ops-role select { width: auto; max-width: 180px; padding: 3px 6px; font-size: 12.5px; }
/* «Распределение операций» плотнее, «Исправить», крестик, подтверждение вторым нажатием (владелец, 22.10.2026) */
.ops-embedded .ops-modes { padding: 4px 8px; gap: 4px 8px; }
.ops-bar-title { font-size: 12.5px; color: var(--head); white-space: nowrap; }
.ops-embedded .ops-role { gap: 3px; }
.ops-embedded .ops-role select { max-width: 150px; }
.ops-edit-only { display: none; }
.ops-editing .ops-edit-only { display: inline-flex; }
.ops-editing .ops-view-only { display: none; }
.ops-edit-name { gap: 4px; width: 100%; }
.ops-edit-name input { padding: 3px 6px; font-size: 13px; }
.ops-edit-name .ops-code-input { flex: 0 0 64px; width: 64px; }
.ops-qty input { width: 54px; padding: 3px 4px; font-size: 13px; }
.ops-del { background: none; border: 1px solid var(--line); color: var(--bad); border-radius: 6px; padding: 1px 7px; font-size: 13px; line-height: 1.4; cursor: pointer; box-shadow: none; }
.ops-del:hover { background: var(--bad-bg); border-color: #efb9b4; }
button.armed { background: var(--bad-bg) !important; color: var(--bad) !important; border-color: #efb9b4 !important; }
#works:has(.items-edit[open]) > .formula.view { display: none; }
.items-edit-form .formula-builder { margin-bottom: 6px; }
.order-side .items-edit-form .formula-modes { flex-wrap: wrap; gap: 3px; }
.order-side .items-edit-form .formula-modes .mode { padding: 2px 6px; font-size: 11.5px; }
.order-side .items-edit-form .formula-target { font-size: 11.5px; }
.order-side .items-edit-form .help { font-size: 11px; margin: 2px 0 4px; }
.order-side .items-edit-form .picker-bar input { padding: 4px 6px; font-size: 12.5px; }
.order-side .items-edit-form .picker-bar button { padding: 4px 8px; font-size: 12.5px; }
.order-side .items-edit-form .picker-list { font-size: 12px; max-height: 260px; }
.order-side .items-edit-form .items-head { font-size: 11px; }
.order-side .items-edit-form .item-row .row { gap: 3px; }
.order-side .items-edit-form .item-row select, .order-side .items-edit-form .item-row input { padding: 3px 4px; font-size: 12px; }
.ie-actions { margin-top: 6px; gap: 6px; }
.order-side .items-edit-form .items-head, .order-side .items-edit-form .item-row .row { grid-template-columns: minmax(0, 1fr) 64px 40px 22px; }
/* Правка работ открыта - правой колонке нужно место под формулу (владелец, 22.10.2026) */
.order-side .items-edit-form { min-width: 0; }
.ops-embedded .ops-table select { max-width: 190px; min-width: 140px; }
.ops-embedded .ops-table input[type=date] { width: 124px; }
.ops-embedded .ops-table .ops-work { white-space: normal; min-width: 52px; }
.ops-embedded .ops-table th.right { white-space: nowrap; }
main .wrap:has(.order-layout) { max-width: 1440px; }
.ops-embedded .ops-table .ops-edit-name input.ops-code-input, .ops-table .ops-edit-name input.ops-code-input { min-width: 0; width: 60px; flex: 0 0 60px; }
.ops-embedded .ops-table .ops-edit-name input[name^="name_"], .ops-table .ops-edit-name input[name^="name_"] { min-width: 0; max-width: none; flex: 1 1 auto; }
.ops-table .ops-qty input { min-width: 0; }
.ops-table .ops-edit-name input[name^="pick_"] { min-width: 0; max-width: none; width: 100%; flex: 1 1 auto; padding: 3px 6px; font-size: 13px; }
/* Таблица операций плотнее: операция в одну строку, мельче шрифт, узкая дата (владелец, 22.10.2026) */
.ops-embedded .ops-table { font-size: 12.5px; }
.ops-embedded .ops-table td { padding: 2px 5px; }
.ops-embedded .ops-table .ops-work { font-size: 11.5px; line-height: 1.25; }
.ops-embedded .ops-table .ops-work .small { font-size: 11px; }
.ops-embedded .ops-op { max-width: 0; width: 100%; }
.ops-embedded .ops-op .ops-view-only { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-editing .ops-op .ops-view-only { display: none; }
.ops-embedded .ops-op .ops-note, .ops-embedded .ops-op .ops-why { font-size: 11px; line-height: 1.25; }
.ops-embedded .ops-op .route-sens, .ops-embedded .ops-op .route-reg { font-size: 11px; }
.ops-embedded .ops-table select { min-width: 0; width: 118px; max-width: 118px; padding: 2px 4px; font-size: 12px; }
.ops-embedded .ops-table input[type=text]:not([name^="pick_"]) { min-width: 0; width: 118px; padding: 2px 4px; font-size: 12px; }
.ops-embedded .ops-table input[type=date] { width: 112px; min-width: 0; padding: 2px 3px; font-size: 12px; }
.ops-embedded .ops-table button.small { padding: 2px 8px; font-size: 12px; }
.ops-embedded .ops-table th { font-size: 11.5px; padding: 3px 5px; }
.ops-embedded .ops-qty { width: 34px; }
.ops-add-btn { list-style: none; font-weight: 700; border-width: 2px; color: var(--accent-dark, var(--head)); }
.ops-add-btn::-webkit-details-marker { display: none; }
.ops-add[open] > .ops-add-btn { margin-bottom: 4px; }
.ops-embedded .ops-table .ops-work { white-space: nowrap; }
/* Нижние кнопки «Операций» компактнее; фрезерный центр «Отправлено/Получено» (владелец, 22.10.2026) */
.ops-embedded .ops-actions { gap: 4px; margin: 4px 0 2px; }
.ops-embedded .ops-actions button { padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.ops-embedded .ops-add { margin: 4px 0; }
.ops-embedded .ops-add-btn { padding: 3px 9px; font-size: 12px; border-width: 2px; }
.ops-embedded .ops-add-row select, .ops-embedded .ops-add-row input, .ops-embedded .ops-add-row button { padding: 3px 6px; font-size: 12px; }
.ops-ext-note { font-size: 11px; color: var(--muted); }
/* Блок «Операции», вариант «А» (владелец, 22.10.2026) */
.ops-top { flex-direction: column; align-items: stretch; gap: 4px; }
.ops-top-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-height: 26px; }
.ops-top select { width: auto; padding: 2px 6px; font-size: 12.5px; max-width: 170px; }
.ops-lead-label { margin-left: 6px; font-size: 12.5px; }
.ops-top-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.ops-top-actions button { padding: 3px 10px; font-size: 12.5px; }
.ops-top-actions.claim-accept { flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ops-foot { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: center; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
.ops-link { background: none; border: 0; box-shadow: none; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent-dark, #0a7fa8); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; list-style: none; }
.ops-link:hover { color: var(--head); }
.ops-link::-webkit-details-marker { display: none; }
.ops-foot .ops-add { margin: 0; }
.ops-foot .ops-add[open] { flex-basis: 100%; order: 10; }
.ops-foot .ops-add-btn { border: 0; padding: 2px 0; font-size: 12.5px; }
.ops-link.armed { padding: 2px 8px; border-radius: 6px; text-decoration: none; }
.ops-top #lead_tech { max-width: 150px; }
.ops-top .ops-mode button.small { padding: 3px 10px; font-size: 12.5px; }
.ops-top .ops-role select { max-width: 130px; }
/* Наряд, правки владельца 26.10: строки не «прыгают» - кнопка одной ширины, дата в графе «Дата», цвет строки */
.ops-act { width: 46px; text-align: center; }
.ops-table tr.ops-done td { background: var(--ok-bg); color: var(--text); }
.ops-table tr.ops-done .ops-op .ops-view-only { text-decoration: line-through; }
.ops-table tr.ops-sent td { background: var(--warn-bg); }
.ops-date { width: 120px; white-space: nowrap; }
.ops-date-mark { display: inline-block; width: 112px; padding: 2px 4px; font-size: 12px; font-weight: 600; border-radius: 6px; }
.ops-date-mark.done { color: var(--ok); }
.ops-date-mark.sent { color: var(--warn); }
/* «Работы» в широкой колонке - компактно */
.order-main #works { padding: 10px 14px; }
.order-main #works > h2 { font-size: 17px; margin: 0 0 6px; }
.order-main #works .formula.view { gap: 2px; margin: 2px 0 6px; }
.order-main #works .formula.view .tooth { min-height: 26px; padding: 1px 0; font-size: 11px; border-radius: 5px; }
.order-main #works .formula.view .tooth small { font-size: 8.5px; min-height: 8px; }
.order-main #works .table { font-size: 12.5px; }
.order-main #works .table th, .order-main #works .table td { padding: 3px 6px; }
.order-main #works .price-note { font-size: 11.5px; }
.order-main #works .right { margin: 4px 0 0; }
/* Календарь техников в наряде */
.order-week { padding: 10px 14px; }
.order-week-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.order-week-head h2 { font-size: 17px; margin: 0; }
.order-week-head .btns { margin-left: auto; }
.order-week .cal-day { min-height: 90px; padding: 6px; }
.order-week .cal-op { font-size: 12px; }
.cal-op.cal-this { box-shadow: 0 0 0 2px var(--accent); }
/* Краткая инструкция под операциями */
.ops-help { margin-top: 6px; }
.ops-help, .claim-origin details { font-size: 12.5px; }
.ops-help summary, .claim-origin summary { cursor: pointer; font-weight: 600; color: var(--head); }
.ops-help ul { margin: 4px 0 0; padding-left: 18px; color: var(--text); }
.ops-help li { margin-bottom: 3px; }
.ops-foot .ops-add-btn { list-style: none; padding: 3px 10px !important; font-size: 12.5px; text-decoration: none; }
/* Данные наряда, примерка в статусе */
.order-side .status-inline input[type="datetime-local"] { font-size: 12.5px; }
.order-week .cal-week { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
/* Блок статуса: статус | № ЗТЛ, ниже готовность и примерка - дата + время (владелец, 26.10.2026) */
.status-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px 8px; align-items: end; }
.status-grid .si-field { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.status-grid .si-wide { grid-column: 1 / -1; }
.status-grid select, .status-grid input { padding: 4px 6px; font-size: 13px; width: 100%; min-width: 0; }
.status-grid .si-dt { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 6px; }
.status-grid button.si-wide { justify-self: start; }
/* Календарь техников в наряде: месяц, техники кнопками (владелец, 26.10.2026) */
.order-week-title { font-size: 14px; color: var(--head); }
.order-week .ops-switch a { text-decoration: none; display: inline-block; }
.order-week .tech-chips { margin: 4px 0; }
.order-week .tech-chips .btn.on { background: var(--tint); }
.order-week .cal-week.cal-month { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-month .cal-day { min-height: 70px; padding: 4px; }
.cal-month .cal-day.other-month { opacity: .45; }
.cal-month .cal-dh { font-size: 12px; }
.cal-month .cal-dh b { display: none; }
.cal-month .cal-load { display: none; }
.cal-month .cal-op { padding: 2px 4px; margin-bottom: 3px; font-size: 11px; line-height: 1.2; }
.cal-month .cal-op .cal-who { font-size: 9.5px; }
.cal-month .cal-op a .muted { display: none; }
.cal-month .cal-count { font-size: 10.5px; color: var(--muted); }
.cal-month .cal-due { font-size: 10.5px; padding: 1px 3px; margin-bottom: 3px; }
.cal-month p.muted.small { display: none; }
.cal-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; margin-top: 4px; }

/* Перенос из ЗТЛ (PDF): проверка перед созданием наряда */
.ztl-check h3 { margin: 18px 0 6px; }
.ztl-check tr.ops-need td { background: var(--warn-bg); }
.ztl-facts th { width: 170px; text-align: left; font-weight: 600; }
.ztl-facts select, .ztl-facts input[type=text] { max-width: 360px; }
.ztl-facts label { margin-right: 14px; }

/* Наряд у лаборатории, правки владельца 27.10.2026 */
.save-big { padding: 12px 34px; font-size: 16px; }
.ops-embedded .ops-bar.ops-top { background: transparent; border: 1px solid var(--line); }
.ops-foot { gap: 6px 8px; padding-top: 8px; }
.ops-foot button.small, .ops-foot .ops-add-btn { padding: 4px 12px; font-size: 12.5px; border: 2px solid var(--accent); color: var(--btn-text); }
.ops-foot .ops-add-btn:hover { color: var(--btn-text); }
.disk-form { margin-top: 10px; }
.order-locked { opacity: .6; filter: grayscale(.4); user-select: none; }

/* «Документы»: клиника и даты в одну строку, наряды с галочками (владелец, 27.10.2026) */
.doc-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.doc-filter select { width: auto; min-width: 200px; }
.doc-filter label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.doc-filter input[type=date] { width: auto; }
.doc-filter { align-items: flex-end; }
.doc-filter .doc-clinic { display: grid; }
.doc-period { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.doc-period legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.doc-links { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.badge.pack-toggle { display: inline-flex; gap: .55em; align-items: center; padding: 5px 10px; border: 1px solid currentColor; line-height: 1.3; text-align: left; white-space: normal; }
.pack-toggle:hover, .pack-toggle:focus-visible { text-decoration: underline; }
.pack-toggle::before { flex-shrink: 0; }
.pack-toggle::before { content: ""; width: .45em; height: .45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.pack-toggle[aria-expanded=true]::before { transform: rotate(45deg); }
.pack-status { display: block; margin-top: 4px; }
.pack-panel > td { background: var(--tint); }
.pack-content { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 32px; padding: 8px 12px; border-left: 3px solid var(--head); }
.pack-title { font-weight: 700; }
.pack-action { margin-left: auto; align-self: center; }
.doc-pick td, .doc-pick th { vertical-align: middle; }
.doc-ic { display: inline-flex; width: 34px; height: 34px; padding: 0; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 18px; }
.doc-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.warn-box { background: var(--warn-bg); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
@media (max-width: 600px) {
  .doc-filter select, .doc-filter button { width: 100%; }
  .doc-filter label { flex: 1 1 40%; min-width: 0; }
  .doc-pick .badge { white-space: normal; border-radius: 8px; }
  .doc-filter input[type=date] { width: 100%; min-width: 0; padding: 8px; }
  .doc-pick .hide-narrow { display: none; }
  .doc-pick td, .doc-pick th { padding: 8px 4px; }
  .doc-ic { width: 30px; height: 30px; }
}

/* Календарь, владелец 29.10.2026: карточка - цветом своего техника, полоска слева - состояние операции */
.tc0 { --tc: #c99a06; --tc-bg: #fff2c2; } .tc1 { --tc: #d6609a; --tc-bg: #fde0ed; } .tc2 { --tc: #2f8a57; --tc-bg: #dcf1e4; }
.tc3 { --tc: #8a5cc7; --tc-bg: #ebe2f8; } .tc4 { --tc: #d9822b; --tc-bg: #fde6d2; } .tc5 { --tc: #0a8fbf; --tc-bg: #dbf2fb; }
.cal-op[class*="tc"] { background: var(--tc-bg) !important; border-left: 5px solid var(--accent) !important; }
.cal-op[class*="tc"].wait { border-left-color: #8f9da4 !important; }
.cal-op[class*="tc"].late { border-left-color: var(--bad) !important; }
.cal-op[class*="tc"].done { border-left-color: var(--ok) !important; background: var(--ok-bg) !important; }
.cal-op[class*="tc"].moved { border-left-color: #c9d3d8 !important; }
.cal-dot { border-radius: 2px; width: 5px; height: 12px; }

/* «Исправить» в операциях: таблица не меняет размер (владелец, 29.10.2026) */
.ops-embedded .ops-table tbody tr { height: 30px; }
.ops-embedded .ops-qty, .ops-embedded .ops-table th:nth-child(3) { width: 40px; min-width: 40px; }
.ops-embedded .ops-table .ops-qty input { width: 38px; padding: 0 2px; height: 22px; font-size: 12px; }
.ops-embedded .ops-table .ops-edit-name input[name^="pick_"] { height: 22px; padding: 0 4px; line-height: 20px; }

/* Время - в такой же круглой рамке, как остальные поля (владелец, 29.10.2026) */

/* Закрытый наряд: «Передан в клинику» - бледно и не нажимается, «Отменён» - красноватый (владелец, 29.10.2026) */
.order-locked { opacity: 1; filter: none; }
.order-locked .card { opacity: .5; filter: grayscale(1); }
.order-locked.order-cancelled .card { opacity: .6; filter: none; background: var(--bad-bg); border-color: #efb9b4; }
.order-locked.order-cancelled .card * { color: #a3433b !important; }
.order-locked button, .order-locked .btn, .order-locked summary { background: var(--line) !important; border-color: var(--line) !important; color: var(--muted) !important; }
.ops-embedded .ops-op .ops-view-only { line-height: 22px; }   /* та же высота, что у поля в «Исправить» */
.tech-chip[class*="tc"] { background: var(--tc-bg); border-color: var(--tc); }   /* кнопка техника - цвет его карточек */
.order-locked.order-cancelled .ops-table tr td { background: transparent !important; }   /* жёлтые строки «нет даты» в отменённом наряде не выделяем */
.ops-table .ops-days input { width: 40px; min-width: 0; padding: 2px 3px; font-size: 12px; text-align: right; }
.ops-embedded .ops-days { width: 46px; }

/* Операция на несколько дней - сплошная полоса через дни, как в Google Календаре (владелец, 29.10.2026) */
.cal-week { --cal-gap: 8px; --cal-pad: 8px; }
.order-week .cal-week { --cal-gap: 6px; --cal-pad: 6px; }
.order-week .cal-week.cal-month { --cal-gap: 4px; --cal-pad: 4px; }
.cal-span { display: block; position: relative; z-index: 1; height: 20px; line-height: 20px; margin: 0 calc(-1 * (var(--cal-pad) + 1px + var(--cal-gap) / 2)) 4px; padding: 0 6px; background: var(--tc-bg, var(--tint)); color: var(--text); font-size: 12px; white-space: nowrap; text-decoration: none; }
.cal-span.seg-first { margin-left: 0; border-left: 5px solid var(--accent); border-radius: 6px 0 0 6px; }
.cal-span.seg-last { margin-right: 0; border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.cal-span.seg-first.seg-last { border-radius: 6px; }
.cal-span.seg-label { z-index: 2; }
.cal-span.seg-label.seg-end { overflow: hidden; text-overflow: ellipsis; }
.cal-span.wait.seg-first { border-left-color: #8f9da4; }
.cal-span.late.seg-first { border-left-color: var(--bad); }
.cal-span.done { background: var(--ok-bg); } .cal-span.done.seg-first { border-left-color: var(--ok); }
.cal-span.done .cal-name { text-decoration: line-through; }
.cal-span.cal-this { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.cal-span.empty { visibility: hidden; margin-left: 0; margin-right: 0; }
.cal-month .cal-span { height: 16px; line-height: 16px; font-size: 10.5px; margin-bottom: 3px; padding: 0 4px; }
/* Рекламация клиники сохраняет фон техника, боковая полоска показывает статус операции. */
.cal-week, .cal-legend { --claim-navy: #17365d; }
.cal-dot.claim, .cal-op.cal-claim, .cal-op.cal-claim.done, .cal-span.cal-claim { background: var(--claim-navy) !important; color: white; }
.cal-dot.claim, .cal-dot.claim-clinic { width: 20px; }
.cal-dot.claim-clinic { display: inline-grid; place-items: center; background: var(--tc-bg); }
.cal-op.claim-clinic.done { background: var(--tc-bg) !important; }
.cal-span.claim-clinic { background: var(--tc-bg); }
.cal-op.claim-clinic :is(.muted, .cal-count), .cal-op.claim-clinic .cal-line:is(.wait, .moved) .cal-name { color: var(--head); }
.cal-op.claim-clinic .cal-line.done { background: transparent; }
.cal-op.claim-clinic > a > b::before, .cal-span.claim-clinic.seg-label > b::before, .cal-dot.claim-clinic::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--claim-navy);
}
.cal-op.claim-clinic > a > b::before, .cal-span.claim-clinic.seg-label > b::before { margin-right: 3px; vertical-align: 0.08em; }
.cal-op.cal-claim .cal-exec form .muted { color: white; }
.cal-op.cal-claim :is(a, .muted, .cal-count, .cal-line .cal-name) { color: inherit; }
.cal-op.cal-claim .cal-line.done { background: transparent; }
.cal-op.cal-claim .cal-line.late .cal-name { color: #ffc5bd; }
.cal-op.cal-claim .cal-check { color: #bceccc; }
.cal-span[draggable="true"] { cursor: grab; }
.cal-grip { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; border-radius: 0 6px 6px 0; background: var(--tc, var(--accent)); opacity: .55; }
.cal-grip:hover { opacity: 1; }
.cal-span.dragging { opacity: .4; }
/* Период «с — по» в операциях: даты без года (владелец, 29.10.2026) */
.ops-period { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.ops-table .ops-period input[type=text] { width: 48px !important; min-width: 0 !important; max-width: 48px; padding: 2px 3px !important; text-align: center; font-size: 12px; }
.ops-dash { color: var(--muted); font-size: 12px; }
.ops-days-note { font-size: 11px; color: var(--muted); margin-left: 3px; }

/* Правки владельца 30.10.2026 */
/* Операции: название видно целиком - переносится, шрифт чуть меньше */
.ops-embedded .ops-table { font-size: 12px; }
.ops-embedded .ops-op .ops-view-only { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
/* Рамка распределения не меняет высоту при «Вручную / Автоматически» */
.ops-top .ops-top-row + .ops-top-row { min-height: 31px; }
/* Дата начала + дней; больше дня - «по …» */
.ops-table .ops-period input.ops-days-input { width: 38px !important; max-width: 38px; min-width: 0 !important; padding: 2px 2px !important; text-align: right; margin-left: 4px; }
.ops-days-unit { font-size: 11px; color: var(--muted); margin-left: 2px; }
.ops-end { font-size: 11.5px; color: var(--head); margin-left: 6px; white-space: nowrap; }
/* Календари без промежутков между днями */
.cal-week { gap: 0 !important; --cal-gap: 0px !important; }
.cal-week .cal-day { border-radius: 0; margin: 0 -1px -1px 0; }
.cal-month-head { gap: 0 !important; }
/* Выбранный техник - кнопка залита его цветом */
.tech-chip.on { background: var(--tc) !important; border-color: var(--tc) !important; box-shadow: none; }
.tech-chip.on a { color: #fff; font-weight: 700; }
.tech-chip.on .tech-plus { border-left-color: rgba(255, 255, 255, .5); color: #fff; }
/* Календарь техников в наряде - на всю ширину */
.order-week-wide { margin-top: 0; }
.kit-fold { padding: 10px 16px; }
.kit-fold > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kit-fold > summary::-webkit-details-marker { display: none; }
.kit-fold > summary::after { content: "▾"; color: var(--muted); margin-left: auto; }
.kit-fold[open] > summary { margin-bottom: 8px; }
.kit-fold[open] > summary::after { content: "▴"; }
/* Календарь администратора: «Месяц» (владелец, 30.10.2026) */
.cal-week.adm-month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.adm-month .cal-day { min-height: 96px; padding: 4px; font-size: 11px; }
.adm-month .cal-op, .adm-month .cal-due, .adm-month .adm-task { font-size: 10.5px; padding: 2px 4px; margin-bottom: 3px; }
.adm-month .adm-works, .adm-month .cal-note, .adm-month .adm-add { display: none; }
.cal-week.cal-month .cal-day.other-month { opacity: .45; }
.cal-week.cal-month { text-transform: none; }
.ops-switch a.ops-mode-btn { text-decoration: none; display: inline-block; }

/* Выбор даты в коротких полях наряда и операций. */
.date-picker { position: fixed; z-index: 2000; width: 248px; max-width: calc(100vw - 16px); padding: 10px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; }
.date-picker-head, .date-picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-picker-head span { font-weight: 600; text-transform: capitalize; }
.date-picker button { padding: 4px; min-height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.date-picker button:hover { background: var(--tint); }
.date-picker button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.date-picker-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin: 8px 0; text-align: center; }
.date-picker-grid > span { font-size: 11px; color: var(--muted); }
.date-picker-grid button[aria-current="date"] { box-shadow: inset 0 0 0 1px var(--accent); }
.date-picker-grid button[aria-pressed="true"] { background: var(--accent); color: var(--btn-text); font-weight: 600; }
.date-picker-foot { border-top: 1px solid var(--line); padding-top: 6px; }
.time-picker { box-sizing: border-box; padding: 6px; }
.time-picker-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
.time-picker-list { position: relative; height: 140px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.time-picker-list button { display: block; width: 100%; height: 28px; text-align: center; }
.time-picker-list button[aria-pressed="true"] { background: var(--accent); color: var(--btn-text); font-weight: 600; }
.time-picker-input { cursor: pointer; }
.status-grid .status-picker-trigger { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-family: inherit; font-size: 13px; line-height: 1.3; text-align: left; }
.status-picker-trigger::after { content: "▾"; flex: none; color: var(--muted); }
.status-picker-trigger:focus-visible, .status-picker-trigger[aria-expanded="true"] { outline: 1px solid var(--accent); outline-offset: 0; }
.status-picker { padding: 6px; max-height: calc(100vh - 16px); overflow-y: auto; }
.status-picker button { display: block; width: 100%; padding: 6px 8px; text-align: left; }
.status-picker button[aria-selected="true"] { background: var(--accent); color: var(--btn-text); font-weight: 600; }
.history-fold .timeline { margin-top: 12px; }
.order-main.order-locked:not(.order-cancelled) .card { background: #eceff1; }
.order-week.order-locked { opacity: .5; filter: grayscale(1); background: #eceff1; }
.order-week.order-locked.order-cancelled { filter: none; background: var(--bad-bg); border-color: #efb9b4; }
button.discard-order, .btn.claim-action { background: #d82435; border-color: #d82435; color: #fff; }
button.discard-order:hover, .btn.claim-action:hover { background: #b91c2c; border-color: #b91c2c; }
.order-edit-note { margin: -4px 0 16px; color: var(--muted); }
.order-edit-note .edit-error { color: #b91c2c; font-weight: 600; }
.intake-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.intake-photos figure { margin: 0; min-width: 0; }
.intake-photos img { width: 100%; height: 180px; object-fit: contain; border-radius: 8px; background: #f4f5f6; }
.intake-photos figcaption { font-size: .85rem; overflow-wrap: anywhere; margin-top: 6px; }

.items-edit-form.with-prices .items-head, .items-edit-form.with-prices .item-row .row { grid-template-columns: minmax(0,1fr) minmax(3em,12%) 3.5em 5.5em 24px; }
.price-strip{display:flex;align-items:center;justify-content:flex-end;gap:.4rem;margin:.3rem 0;font-size:12px}
.price-strip label{display:inline-flex;align-items:center;gap:.4rem;margin:0}
.price-strip .percent-small,.table input.row-price,.table input.row-qty{width:6em;min-width:0;padding:2px 5px;height:25px;text-align:right;font:inherit}
.price-strip .percent-small,.table input.row-qty{width:4.5em}

.pay-report {font-size:14px}
.pay-block {padding-block:12px}
.pay-report .pay-pick {display:flex;align-items:center;gap:6px;margin:0;font-size:inherit}
.pay-block header {display:flex;align-items:baseline;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;margin-bottom:12px}
.pay-table {table-layout:fixed;min-width:760px}
.pay-table .pay-order-col {width:13%}
.pay-table .pay-clinic-col {width:16%}
.pay-table .pay-dates-col {width:12%}
.pay-table .pay-qty {width:7%}
.pay-table .pay-rate,.pay-table .pay-amount {width:10%}
.pay-report .pay-table :is(th,td) {padding:8px;vertical-align:top;line-height:1.5;overflow-wrap:anywhere}
.pay-report .pay-table th {font-size:12px}
.pay-table label.pay-pick {align-items:flex-start;font-weight:400}
.pay-table label.pay-pick input {margin-top:3px}
.pay-report .pay-table .pay-number,.pay-report .pay-order-total th {text-align:right}
.pay-table .pay-order-info > div + div {margin-top:6px}
.pay-table small {display:block;color:var(--muted)}
.pay-table .pay-dates {white-space:nowrap}
.pay-order-total {font-weight:600}
.pay-report .pay-order-group {border-bottom:1px solid #aaa}
.pay-report .pay-order-total :is(th,td) {padding-bottom:12px}
@media(max-width:820px) {
  .pay-block header {justify-content:flex-start}
}
