:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #1f5fbf;
  --accent-soft: #e8f0fc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --ok: #18794e;
  --radius: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  background: #18202e; color: #fff; padding: 0 20px; height: 48px;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .3px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: #c9d1de; padding: 6px 12px; border-radius: 6px; }
.topbar nav a:hover { background: #26324a; text-decoration: none; }
.topbar nav a.active { background: #2f4066; color: #fff; }
.user { background: none; border: 1px solid #3a4763; color: #c9d1de; border-radius: 6px; padding: 5px 10px; cursor: pointer; }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1; min-width: 240px; }

input, select, textarea, button { font: inherit; }
input, select, textarea {
  border: 1px solid #cfd4dc; border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 60px; resize: vertical; }
input[type=checkbox] { width: auto; }

.btn {
  border: 1px solid #cfd4dc; background: #fff; color: var(--text);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f0f2f5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a51a3; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 3px 8px; font-size: 13px; }
.btn.link { border: none; background: none; color: var(--accent); padding: 2px 4px; }
.btn:disabled { opacity: .5; cursor: default; }

table.list { width: 100%; border-collapse: collapse; background: var(--panel); }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; background: #fafbfc; }
table.list tbody tr.clickable { cursor: pointer; }
table.list tbody tr.clickable:hover { background: var(--accent-soft); }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field.wide { grid-column: 1 / -1; }
.field.check label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin-top: 22px; }
.field .with-btn { display: flex; gap: 6px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { background: #eef0f3; color: var(--muted); border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef0f3; color: var(--muted); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.green { background: #e3f4ea; color: var(--ok); }

.notice { border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }

.rows .row { display: grid; gap: 8px; align-items: center; margin-bottom: 8px; }
.rows.contacts .row { grid-template-columns: 150px 1fr 1fr auto auto auto; }
.rows.persons .row { grid-template-columns: 1fr 1fr 1fr 1fr auto; }
.rows .row label.inline { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.dirty-dot { color: var(--warn); font-size: 13px; }

.two-col { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
.side-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; align-self: start; }
.side-list button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.side-list button:hover { background: #f0f2f5; }
.side-list button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-list .sep { border-top: 1px solid var(--line); margin: 6px 0; }

.audit-item { border-bottom: 1px solid var(--line); padding: 8px 0; }
.audit-item .when { color: var(--muted); font-size: 12px; }
.audit-item ul { margin: 4px 0 0; padding-left: 18px; }

.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; z-index: 50; }
.modal { background: #fff; border-radius: 10px; width: min(640px, 94vw); max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal header { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal header h2 { margin: 0; flex: 1; }
.modal .body { padding: 16px; overflow: auto; }
.modal footer { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.pick-list { margin-top: 10px; }
.pick-list button { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; }
.pick-list button:hover { border-color: var(--accent); background: var(--accent-soft); }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #18202e; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 420px; }
.toast.error { background: var(--danger); }

@media (max-width: 760px) {
  main { padding: 12px; }
  .topbar { gap: 10px; padding: 0 10px; overflow-x: auto; }
  .brand { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .rows.contacts .row, .rows.persons .row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .rows.contacts .row > input:nth-of-type(2) { grid-column: 1 / -1; }
  .rows .row .btn.danger { justify-self: end; }
  table.list { font-size: 13px; }
  table.list .hide-sm { display: none; }
}

/* Обязательные поля */
.req { color: var(--danger); font-weight: 700; }
.field.invalid input, .field.invalid textarea, .field.invalid .combo-input { border-color: var(--danger); background-color: var(--danger-soft); }
.field.invalid label { color: var(--danger); }
.panel.invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* Выпадающий список с поиском */
.combo { position: relative; flex: 1; min-width: 0; }
.combo-input { cursor: pointer; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.combo.open .combo-input { cursor: text; }
.combo-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 1000; background: #fff;
  border: 1px solid #cfd4dc; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.combo.open .combo-list { display: block; }
.combo-item { padding: 7px 10px; cursor: pointer; }
.combo-item:hover { background: #f0f2f5; }
.combo-item.active { background: var(--accent-soft); color: var(--accent); }
.combo-item.muted { color: var(--muted); }
.rows .row .combo { flex: none; }

/* Особые цены работы для марок и моделей */
.special-row { display: grid; grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr auto; gap: 8px; margin-bottom: 6px; align-items: center; }
.special-head { margin-bottom: 2px; }
@media (max-width: 760px) { .special-row { grid-template-columns: 1fr 1fr; } .special-head { display: none; } }

/* Переключатель языка */
.topbar select.lang { width: auto; background: #18202e; color: #c9d1de; border: 1px solid #3a4763; border-radius: 6px; padding: 4px 6px; }

/* Вход в систему */
.login-wrap { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(420px, 100%); box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.login-box h1 { margin-bottom: 12px; }
.login-box .field { margin-bottom: 12px; }
.login-brand { font-weight: 700; color: var(--muted); margin-bottom: 16px; letter-spacing: .3px; }
.btn.wide { width: 100%; padding: 10px; margin-top: 4px; }
.pin-people { display: flex; flex-wrap: wrap; gap: 6px; }
.pin-input { font-size: 22px; letter-spacing: 8px; text-align: center; }

/* Права ролей */
.perm-table td.center, .perm-table th.center { text-align: center; }

/* Только просмотр */
.view-only .page-head .btn:not(.link), .view-only .panel .btn, .view-only .toolbar .btn, .view-only table .btn,
.view-only .side-list button.muted, .view-only .rows .btn { display: none !important; }
.view-only .panel input, .view-only .panel textarea, .view-only .panel .combo, .view-only .rows input, .view-only .rows .combo {
  pointer-events: none; background-color: #f7f8fa; }
.view-only .page-head .btn.link { display: inline-block !important; }
.hidden { display: none !important; }
.modal .body .field { margin-bottom: 10px; }

/* ---------- 0.6: обращения ---------- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.page-head .actions { margin-top: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.panel-head .spacer, .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board-col { background: #eef0f3; border-radius: 8px; padding: 8px; min-height: 120px; }
.board-col.drop { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.board-col-head { font-weight: 600; font-size: 13px; padding: 2px 4px 8px; display: flex; justify-content: space-between; }
.board-col-head .count { background: #fff; border-radius: 10px; padding: 0 8px; color: var(--muted); font-weight: 400; }
.lead-card { display: block; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; color: inherit; text-decoration: none; cursor: grab; }
.lead-card:hover { border-color: var(--accent); }
.lead-card.free { border-left-color: var(--ok); }
.lead-card.mine { border-left-color: var(--accent); }
.lead-card > * + * { margin-top: 4px; }
.lead-card-top { display: flex; justify-content: space-between; gap: 6px; }
.lead-card-bottom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lead-req { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead-card .btn.small { margin-top: 6px; }
.lead-meta { margin: -8px 0 12px; font-size: 13px; }
.lead-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stepper { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.stepper .step { flex: 1; min-width: 110px; text-align: center; padding: 7px 8px; background: #eef0f3; color: var(--muted); border: 0; border-radius: 4px; font-size: 13px; font: inherit; font-size: 13px; }
.stepper button.step { cursor: pointer; }
.stepper button.step:hover { background: var(--accent-soft); color: var(--accent); }
.stepper .step.done { background: #dbe7fb; color: var(--accent); }
.stepper .step.current { background: var(--accent); color: #fff; font-weight: 600; }
.stepper .step.lost.current { background: var(--danger); }
.note-box textarea { width: 100%; min-height: 60px; }
.note-box .actions { justify-content: flex-end; margin: 6px 0 12px; }
.timeline { border-left: 2px solid var(--line); padding-left: 12px; }
.tl-item { padding: 6px 0; position: relative; font-size: 14px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tl-item .when { color: var(--muted); font-size: 12px; }
.tl-comment::before, .tl-call::before { background: var(--accent); }
.tl-client_approved::before, .tl-approved_manual::before { background: var(--ok); }
.tl-lost::before { background: var(--danger); }
/* просчёт */
.est-info { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin: -6px 0 14px; font-size: 14px; }
.est-info input.n { width: 100px; }
.est-lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.est-block.group { border: 1px dashed var(--accent); border-radius: 8px; padding: 8px; background: #f7faff; display: flex; flex-direction: column; gap: 8px; }
.est-block .group-title { font-size: 12px; color: var(--accent); font-weight: 600; }
.est-line { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #fff; }
.est-line.important { border-left: 3px solid var(--danger); }
.est-line.variant:not(.main) { opacity: .92; }
.est-line-head { display: flex; gap: 8px; align-items: center; }
.est-line-head input.name { flex: 1; font-weight: 600; }
.est-type { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; padding: 2px 6px; border-radius: 4px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.est-type.work { background: var(--accent-soft); color: var(--accent); }
.est-type.part { background: #f1ecfb; color: #6b3fbf; }
.variant-main { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.est-tools { display: flex; }
.est-nums { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 8px; }
.est-nums label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.est-nums input { width: 130px; }
.est-nums input.n { width: 90px; }
.est-nums input.unit { width: 60px; }
.est-nums .amt { margin-left: auto; font-weight: 600; padding-bottom: 6px; white-space: nowrap; }
.est-line .diag { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }
.est-line .diag textarea { width: 100%; min-height: 44px; margin-top: 2px; }
.est-flags { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 13px; }
.est-flags label.check { display: flex; gap: 6px; align-items: center; }
.est-flags input.imp-note { flex: 1; min-width: 220px; }
.est-line .ok { color: var(--ok); }
.est-sums { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.est-sums div { display: flex; gap: 16px; min-width: 300px; justify-content: space-between; }
.est-sums .grand { font-size: 16px; }
.est-sums .grand.ok { color: var(--ok); }
.appr-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.appr-row .nm { flex: 1; }
.appr-row .amt { white-space: nowrap; }
.appr-row.important .nm { color: var(--danger); }
.appr-group { padding: 6px 0 6px 10px; border-left: 2px solid var(--accent); margin: 6px 0; }
.appr-total { text-align: right; margin: 10px 0; font-size: 16px; }
@media (max-width: 960px) { .lead-cols { grid-template-columns: 1fr; } }

/* ---------- 0.7 ---------- */
.btn.save { background: #18794e; border-color: #18794e; color: #fff; }
.btn.save:hover { background: #12603d; }
/* меню «Ещё» */
nav .more { position: relative; display: inline-block; }
nav .more .more-btn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 6px 12px; border-radius: 6px; opacity: .85; }
nav .more.active .more-btn { background: rgba(255,255,255,.15); opacity: 1; }
nav .more .menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; z-index: 50; min-width: 190px; }
nav .more.open .menu { display: block; }
nav .more .menu a { display: block; color: var(--text) !important; padding: 7px 10px; border-radius: 6px; }
nav .more .menu a:hover, nav .more .menu a.active { background: var(--accent-soft); }
/* редактор строк */
.lines-block { margin-bottom: 18px; }
.lines-block .est-line + .est-line, .lines-block .est-block + .est-block, .lines-block .est-line + .est-block, .lines-block .est-block + .est-line { margin-top: 8px; }
.block-head { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.block-head h3 { margin: 0; font-size: 16px; }
.block-head b { margin-left: 6px; }
.est-nums label.brand { min-width: 210px; }
.est-nums label.brand .with-btn, .est-nums label.supplier .with-btn { display: flex; gap: 4px; }
.est-nums label.brand .combo, .est-nums label.supplier .combo, .est-nums label.for-work .combo { min-width: 170px; }
.est-nums label.supplier { min-width: 240px; }
.est-nums.purchase { background: #f7f8fa; border-radius: 6px; padding: 6px 8px; }
.est-nums .margin { padding-bottom: 6px; }
.markup { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 2px 6px; align-self: flex-end; margin-bottom: 6px; }
.client-part { padding: 2px 8px; border-radius: 12px; border: 1px solid var(--line); }
.client-part.on { background: var(--warn-soft); border-color: #e7c66b; color: var(--warn); }
.client-parts-note { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.client-parts-note input.n { width: 70px; }
label.inline { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.executors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.executors .ex-add { min-width: 170px; }
.executors .ex-add.wide { min-width: 240px; }
.executors input.n { width: 90px; }
.ex-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 2px 8px; font-size: 13px; }
.ex-chip input.share { width: 52px; padding: 1px 4px; font-size: 12px; }
.seg.small button { padding: 3px 9px; font-size: 13px; }
.seg.wrap { flex-wrap: wrap; }
.approval { margin-top: 8px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.approval.pending { color: var(--warn); }
.approval.declined { color: var(--danger); }
.est-line.appr-pending { border-color: #e7c66b; background: #fffdf5; }
.est-line.appr-declined { opacity: .6; }
.done-note { margin-top: 6px; color: var(--ok); }
/* запись */
.sched-day { text-transform: capitalize; }
.sched-wrap { overflow-x: auto; }
.sched { display: grid; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: min-content; }
.sched-colhead { height: 62px; border-bottom: 1px solid var(--line); padding: 6px 8px; overflow: hidden; }
.sched-colhead .mech { margin-top: 2px; color: var(--accent); }
.sched-col { border-left: 1px solid var(--line); min-width: 0; }
.sched-allday-cell { min-height: 34px; border-bottom: 2px solid var(--line); padding: 3px; font-size: 11px; color: var(--muted); cursor: pointer; }
.sched-time .sched-allday-cell { cursor: default; display: flex; align-items: center; justify-content: center; }
.sched-body { position: relative; }
.sched-body.off { background: repeating-linear-gradient(45deg, #f4f5f7, #f4f5f7 8px, #eceef1 8px, #eceef1 16px); }
.sched-body .slot { position: absolute; left: 0; right: 0; border-top: 1px dotted #eef0f3; cursor: pointer; }
.sched-body .slot.hour { border-top: 1px solid #e2e5ea; }
.sched-body .slot:hover { background: var(--accent-soft); }
.sched-body .closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #f4f5f7, #f4f5f7 8px, #eceef1 8px, #eceef1 16px); z-index: 1; pointer-events: none; }
.sched-time .tick { position: absolute; right: 6px; font-size: 11px; color: var(--muted); transform: translateY(-6px); }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 3; pointer-events: none; }
.appt { background: var(--accent-soft); border: 1px solid #b8cdf3; border-left: 3px solid var(--accent); border-radius: 5px; padding: 2px 5px; font-size: 12px; overflow: hidden; cursor: pointer; z-index: 2; line-height: 1.25; }
.sched-allday-cell .appt { margin-bottom: 3px; color: var(--text); }
.appt:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 4; }
.appt.st-arrived { background: #e3f4ea; border-color: #a9dcbf; border-left-color: var(--ok); }
.appt.st-no_show { background: #f4f4f5; border-color: #ddd; border-left-color: #999; opacity: .7; text-decoration: line-through; }
.appt-time { font-weight: 600; display: flex; justify-content: space-between; gap: 4px; }
.appt-order { color: #fff; background: var(--ok); border-radius: 8px; padding: 0 5px; font-size: 11px; }
.appt-who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-car, .appt-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table.shifts td.shift-cell { min-width: 120px; height: 56px; }
table.shifts td.shift-cell.clickable { cursor: pointer; }
table.shifts td.shift-cell.clickable:hover { background: var(--accent-soft); }
table.shifts td.shift-cell.off { background: repeating-linear-gradient(45deg, #f4f5f7, #f4f5f7 8px, #eceef1 8px, #eceef1 16px); }
table.shifts th.today { color: var(--accent); }
table.shifts .ex-chip { margin: 1px 2px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
/* наряд */
.status-steps { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.status-steps .step { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; color: var(--muted); }
.status-steps .step:hover { border-color: var(--accent); color: var(--accent); }
.status-steps .step.current { color: #fff; font-weight: 600; }
.badge.status { color: #fff; }
.order-info .links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.print-menu { position: relative; }
.print-menu .menu { display: none; position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; z-index: 30; min-width: 220px; }
.print-menu.open .menu { display: block; }
.print-menu .menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.print-menu .menu button:hover { background: var(--accent-soft); }
.est-sums .debt { color: var(--danger); }
table.list.compact td { padding: 5px 8px; }
table.list tr.cancelled td { color: var(--muted); text-decoration: line-through; }
table.list tr.selected td { background: var(--accent-soft); }
td.num.in { color: var(--ok); }
td.num.out { color: var(--danger); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; }
.rec { padding: 4px 0; border-bottom: 1px solid var(--line); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
/* фото */
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photo { position: relative; width: 110px; height: 90px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f4f5f7; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .pdf { display: flex; align-items: center; justify-content: center; height: 100%; }
.photo .del { position: absolute; top: 3px; right: 3px; border: 0; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.photo.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 26px; border-style: dashed; }
.photo.add span { font-size: 12px; color: var(--muted); }
/* касса */
.cash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cash-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.cash-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cash-card .bal { font-size: 18px; font-weight: 700; margin-top: 4px; }
.cash-sum { margin: 6px 0 10px; color: var(--muted); }
/* мои работы (механик, телефон) */
.task-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.task-head .big { font-size: 18px; }
.task-line { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.task-line.mine { border-left: 3px solid var(--accent); }
.task-line.done { background: #f2faf5; }
.task-line.done label span { text-decoration: line-through; color: var(--muted); }
label.check.big { display: flex; gap: 10px; align-items: center; font-size: 16px; font-weight: 600; }
label.check.big input { width: 22px; height: 22px; }
.task .note-box textarea { min-height: 70px; }
table.hours select { padding: 4px; }
table.hours input[type=time] { width: 110px; }
@media (max-width: 760px) {
  nav .more .menu { right: 0; left: auto; }
  .est-nums label.brand, .est-nums label.supplier { min-width: 100%; }
}
.topbar nav { flex-wrap: wrap; }
.topbar nav .more .more-btn { color: #c9d1de; }
.topbar nav .more .menu a { color: var(--text); background: none; }
.topbar nav .more .menu a:hover, .topbar nav .more .menu a.active { background: var(--accent-soft); color: var(--accent) !important; }
.page-head input.date-in, .toolbar input[type=date] { width: auto; flex: none; }

/* ---------- 0.8 ---------- */
/* компактные строки наряда / просчёта */
.lines-block { margin-bottom: 16px; }
.lines-block .bh { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
.lines-block .bh h3 { margin: 0; font-size: 15px; }
.lines-block .bh .spacer { flex: 1; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.pstate { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.pstate.ok { background: #e3f4ea; color: var(--ok); }
.pstate.warn { background: var(--warn-soft); color: var(--warn); }
.pstate.blue { background: var(--accent-soft); color: var(--accent); }
table.ln { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ln th { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); text-align: left; padding: 4px 6px; border-bottom: 2px solid var(--line); font-weight: 600; }
table.ln th.n, table.ln td.n { text-align: right; }
table.ln td { padding: 3px 6px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
table.ln td.c { text-align: center; }
table.ln td.sum { font-weight: 600; white-space: nowrap; }
table.ln tr.row { cursor: pointer; }
table.ln tr.row:hover td { background: #f7faff; }
table.ln tr.open td { background: #f2f6fd; }
table.ln tr.det td { background: #f7faff; border-bottom: 2px solid #b8cdf3; padding: 8px 10px 10px; cursor: default; }
table.ln tr.appr-pending td { background: #fffbea; }
table.ln tr.appr-declined td { opacity: .55; }
table.ln tr.done .cell-name { color: var(--muted); }
table.ln tr.variant td:first-child { border-left: 3px solid var(--accent-soft); }
table.ln tr.variant.main td:first-child { border-left-color: var(--accent); }
table.ln tr.unselected td { opacity: .5; }
table.ln tfoot td { border: 0; padding-top: 6px; }
table.ln input.cell-n { width: 72px; text-align: right; padding: 2px 5px; font-size: 13px; border: 1px solid transparent; background: transparent; }
table.ln input.cell-name { width: 100%; min-width: 180px; font-weight: 600; padding: 2px 5px; font-size: 13px; border: 1px solid transparent; background: transparent; }
table.ln tr.row:hover input:not(:disabled), table.ln tr.open input:not(:disabled), table.ln input:focus { border-color: var(--line); background: #fff; }
table.ln input:disabled { color: inherit; }
table.ln .nm-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
table.ln .nm-line input.cell-name { flex: 1; }
table.ln .dg { font-size: 12px; color: var(--muted); padding-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
table.ln .ic { font-size: 13px; }
table.ln .exec { min-width: 120px; }
table.ln .markup { font-size: 11px; color: var(--warn); }
table.ln td.toggle { color: var(--muted); }
table.ln .for-work { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 0 7px; font-size: 12px; margin: 1px 3px 1px 0; white-space: nowrap; }
.chip.ctr { background: #f1ecfb; color: #6b3fbf; }
.detg { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 14px; }
.detg .lbl { display: block; font-size: 11px; color: var(--muted); margin: 4px 0 2px; }
.detg textarea { width: 100%; min-height: 54px; font-size: 13px; }
.detg .flags { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 13px; }
.detg .flags.col { flex-direction: column; align-items: flex-start; gap: 4px; }
.detg .flags label.check { display: flex; gap: 5px; align-items: center; }
.detg .imp-note { flex: 1; min-width: 200px; }
.detg .mini2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.detg .mini2 input.cell-n, .detg input.full { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; padding: 4px 6px; }
.detg .row-tools { display: flex; gap: 4px; margin-top: 10px; justify-content: flex-end; }
.detg .actions { margin-top: 6px; }
.btn.link.ok { color: var(--ok); font-weight: 700; }
.nowrap { white-space: nowrap; }
.stock-pick .stock-prod { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
/* наряд: верхний блок */
.order-top { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 14px; padding: 12px 14px; }
.order-top .k { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); margin-top: 4px; }
.order-top .v { font-size: 14px; margin-bottom: 2px; }
.order-top textarea { width: 100%; min-height: 44px; font-size: 13px; }
.order-top .mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.order-top .mini .field { margin: 0; }
.order-top .links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.order-top .wide { grid-column: 1 / -1; margin: 0; }
details.accept-panel > summary { cursor: pointer; padding: 2px 0; list-style: none; }
details.accept-panel > summary::-webkit-details-marker { display: none; }
details.accept-panel > summary::before { content: "▸ "; color: var(--muted); }
details.accept-panel[open] > summary::before { content: "▾ "; }
/* доска обращений */
.board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(165px, 1fr); }
.board-col.closed-col { background: #f4f5f7; border: 1px dashed var(--line); }
.board-col.closed-col.won .board-col-head { color: var(--ok); }
.board-col.closed-col.lost .board-col-head { color: var(--danger); }
.closed-tools { margin-top: -4px; }
.btn.active-toggle { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
/* запись: календарь месяца */
.sched-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 14px; align-items: start; }
.sched-side { position: sticky; top: 8px; }
.mcal { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.mcal-head { display: flex; justify-content: space-between; align-items: center; text-transform: capitalize; font-size: 14px; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 6px; }
.mcal-grid .wd { font-size: 10px; color: var(--muted); text-align: center; }
.md { border: 0; background: #f4f5f7; border-radius: 6px; height: 28px; font: inherit; font-size: 12px; cursor: pointer; color: var(--text); }
.md:hover { outline: 1px solid var(--accent); }
.md.l1 { background: #e3f4ea; } .md.l2 { background: #fff1c2; } .md.l3 { background: #ffd9a8; } .md.l4 { background: #f8c4bd; }
.md.off { background: repeating-linear-gradient(45deg, #f4f5f7, #f4f5f7 4px, #e6e8eb 4px, #e6e8eb 8px); color: var(--muted); }
.md.today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.md.sel { background: var(--accent) !important; color: #fff; }
.mcal-legend { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 10px; color: var(--muted); margin-top: 8px; }
.mcal-legend .md { display: inline-block; width: 12px; height: 12px; border-radius: 3px; cursor: default; }
.queue-no { background: var(--accent); color: #fff; border-radius: 8px; padding: 0 6px; font-weight: 700; margin-right: 4px; }
.appt { position: relative; }
.appt .resize { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
.appt .resize:hover { background: rgba(31, 95, 191, .25); }
/* склад */
td.num.low strong { color: var(--danger); }
.danger-text { color: var(--danger); }
table.list tr.overdue td { background: var(--danger-soft); }
table.receipt-lines input { padding: 3px 6px; font-size: 13px; }
table.receipt-lines input.w-art { width: 120px; } table.receipt-lines input.w-name { width: 220px; } table.receipt-lines input.w-bin { width: 70px; }
table.receipt-lines input.n { width: 80px; text-align: right; }
table.receipt-lines .combo { min-width: 130px; }
td.picked { background: var(--accent-soft); }
@media (max-width: 960px) {
  .detg, .order-top { grid-template-columns: 1fr; }
  .sched-layout { grid-template-columns: 1fr; }
  .sched-side { position: static; }
}
.detg .with-btn { display: flex; gap: 4px; } .detg .with-btn .combo { flex: 1; }
.period-picker { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.period-picker input[type=date] { width: 150px; }
tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.payroll-detail tr.grp td { background: #f6f7f9; border-top: 2px solid var(--line); }
.warn-row { margin-top: 4px; }
.mcal .md.drop { outline: 2px solid var(--accent); background: var(--accent-soft); }
.mcal-hint { margin-top: 6px; }
.slot.free { background: rgba(34, 160, 90, .16); cursor: pointer; }
.slot.free:hover { background: rgba(34, 160, 90, .32); }
.slot.busy { background: rgba(15, 20, 30, .06); }
.sched-body .appt { pointer-events: auto; }
table.sale-lines input.n, table.list td input.n { width: 90px; }
table.sale-lines input.w-name { width: 100%; min-width: 220px; }
.appt .resize.top { top: 0; bottom: auto; }
.lead-car { font-size: 17px; font-weight: 600; margin: -4px 0 6px; }
.lead-car a { text-decoration: none; }
table.repairs tr.first td { border-top: 2px solid var(--line); }
.ok-text { color: var(--ok); } .warn-text { color: #b26a00; }
tr.row-maybe td { background: #fff8e6; }
.receipt-summary { margin: 6px 0; }
.receipt-summary .combo { display: inline-block; }
table.repairs tr.returned td:nth-child(n+4) { color: var(--muted); text-decoration: line-through; }
table.repairs tr.returned td .pstate { text-decoration: none; display: inline-block; }

/* =====================================================================
   1.0 — оформление в стиле Apple: светлый фон, белые карточки, мягкие тени,
   скруглённые кнопки и поля, «пилюли» переключателей. Адаптивность: телефон / планшет / компьютер.
   ===================================================================== */
:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --line-soft: #f0f0f3;
  --fill: #e8e8ed;
  --fill-hover: #dcdce1;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: #e8f1fc;
  --danger: #d70015;
  --danger-soft: #fdeceb;
  --warn: #a35200;
  --warn-soft: #fff3e0;
  --ok: #1f7a34;
  --ok-fill: #2c9a46;
  --ok-soft: #e6f5ea;
  --radius: 12px;
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .07), 0 1px 3px rgba(0, 0, 0, .05);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .08), 0 12px 40px rgba(0, 0, 0, .14);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: -.005em;
}
body { background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: var(--text); }
a:hover { text-decoration: none; opacity: .85; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-weight: 600; letter-spacing: -.01em; }
main { max-width: 1440px; padding: 24px 28px 48px; }

/* ---------- верхнее меню ---------- */
.topbar {
  height: 52px; gap: 10px; padding: 0 20px; color: var(--text);
  background: rgba(255, 255, 255, .78); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid rgba(0, 0, 0, .12); z-index: 40;
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; cursor: pointer; white-space: nowrap; margin-right: 10px; }
.topbar .brand .logo { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(180deg, #2b8cff, #0063d1); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15); }
.burger { display: none; border: 0; background: none; color: var(--text); padding: 6px; margin-left: -6px; border-radius: 8px; cursor: pointer; }
.burger:hover { background: rgba(0,0,0,.05); }
.section-title { display: none; }
.topbar nav { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: nowrap; min-width: 0; }
.topbar nav .nav-head, .topbar nav .nav-foot, .topbar nav .grp-label { display: none; }
.nav-group { display: flex; align-items: center; gap: 2px; position: relative; }
.topbar nav a, .grp-btn {
  color: var(--text); opacity: .82; padding: 6px 11px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap;
  border: 0; background: none; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.topbar nav a:hover, .grp-btn:hover { background: rgba(0, 0, 0, .05); opacity: 1; text-decoration: none; }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); opacity: 1; font-weight: 600; }
.nav-group.drop.active > .grp-btn { color: var(--accent); opacity: 1; font-weight: 600; background: var(--accent-soft); }
.grp-btn::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; margin-left: 2px; }
.nav-group.sys .grp-btn .grp-text { display: none; }
.nav-group.sys { margin-left: auto; }
.nav-group.drop > .menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; padding: 6px; z-index: 60;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 12px; box-shadow: var(--shadow-pop);
}
.nav-group.drop > .menu.right { left: auto; right: 0; }
.nav-group.drop.open > .menu { display: block; }
.nav-group.drop > .menu a { display: flex; width: 100%; opacity: 1; padding: 8px 12px; font-weight: 400; }
.nav-group.drop > .menu a:hover { background: var(--accent); color: #fff; }
.nav-group.drop > .menu a.active { background: var(--accent-soft); color: var(--accent); }
.nav-group.single > .grp-btn { display: none; }
.nav-group.single > .menu { display: contents !important; }
.nav-group.single > .menu a { width: auto; font-weight: 500; opacity: .82; padding: 6px 11px; }
.nav-group.single > .menu a.active { opacity: 1; font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.topbar select.lang { width: auto; background: rgba(0,0,0,.04); color: var(--text); border: 0; border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.user { border: 0; background: rgba(0,0,0,.04); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.user:hover { background: rgba(0,0,0,.08); }
.nav-scrim { display: none; }

/* ---------- кнопки ---------- */
.btn { border: 0; background: var(--fill); color: var(--text); border-radius: 8px; padding: 7px 14px; font-weight: 500; line-height: 1.25; transition: background .12s, box-shadow .12s; }
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.save { background: var(--ok-fill); color: #fff; }
.btn.save:hover { background: #26873d; }
.btn.danger { color: var(--danger); background: var(--fill); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.link { background: none; color: var(--accent); padding: 4px 6px; }
.btn.link:hover { background: rgba(0, 113, 227, .08); }
.btn.link.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn.active-toggle { background: var(--accent-soft); color: var(--accent); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 113, 227, .35); }

/* ---------- поля ---------- */
input, select, textarea { border: 1px solid #d2d2d7; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--text); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .2); }
input:disabled, textarea:disabled, select:disabled { background: #f5f5f7; color: #48484a; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 5px; }
.combo-list { border: 0; border-radius: 10px; box-shadow: var(--shadow-pop); padding: 4px; }
.combo-item { padding: 7px 10px; border-radius: 6px; }
.combo-item:hover { background: var(--line-soft); }
.combo-item.active { background: var(--accent); color: #fff; }

/* ---------- карточки, панели ---------- */
.panel { border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.page-head { margin-bottom: 18px; gap: 10px; }
.page-head h1 { margin-right: 4px; }
.notice { border-radius: 12px; padding: 12px 14px; }
.notice.info { color: #0058b0; }
.badge { border-radius: 999px; padding: 2px 9px; font-weight: 500; background: var(--fill); color: #48484a; }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.tag, .pstate { border-radius: 999px; padding: 1px 8px; background: var(--fill); }
.pstate.ok { background: var(--ok-soft); }
.chip, .ex-chip { border-radius: 999px; }

/* ---------- таблицы ---------- */
table.list { border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.panel table.list, .modal table.list, .lead-cols table.list { box-shadow: none; border-radius: 0; }
table.list th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); background: #fbfbfd; border-bottom: 1px solid var(--line); padding: 9px 12px; }
table.list td { border-bottom: 1px solid var(--line-soft); padding: 10px 12px; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr.clickable:hover { background: #f5f5f7; }
table.list tr.selected td { background: var(--accent-soft); }
table.list.compact td { padding: 7px 10px; }
table.ln th { text-transform: none; letter-spacing: 0; font-size: 12px; border-bottom: 1px solid var(--line); }
table.ln td { border-bottom: 1px solid var(--line-soft); }
table.ln tr.row:hover td { background: #f7f7f9; }
table.ln tr.open td, table.ln tr.det td { background: #f5f8fd; }
table.ln tr.det td { border-bottom: 1px solid var(--line); }

/* ---------- вкладки и переключатели («пилюли») ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--fill); border-radius: 10px; border: 0; margin-bottom: 18px; max-width: 100%; }
.tabs button { border: 0; border-radius: 8px; padding: 6px 14px; margin: 0; color: #3a3a3c; font-weight: 500; font-size: 13px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); border: 0; }
.tabs .count { background: rgba(0,0,0,.06); }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--fill); border: 0; border-radius: 9px; overflow: visible; }
.seg button { border: 0 !important; background: none; border-radius: 7px; padding: 5px 12px; color: #3a3a3c; font-weight: 500; font-size: 13px; }
.seg button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.seg.small button { padding: 3px 10px; font-size: 12.5px; }
.stepper .step { background: var(--fill); border-radius: 9px; color: #48484a; font-weight: 500; }
.stepper .step.done { background: #d6e6fb; color: #0058b0; }
.stepper .step.current { background: var(--accent); }
.status-steps .step { border: 0; background: var(--fill); border-radius: 999px; padding: 6px 13px; color: #3a3a3c; font-weight: 500; }
.status-steps .step:hover { background: var(--fill-hover); color: var(--text); }
.side-list { border: 0; box-shadow: var(--shadow); border-radius: 14px; }
.side-list button { border-radius: 8px; }
.side-list button.active { background: var(--accent); color: #fff; }

/* ---------- окна, подсказки ---------- */
.modal-back { background: rgba(0, 0, 0, .28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding-top: 8vh; }
.modal { border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0,0,0,.1); max-height: 84vh; }
.modal header { border-bottom: 0; padding: 18px 20px 8px; }
.modal header h2 { font-size: 18px; }
.modal header .btn.link { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); color: #48484a; padding: 0; }
.modal .body { padding: 8px 20px 18px; }
.modal footer { border-top: .5px solid var(--line); padding: 12px 20px; background: #fbfbfd; border-radius: 0 0 16px 16px; }
.pick-list button { border: 0; background: #f5f5f7; border-radius: 10px; padding: 10px 12px; }
.pick-list button:hover { background: var(--accent-soft); }
#toasts { right: 50%; transform: translateX(50%); bottom: 24px; align-items: center; }
.toast { background: rgba(29, 29, 31, .92); backdrop-filter: blur(10px); border-radius: 12px; padding: 10px 16px; font-weight: 500; }
.toast.error { background: rgba(215, 0, 21, .95); }
.print-menu .menu { border: 0; border-radius: 12px; box-shadow: var(--shadow-pop); }
.print-menu .menu button:hover { background: var(--accent); color: #fff; }

/* ---------- экраны ---------- */
.cash-card { border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; }
.cash-card.active { box-shadow: 0 0 0 2px var(--accent); }
.cash-card .bal { font-size: 20px; letter-spacing: -.02em; }
.board-col { background: #ebebef; border-radius: 14px; padding: 10px; }
.board-col-head { font-size: 13px; align-items: flex-start; gap: 6px; }
.board-col-head .count { align-self: flex-start; flex: none; }
.lead-card { border: 0; border-left: 3px solid transparent; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; }
.lead-card:hover { box-shadow: 0 0 0 .5px rgba(0,0,0,.1), 0 4px 14px rgba(0,0,0,.08); }
.lead-card.free { border-left-color: var(--ok-fill); }
.lead-card.mine { border-left-color: var(--accent); }
.timeline { border-left: 2px solid var(--line); }
.sched { border: 0; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.appt { border-radius: 7px; border: 0; border-left: 3px solid var(--accent); background: #e3eefc; }
.appt.st-arrived { background: var(--ok-soft); border-left-color: var(--ok-fill); }
.mcal { border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 10px; }
.md { border-radius: 8px; background: #f2f2f5; }
.photo { border-radius: 10px; border: 0; box-shadow: var(--shadow); }
.est-line, .task-line { border-color: var(--line); border-radius: 10px; }
.login-box { border: 0; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.08), 0 0 0 .5px rgba(0,0,0,.06); padding: 32px; }
.login-box .btn.wide { padding: 11px; font-size: 15px; }
.order-top .k { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.lead-car { font-size: 18px; letter-spacing: -.01em; }
.est-sums { border-top: 1px solid var(--line); }
.est-sums .grand { font-size: 17px; font-weight: 600; }
.view-only .panel input, .view-only .panel textarea { background-color: #f5f5f7; }

/* ---------- планшет ---------- */
@media (max-width: 1360px) {
  .topbar { padding: 0 14px; }
  .topbar nav a, .grp-btn { padding: 6px 8px; font-size: 13.5px; }
  .topbar .brand .brand-name { display: none; }
  main { padding: 20px 18px 40px; }
}

/* ---------- телефон: боковое меню по ☰ ---------- */
@media (max-width: 900px) {
  /* размытие фона у шапки делает её «рамкой» для выезжающего меню — на телефоне шапка без размытия */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(250, 250, 252, .98); }
  .burger { display: inline-flex; }
  .topbar .brand { margin-right: 0; }
  .topbar .brand .brand-name { display: none; }
  .section-title { display: block; flex: 1; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
  .topbar nav {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); z-index: 80; flex-direction: column; align-items: stretch; gap: 0;
    background: #f5f5f7; padding: calc(env(safe-area-inset-top) + 10px) 10px 20px; overflow-y: auto;
    transform: translateX(-102%); transition: transform .22s ease, box-shadow .22s;
  }
  body.nav-open .topbar nav { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .topbar { z-index: 90; }
  .nav-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 70; }
  body.nav-open .nav-scrim { display: block; }
  .topbar nav .nav-head { display: block; font-weight: 700; font-size: 20px; padding: 6px 10px 10px; }
  .topbar nav .grp-label { display: block; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 12px 4px; text-transform: uppercase; letter-spacing: .04em; }
  .nav-group, .nav-group.sys { flex-direction: column; align-items: stretch; margin: 0; gap: 0; }
  .nav-group.drop > .grp-btn { display: none; }
  .nav-group.drop > .menu, .nav-group.single > .menu { display: block !important; position: static; left: auto; right: auto; width: 100%; box-shadow: none; background: none; padding: 0; min-width: 0; backdrop-filter: none; }
  .topbar nav a, .nav-group.drop > .menu a, .nav-group.single > .menu a { display: flex; width: 100%; padding: 10px 12px; font-size: 15px; font-weight: 400; opacity: 1; border-radius: 10px; }
  .nav-group.drop > .menu a:hover { background: rgba(0,0,0,.05); color: var(--text); }
  .topbar nav a.active, .nav-group.drop > .menu a.active { background: #fff; color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
  .top-right .lang { display: none; }
  .user { padding: 6px 8px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  main { padding: 14px 14px 40px; }
  h1 { font-size: 22px; }
  .panel { padding: 14px; border-radius: 12px; }
  .page-head { gap: 8px; }
  .page-head .spacer { flex-basis: 100%; height: 0; }
  .toolbar input[type=search] { min-width: 0; flex-basis: 100%; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs button { flex: none; }
  .seg { max-width: 100%; overflow-x: auto; }
  .est-sums div { min-width: 0; width: 100%; }
  .lead-cols { grid-template-columns: 1fr; }
  .lines-block, .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal-back { align-items: flex-end; padding-top: 0; }
  .modal { width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal footer { border-radius: 0; flex-wrap: wrap; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal footer .btn { flex: 1; }
  #toasts { bottom: calc(16px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }
  .toast { max-width: 100%; }
}
@media (max-width: 760px) {
  table.list { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  table.list th, table.list td { white-space: nowrap; }
  table.list td .clamp, table.list td.wrap { white-space: normal; }
  .cash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-auto-columns: minmax(230px, 80vw); scroll-snap-type: x mandatory; }
  .board-col { scroll-snap-align: start; }
  .grid { grid-template-columns: 1fr; }
  .order-top .mini { grid-template-columns: 1fr; }
  .period-picker { width: 100%; }
}

/* стадии обращения — одна дорожка-сегмент */
.stepper { background: var(--fill); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper .step { background: transparent; border-radius: 9px; padding: 6px 10px; min-width: 96px; line-height: 1.25; display: block; text-align: center; align-self: stretch; }
.stepper { align-items: stretch; }
.stepper .step.done { background: transparent; color: var(--accent); }
.stepper .step.done::before { content: "✓\00a0"; }
.stepper .step.current { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.stepper button.step:hover { background: rgba(255,255,255,.7); }
.phone-pick { display: flex; flex-direction: column; gap: 8px; }
.phone-pick .btn { justify-content: flex-start; font-size: 16px; padding: 10px 14px; }
@media (max-width: 760px) {
  .stepper .step { white-space: nowrap; min-width: auto; flex: 0 0 auto; }
  .seg, .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .seg::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .seg > *, .tabs > * { white-space: nowrap; flex: 0 0 auto; }
}
/* подзаголовки в меню ⚙ (Сервис / Система) */
@media (min-width: 901px) {
  .topbar nav .menu .grp-label.sub { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px 3px; text-align: left; }
  .topbar nav .menu .grp-label.sub ~ .grp-label.sub { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
}
/* приём автомобиля: пожелания клиента крупнее */
.accept-panel .accept-complaint { font-size: 16px; color: var(--text); }
.accept-panel [data-key="complaint"] textarea { font-size: 17px; line-height: 1.4; min-height: 84px; }

/* ---------- статистика ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: 14px; box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08)); padding: 14px 16px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .panel { margin-bottom: 16px; min-width: 0; }
.chart-wrap { position: relative; }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .bar { fill: var(--accent); }
.bar-chart .grid { stroke: var(--line); stroke-width: 1; }
.bar-chart .base { stroke: #c7c7cc; stroke-width: 1; }
.bar-chart .axis { fill: var(--muted); font-size: 12px; font-family: inherit; }
.bar-chart .hit { fill: transparent; }
.bar-chart .hit:hover { fill: rgba(0, 113, 227, .06); }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: #fff; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.14); padding: 6px 10px; pointer-events: none; white-space: nowrap; font-size: 13px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--fill); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 5px; }
.hbar-val { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
td.num.out { color: var(--danger); }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .kpi-value { font-size: 22px; } }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; gap: 8px; } .kpi { padding: 10px 12px; } .hbar { grid-template-columns: 90px 1fr auto; } }

/* ---------- переписка Telegram ---------- */
.tg-head { font-size: 13px; color: var(--muted); margin: -4px 0 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg-in, .msg-out { display: inline-block; max-width: 92%; border-radius: 14px; padding: 7px 11px; margin-top: 2px; }
.msg-in { background: var(--fill); border-top-left-radius: 4px; }
.msg-out { background: #dcebfd; border-top-left-radius: 4px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-photo { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; margin-bottom: 4px; }
.tl-message_in::before { background: var(--accent) !important; }
.lead-card .unread { color: #fff; background: var(--accent); border-radius: 999px; font-size: 11px; padding: 1px 8px; font-weight: 600; }
.lead-card.has-unread { box-shadow: 0 0 0 2px var(--accent), var(--shadow, 0 1px 3px rgba(0,0,0,.08)); }
.nav-badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; text-align: center; vertical-align: 1px; }
#burger { position: relative; }
.burger-dot { position: absolute; top: -2px; right: -4px; margin: 0; }
.dup-note { display: flex; flex-direction: column; gap: 6px; }
.dup-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dup-row .btn { margin-left: auto; }

/* ---------- звонки ---------- */
.call-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; vertical-align: middle; }
.call-ico.call-in { color: #1f8a3a; background: #e3f4e8; }
.call-ico.call-out { color: #0071e3; background: #e3eefc; }
.call-ico.call-noanswer { color: #6e6e73; background: var(--fill); }
.call-ico.call-missed { color: #d70015; background: #fde7e9; }
.call-ico.call-ringing { color: #c46a00; background: #fff1dc; animation: ring 1s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.seg button .call-ico { width: 20px; height: 20px; margin-right: 4px; background: transparent; }
.calls-table td { vertical-align: middle; }
.calls-table .call-kind { width: 44px; }
.call-row { cursor: pointer; }
.call-row.missed-open { background: #fff6f6; }
.ok-text { color: var(--ok); } .danger-text { color: var(--danger); font-weight: 600; }
.nowrap { white-space: nowrap; }
.chip { border: 0; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.danger { background: #fde7e9; color: #d70015; }
.rec-box audio { height: 32px; max-width: 260px; vertical-align: middle; }
.tl-call { display: flex; gap: 10px; align-items: flex-start; }
.tl-call .call-ico { width: 26px; height: 26px; }
.tl-msg { display: flex; gap: 8px; align-items: flex-start; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }

/* ---------- каналы ---------- */
.ch-ico { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; letter-spacing: -.02em; flex: 0 0 auto; line-height: 1; }

/* ---------- чаты ---------- */
.chats { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 150px); min-height: 420px; background: #fff; border-radius: 14px; box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08)); overflow: hidden; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-tools { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.chat-list { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; cursor: pointer; font: inherit; border-bottom: 1px solid #f0f0f2; position: relative; }
.chat-item:hover { background: #f7f7f9; }
.chat-item.active { background: #e8f1fd; }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-item-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-last { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .chat-item-last { color: var(--text); font-weight: 500; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.chat-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-empty { margin: auto; }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-head-body { min-width: 0; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: #f5f5f7; }
.chat-day { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border-radius: 999px; padding: 2px 10px; margin: 6px 0; }
.bubble { max-width: 75%; padding: 7px 11px 5px; border-radius: 16px; font-size: 15px; }
.bubble.in { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: #0a84ff; color: #fff; border-bottom-right-radius: 5px; }
.bubble-meta { font-size: 11px; opacity: .65; text-align: right; margin-top: 2px; }
.chat-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-compose textarea { flex: 1; min-height: 44px; resize: none; }
.pad { padding: 12px; }
@media (max-width: 760px) {
  .chats { grid-template-columns: 1fr; height: calc(100vh - 120px); border-radius: 0; margin: 0 -16px; }
  .chats .chat-conv { display: none; }
  .chats.show-conv .chat-side { display: none; }
  .chats.show-conv .chat-conv { display: flex; }
  .chat-back { display: inline-flex; }
  .bubble { max-width: 88%; }
}

/* ---------- RFM ---------- */
.rfm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rfm-card { text-align: left; background: #fff; border: 0; border-radius: 14px; box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08)); padding: 12px 14px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.rfm-card.active { box-shadow: 0 0 0 2px var(--accent); }
.rfm-card.empty { opacity: .55; }
.rfm-card-top { display: flex; align-items: center; gap: 8px; }
.rfm-dot { width: 10px; height: 10px; border-radius: 50%; }
.rfm-n { margin-left: auto; font-size: 22px; font-weight: 700; }
.rfm-hint { color: #48484a; }
.rfm-code { white-space: nowrap; }
.rfm-s { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 5px; font-size: 12px; font-weight: 700; margin-right: 2px; color: #fff; }
.rfm-s.s1 { background: #c7c7cc; color: #3a3a3c; } .rfm-s.s2 { background: #a1c4f5; } .rfm-s.s3 { background: #5e9ff0; } .rfm-s.s4 { background: #2a7de1; } .rfm-s.s5 { background: #0058b0; }

[hidden] { display: none !important; }
.site-lead { display: flex; flex-direction: column; gap: 4px; }
.site-lead .badge { margin-left: 6px; }
.site-dialog { background: var(--fill); border-radius: 12px; padding: 6px 10px; margin-top: 2px; }
.site-dialog > div { display: flex; gap: 6px; padding: 2px 0; font-size: 14px; }
.site-dialog .sd-client { font-weight: 500; }
.site-dialog .sd-bot { color: #48484a; }
.sd-who { flex: 0 0 auto; }
@media (max-width: 1180px) and (min-width: 901px) {
  .topbar nav a, .grp-btn { padding: 6px 6px; font-size: 13px; }
  .topbar nav .nav-badge { margin-left: 3px; }
}
@media (max-width: 1180px) and (min-width: 901px) { #topRight select.lang { display: none; } }
@media (max-width: 1060px) and (min-width: 901px) { #userBtn .user-name { display: none; } .topbar nav a, .grp-btn { padding: 6px 5px; font-size: 12.5px; } }

/* ---------- финансовый результат ---------- */
.neg { color: var(--danger); }
.kpi-good .kpi-value { color: #1f8a3a; } .kpi-bad .kpi-value { color: var(--danger); }
table.pl td:last-child { text-align: right; white-space: nowrap; }
table.pl tr.sub td { padding-top: 2px; padding-bottom: 2px; font-size: 13px; }
.pl-sub { padding-left: 16px; display: inline-block; }
table.pl tr.total td { border-top: 2px solid var(--line); padding-top: 10px; font-size: 15px; }
.pl-net { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
.pl-net strong { font-size: 28px; letter-spacing: -.02em; }
.pl-net.good strong { color: #1f8a3a; } .pl-net.bad strong { color: var(--danger); }
