/* Нордиам · Кабинет механика — мобильные стили (светлая/тёмная тема). */

:root {
  --accent: #2563eb;
  --accent-press: #1d4ed8;
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #dfe6f0;
  --border-soft: #edf1f7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .03);

  --st-done-fg: #0f7a4a;  --st-done-bg: #e4f7ee;
  --st-work-fg: #1d4ed8;  --st-work-bg: #e7eeff;
  --st-warn-fg: #b45309;  --st-warn-bg: #fdf0da;
  --st-pay-fg: #a16207;   --st-pay-bg: #fbf1cf;
  --st-part-fg: #6d28d9;  --st-part-bg: #f0e9fe;
  --st-bad-fg: #b91c1c;   --st-bad-bg: #fde8e8;
  --st-plain-fg: #475569; --st-plain-bg: #edf1f7;
  --st-none-fg: #64748b;  --st-none-bg: #f1f5f9;

  --warn-bg: #fff4e3; --warn-fg: #8a4b0f;
  --danger: #dc2626;
  --ok: #0f7a4a;
  --toast-bg: #111827;
  --sheet-bg: #ffffff;
  --scrim: rgba(15, 23, 42, .45);
  --radius: 16px;
}

:root[data-theme="dark"] {
  --accent: #5b8cff;
  --accent-press: #4a7bf0;
  --bg: #0a1020;
  --surface: #131d31;
  --surface-2: #1b273e;
  --text: #e8eef9;
  --text-2: #c7d2e5;
  --muted: #93a3bd;
  --border: #24334f;
  --border-soft: #1d2940;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .35);

  --st-done-fg: #4ade80;  --st-done-bg: rgba(34, 197, 94, .16);
  --st-work-fg: #93b4ff;  --st-work-bg: rgba(59, 130, 246, .18);
  --st-warn-fg: #fbbf24;  --st-warn-bg: rgba(245, 158, 11, .16);
  --st-pay-fg: #fcd34d;   --st-pay-bg: rgba(234, 179, 8, .16);
  --st-part-fg: #c4b5fd;  --st-part-bg: rgba(139, 92, 246, .18);
  --st-bad-fg: #fca5a5;   --st-bad-bg: rgba(239, 68, 68, .18);
  --st-plain-fg: #cbd5e1; --st-plain-bg: rgba(148, 163, 184, .16);
  --st-none-fg: #94a3b8;  --st-none-bg: rgba(148, 163, 184, .14);

  --warn-bg: rgba(245, 158, 11, .14); --warn-fg: #fbbf24;
  --danger: #f87171;
  --ok: #4ade80;
  --toast-bg: #1f2b45;
  --sheet-bg: #16203a;
  --scrim: rgba(2, 6, 18, .62);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.hidden { display: none !important; }

.ico {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

/* ================= скрин / каркас ================= */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

#login { max-width: 520px; margin: 0 auto; width: 100%; overflow-y: auto; display: block; }

.app { max-width: 520px; margin: 0 auto; width: 100%; }

.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.view-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 12px 14px 20px;
}

/* ================= верхняя панель ================= */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-main { flex: 1; min-width: 0; }
.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-order h1 { font-size: 17px; }

.icon-btn {
  width: 44px; height: 44px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.is-busy .ico { animation: spin .8s linear infinite; }

/* ================= панель поиска ================= */
.tools {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.searchbox {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 8px 0 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
  transition: border-color .15s, background .15s;
}
.searchbox:focus-within { border-color: var(--accent); background: var(--surface); }
.search-ico { color: var(--muted); width: 20px; height: 20px; }
.searchbox input {
  flex: 1; min-width: 0;
  height: 100%;
  border: 0; background: transparent;
  color: var(--text);
  font: inherit; font-size: 15.5px;
  outline: none;
  -webkit-appearance: none;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  width: 30px; height: 30px; flex: none;
  border: 0; border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.search-clear .ico { width: 16px; height: 16px; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  height: 44px;
  background: var(--surface-2);
  border-radius: 13px;
}
.seg {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  min-height: 36px;
  padding: 0 6px;
}
.seg.is-on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ================= баннер ================= */
.banner {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  margin: 10px 14px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 12.5px;
  line-height: 1.35;
}
.banner-text { display: flex; align-items: center; gap: 8px; flex: 1; }
.banner-text .ico { width: 18px; height: 18px; }

/* ================= список очереди ================= */
.ptr {
  height: 0; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  transition: height .2s ease;
}
.ptr-inner {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px;
  font-size: 12.5px; color: var(--muted);
}
.ptr .spinner { border-color: var(--border); border-top-color: var(--accent); }

.list { display: block; }

.q-card {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
  padding: 13px 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s;
}
.q-card:active { transform: scale(.994); border-color: var(--accent); }
.q-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.q-row1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.q-num { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.chip-order { color: #1d4ed8; background: rgba(37, 99, 235, .12); }
.chip-reception { color: #0f766e; background: rgba(13, 148, 136, .12); }
.chip-manual { color: #7c3aed; background: rgba(124, 58, 237, .12); }
.chip-days { margin-left: auto; }
.chip-days.is-warn { color: var(--st-warn-fg); background: var(--st-warn-bg); }
.chip-days.is-hot { color: var(--st-bad-fg); background: var(--st-bad-bg); }

.q-client { margin-top: 8px; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.q-eq { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.q-sn { color: var(--muted); }
.q-defect {
  margin-top: 7px;
  font-size: 14px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.q-row3 { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
/* кнопки порядка строки очереди (только управляющий) */
.q-move { display: inline-flex; gap: 4px; flex: none; }
.q-mv {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1;
  cursor: pointer; padding: 0;
}
.q-mv:hover { border-color: var(--accent); color: var(--accent); }
.q-mv:active { background: var(--surface-2); }
.q-mv.is-busy { opacity: .55; }
.q-mech {
  margin-left: auto;
  max-width: 55%;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* ================= статусы ================= */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.st-done { color: var(--st-done-fg); background: var(--st-done-bg); }
.st-work { color: var(--st-work-fg); background: var(--st-work-bg); }
.st-warn { color: var(--st-warn-fg); background: var(--st-warn-bg); }
.st-pay { color: var(--st-pay-fg); background: var(--st-pay-bg); }
.st-part { color: var(--st-part-fg); background: var(--st-part-bg); }
.st-bad { color: var(--st-bad-fg); background: var(--st-bad-bg); }
.st-plain { color: var(--st-plain-fg); background: var(--st-plain-bg); }
.st-none { color: var(--st-none-fg); background: var(--st-none-bg); }

/* ================= скелетоны ================= */
.is-skeleton { pointer-events: none; }
.sk {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  height: 12px;
}
.sk-1 { width: 42%; height: 16px; }
.sk-2 { width: 78%; margin-top: 12px; }
.sk-3 { width: 62%; margin-top: 9px; }
.sk-4 { width: 34%; margin-top: 12px; }
.card.is-skeleton, .order-hero.is-skeleton { padding: 16px; }
.card.is-skeleton .sk-2, .order-hero.is-skeleton .sk-2 { margin-top: 14px; }
.card.is-skeleton .sk-3 { margin-top: 10px; }

/* ================= пустые состояния ================= */
.state-block { text-align: center; padding: 46px 16px 32px; }
.state-ico {
  width: 60px; height: 60px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  display: grid; place-items: center;
}
.state-ico .ico { width: 28px; height: 28px; }
.state-title { font-size: 17px; font-weight: 800; }
.state-text { margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.state-actions { margin-top: 18px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.state-actions .btn { height: 48px; }

/* ================= кнопки ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, background .15s, opacity .15s;
  -webkit-appearance: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
}
.btn-primary:active { background: var(--accent-press); }
.btn-primary[disabled] {
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
  transform: none;
  cursor: default;
}
.btn-ghost { height: 44px; font-size: 14.5px; background: var(--surface-2); color: var(--text); }
.btn-danger-ghost {
  height: 50px;
  background: transparent;
  color: var(--danger);
  border-color: rgba(220, 38, 38, .35);
}
.btn-block { width: 100%; }
.btn-lg { height: 56px; font-size: 17px; border-radius: 16px; }
.btn-inline {
  height: 32px; padding: 0 11px;
  font-size: 12.5px; font-weight: 700;
  border-radius: 9px;
  background: rgba(0, 0, 0, .07);
  color: inherit;
  box-shadow: none;
}
.btn.is-busy { opacity: .75; pointer-events: none; }
.btn-label { display: inline-block; }
.mt8 { margin-top: 10px; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
#login-submit.is-busy .btn-label { display: none; }

/* ================= карточки-блоки ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.block { padding: 13px 14px; margin-top: 10px; }
.block-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px;
  font-size: 11.5px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}
.block-title .ico { width: 16px; height: 16px; }
.block-title span { flex: 1; }
.block-count {
  font-size: 11px; font-weight: 800;
  padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  letter-spacing: 0;
}
.block-body { display: block; }

.kv {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 7px 0;
  font-size: 14.5px;
  border-bottom: 1px solid var(--border-soft);
}
.kv:last-child { border-bottom: 0; }
.kv-k { flex: 0 0 38%; color: var(--muted); font-size: 13.5px; padding-top: 1px; }
.kv-v { flex: 1; min-width: 0; text-align: right; font-weight: 600; word-break: break-word; }
.kv-v b { font-weight: 800; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 500; color: var(--muted); }

.tel {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); text-decoration: none; font-weight: 700;
}
.tel .ico { width: 17px; height: 17px; }

.text { margin: 0; font-size: 14.5px; color: var(--text-2); white-space: pre-wrap; }

/* таблицы работ/запчастей */
.table { display: block; }
.trow {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}
.trow:last-child { border-bottom: 0; }
.tc-name { flex: 1; min-width: 0; }
.tc-note { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.tc-qty { flex: none; min-width: 28px; text-align: right; color: var(--muted); font-weight: 600; }
.tc-sum { flex: none; min-width: 86px; text-align: right; font-weight: 700; white-space: nowrap; }
.trow-total { border-bottom: 0; padding-top: 10px; font-weight: 800; }
.trow-total .tc-name { color: var(--text); }

/* комментарии */
.comment { padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.comment:last-child { border-bottom: 0; }
.comment-meta { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.comment-text { margin-top: 4px; font-size: 14.5px; color: var(--text-2); white-space: pre-wrap; }

.paid-note {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 8px 10px;
  border-radius: 10px;
  background: var(--st-done-bg); color: var(--st-done-fg);
  font-size: 13px; font-weight: 700;
}
.paid-note .ico { width: 16px; height: 16px; }

.photo-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.photo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.photo-chip .ico { width: 14px; height: 14px; }

.notice {
  display: flex; gap: 10px;
  margin-top: 12px; padding: 12px 13px;
  border-radius: 13px;
  background: var(--warn-bg); color: var(--warn-fg);
  font-size: 13px; line-height: 1.45;
}
.notice .ico { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* ================= шапка заказа ================= */
.order-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 15px 15px 13px;
  box-shadow: var(--shadow-card);
}
.order-hero-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-num { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.order-hero-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.order-days { font-size: 12.5px; color: var(--muted); }
.order-hero-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.order-amount { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.order-pay { font-size: 12.5px; color: var(--muted); text-align: right; }

.actionbar {
  flex: none;
  padding: 10px 14px 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ================= профиль ================= */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px 15px; margin-top: 2px; }
.avatar {
  width: 56px; height: 56px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-press));
  color: #fff;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}
.profile-main { min-width: 0; }
.profile-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.profile-role { margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--accent); }
.profile-login { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-plain { font-size: 12.5px; padding: 5px 10px; }

.segmented-theme { height: 42px; }
.profile-actions { margin: 18px 0 8px; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.hint.center { text-align: center; }

/* ================= вход ================= */
.login-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand-mark {
  width: 50px; height: 50px; flex: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .3);
}
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.brand-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }

.login-card { padding: 16px 15px; display: flex; flex-direction: column; gap: 14px; }

.field { display: block; }
.field-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field input, .advanced input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit; font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
}
.field input:focus, .advanced input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
/* выпадающий список пользователей на экране входа */
.field select.login-select {
  width: 100%;
  height: 52px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 23px, calc(100% - 14px) 23px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.field select.login-select:focus {
  border-color: var(--accent);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.field-pw { position: relative; display: block; }
.field-pw input { padding-right: 54px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  border: 0; border-radius: 11px;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.pw-toggle .ico { width: 20px; height: 20px; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.alert { border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
.alert-error {
  background: var(--st-bad-bg);
  color: var(--st-bad-fg);
  border: 1px solid rgba(185, 28, 28, .18);
}

.advanced { border-top: 1px solid var(--border); padding-top: 12px; }
.advanced summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.advanced input { height: 46px; font-size: 14px; margin-top: 10px; }
.advanced-actions { display: flex; gap: 8px; margin-top: 10px; }
.advanced-actions .btn { flex: 1; }

.login-foot { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.login-version { margin: 8px 0 0; text-align: center; font-size: 11px; color: var(--muted); opacity: .65; }

/* ================= нижняя навигация ================= */
.tabbar {
  flex: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
/* вкладки всегда в одну строку, ширина равная */
.tabbar .tab { flex: 1 1 0; min-width: 0; }
.tab {
  border: 0; background: transparent;
  height: 58px;
  color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer;
  transition: color .15s;
}
.tab .ico { width: 23px; height: 23px; }
.tab.is-on { color: var(--accent); }

/* ================= тосты ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 80;
  max-width: min(92vw, 440px);
  padding: 12px 16px;
  border-radius: 13px;
  background: var(--toast-bg);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(2, 6, 18, .35);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  text-align: center;
}
.toast:not(.hidden) { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { background: #0f7a4a; }
.toast-err { background: #b91c1c; }
.toast-warn { background: #92400e; }

/* ================= нижний лист ================= */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: var(--scrim);
  z-index: 50;
  animation: fade .18s ease;
}
.sheet {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 100%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  max-height: 84vh;
  z-index: 51;
  display: flex;
  flex-direction: column;
  background: var(--sheet-bg);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 44px rgba(2, 6, 18, .35);
  transition: transform .22s cubic-bezier(.2, .9, .25, 1);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 2px 16px; flex: none; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 12px calc(14px + env(safe-area-inset-bottom));
}
.sheet-hint { margin: 6px 4px 2px; font-size: 13px; color: var(--muted); }
.sheet-hint b { color: var(--text); }
.sheet-group {
  margin: 14px 4px 4px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}
.sheet-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 12px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit; font-size: 15px; text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.sheet-item + .sheet-item { box-shadow: inset 0 1px 0 var(--border-soft); }
.sheet-item:active { background: var(--surface-2); }
.sheet-item.is-current { background: rgba(37, 99, 235, .09); }
.si-name { flex: 1; min-width: 0; }
.si-cur {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700; color: var(--accent);
}
.si-cur .ico { width: 14px; height: 14px; }
.si-arrow { width: 18px; height: 18px; color: var(--muted); }
.sheet-item.is-busy { opacity: .65; }
.sheet-note { margin: 14px 4px 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.sheet-error { margin: 8px 4px; }

/* ================= анимации ================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================= широкие экраны ================= */
@media (min-width: 620px) {
  body { background: #dfe6f1; }
  :root[data-theme="dark"] body { background: #060b15; }
  .app {
    box-shadow: 0 0 0 1px var(--border), 0 24px 60px rgba(15, 23, 42, .18);
    background: var(--bg);
  }
  #login { background: var(--bg); box-shadow: 0 0 0 1px var(--border), 0 24px 60px rgba(15, 23, 42, .18); }
}

/* ============ версия 1.1: крупные кнопки, действия управляющего, клиенты ============ */

/* плавающая кнопка «Принять в ремонт» */
.fab {
  position: absolute;
  left: 14px; right: 14px;
  bottom: calc(70px + env(safe-area-inset-bottom));
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 16.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .35);
  z-index: 6;
}
.fab:active { background: var(--accent-press); transform: translateY(1px); }
.fab .ico { width: 22px; height: 22px; stroke-width: 2.2; }

/* карточка очереди: кнопка действий «…» */
.q-card { position: relative; padding-right: 52px; }
.q-actions {
  position: absolute;
  top: 6px; right: 6px;
  width: 44px; height: 44px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.q-actions:active { background: var(--surface-2); }
.q-actions .ico { width: 24px; height: 24px; }

.q-card.is-unassigned { border-left: 4px solid var(--st-warn-fg); }
.q-mech-none { color: var(--st-warn-fg); font-weight: 700; }

/* кнопка «Отложено» рядом с фильтром */
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text-2);
  font-size: 14px; font-weight: 600;
}
.tool-btn b {
  min-width: 22px; height: 22px; border-radius: 11px;
  background: var(--surface-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px;
}
.tool-btn:active { background: var(--surface-2); }

/* строки нижнего листа */
.sheet-item-static { padding: 4px 4px 10px; }
.sheet-item-static .si-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.sheet-note-line { padding: 0 4px 10px; font-size: 14px; color: var(--text-2); }
.sheet-note-line.warn { color: var(--st-warn-fg); font-weight: 700; }
.sheet-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--border-soft);
}
.sheet-row .sr-main { flex: 1; min-width: 0; }
.sheet-search { margin: 0 0 8px; }
.sheet-search input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 16px;
}
.btn-sm { height: 44px; padding: 0 14px; font-size: 14.5px; }

/* клиенты */
.client-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 14px; margin-bottom: 10px;
  min-height: 64px;
}
.client-row:active { background: var(--surface-2); }
.client-row .cr-main { flex: 1; min-width: 0; }
.client-row .cr-name { font-weight: 700; font-size: 16px; }
.client-row .cr-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.client-row .cr-arrow { color: var(--muted); width: 20px; height: 20px; }

.client-head { padding: 4px 2px 12px; }
.client-head-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.client-head-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tel.big {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px; height: 44px; padding: 0 14px;
  border-radius: 12px; background: var(--surface-2);
  color: var(--accent); font-weight: 700; font-size: 16px; text-decoration: none;
}

.order-row {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.order-row:last-child { border-bottom: 0; }
.order-row .or-main { flex: 1; min-width: 0; }
.order-row .or-num { font-weight: 700; font-size: 15px; }
.order-row .or-eq { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.order-row .or-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.order-row .or-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.order-row .or-sum { font-size: 13.5px; font-weight: 700; }

.inv-row {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.inv-row:last-child { border-bottom: 0; }
.inv-row .ir-main { flex: 1; min-width: 0; }
.inv-row .ir-num { font-weight: 700; font-size: 15px; }
.inv-row .ir-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.inv-row .ir-right { text-align: right; }
.inv-row .ir-sum { font-weight: 700; font-size: 15px; }
.inv-row .ir-pay { font-size: 12px; margin-top: 2px; color: var(--muted); }
.inv-row .pay-full { color: var(--st-done-fg); font-weight: 700; }
.inv-row .pay-partial { color: var(--st-warn-fg); font-weight: 700; }
.inv-row .pay-none { color: var(--st-bad-fg); font-weight: 700; }
.inv-row .pay-not_counted { color: var(--muted); }

.muted.small, .small { font-size: 13px; color: var(--muted); }

/* карточка заказа: строка действий под статусом */
.order-quick { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.order-quick .btn { height: 44px; font-size: 14.5px; }

.field-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* ---- состав заказа: работы и товары ---- */
.ord-lines .ol-list { display: flex; flex-direction: column; gap: 10px; }
.ol-row { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; background: #fff; }
.ol-head { display: flex; align-items: center; gap: 8px; }
.ol-name { flex: 1 1 auto; font-weight: 600; line-height: 1.25; color: #111827; }
.ol-tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #eef2ff; color: #3730a3; white-space: nowrap; }
.ol-tag-goods { background: #ecfdf5; color: #047857; }
.ol-del { border: 0; background: transparent; font-size: 22px; line-height: 1; color: #b91c1c; cursor: pointer; padding: 0 2px; }
.ol-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; align-items: end; }
.ol-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #6b7280; }
.ol-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 15px; background: #fff; color: #111827; }
.ol-input:focus { outline: 2px solid #93c5fd; outline-offset: 0; }
.ol-sum { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #6b7280; }
.ol-sum b { font-size: 16px; color: #111827; }
.ol-sum em { font-size: 11px; color: #b45309; font-style: normal; }
.ol-totals { margin-top: 12px; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.ol-t { display: flex; justify-content: space-between; padding: 3px 0; }
.ol-t-total { font-size: 17px; font-weight: 700; border-top: 1px dashed #e5e7eb; margin-top: 6px; padding-top: 8px; }
.ol-actions { display: flex; gap: 8px; margin-top: 12px; }
.ol-btn { flex: 1 1 0; }
.ol-disc { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.ol-disc .ol-f { flex: 1 1 auto; }
.ol-search { margin-bottom: 8px; }
.ol-results { display: flex; flex-direction: column; }
.ol-pick { display: flex; flex-direction: column; gap: 10px; }
.ol-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ol-chip { border: 1px solid #d1d5db; background: #f9fafb; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }

/* ---- состав заказа: отметка «не проведён» и плашка предупреждения ---- */
.chip-unposted { background: #fef3c7; color: #92400e; }
.notice-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.oe-msg.is-warn { color: #92400e; }

/* цена позиции в результатах подбора */
.si-price { margin-left: auto; margin-right: 8px; color: #0f766e; font-weight: 600; white-space: nowrap; }

/* код доступа клиента: кнопки и ввод своего кода */
.access-actions { margin-top: 10px; }
.access-row { display: flex; gap: 8px; margin-top: 8px; }
.access-input { flex: 1 1 auto; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 18px; letter-spacing: 2px; text-align: center; }
/* ===== офлайн-режим: индикатор, панель отложенных действий, плашки ===== */
.offline-bar { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 9000; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px; background: #0f766e; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 13px; }
.offline-bar.is-offline { background: #b45309; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: #bbf7d0; flex: 0 0 auto; }
.offline-bar.is-offline .ob-dot { background: #fde68a; }
.ob-text { flex: 1 1 auto; }
.ob-btn { border: 0; border-radius: 9px; padding: 7px 10px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.18); color: #fff; }
.ob-btn-ghost { background: transparent; text-decoration: underline; }
.offline-panel { position: fixed; left: 8px; right: 8px; bottom: 60px; z-index: 9001; background: #fff; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28); max-height: 60vh; overflow: auto; }
.op-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 700; border-bottom: 1px solid #eef1f4; }
.op-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: #6b7280; }
.op-body { padding: 6px 8px 10px; }
.op-row { display: flex; align-items: center; gap: 8px; padding: 9px 6px; border-bottom: 1px solid #f3f4f6; }
.op-main { flex: 1 1 auto; min-width: 0; }
.op-label { font-size: 14px; }
.op-time { font-size: 12px; color: #6b7280; }
.op-cancel { border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 6px 9px; font-size: 12px; color: #b91c1c; }
.op-empty { padding: 16px; text-align: center; color: #6b7280; font-size: 14px; }
.offline-cache-banner { margin: 8px 10px 0; padding: 9px 12px; border-radius: 10px; background: #fef3c7; color: #92400e;
  font-size: 13px; line-height: 1.35; }
.offline-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 70px; z-index: 9002; max-width: 90vw;
  padding: 10px 14px; border-radius: 10px; background: #111827; color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.offline-toast.is-err { background: #b91c1c; }
.offline-toast.is-warn { background: #b45309; }
.offline-toast.is-ok { background: #0f766e; }

/* техническая деталь под ошибкой входа клиента */
.login-error-detail { margin-top: 6px; font-size: 11px; line-height: 1.35; color: #6b7280; word-break: break-word; }

/* переключатель контрагентов в кабинете */
#client-companies { padding: 8px 12px 4px; }
.cc-label { font-size: 11px; color: #6b7280; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.cc-chip { display: inline-block; margin: 0 6px 6px 0; padding: 7px 12px; border-radius: 999px; border: 1px solid #d1d5db; background: #fff; font-size: 13px; color: #111827; }
.cc-chip.is-on { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 600; }

/* диагностика кабинета на экране */
.diag-panel { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 9500; background: rgba(17,24,39,.92); color: #e5e7eb; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: 11px; }
.diag-panel.hidden { display: none; }
.diag-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 700; font-size: 12px; }
.diag-head span { flex: 1 1 auto; }
.diag-btn { border: 0; border-radius: 8px; padding: 5px 8px; font-size: 11px; background: rgba(255,255,255,.16); color: #fff; }
.diag-body { margin: 0; padding: 0 10px 10px; max-height: 34vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, monospace; font-size: 10px; line-height: 1.35; }
/* карточки заказов в кабинете */
.client-card { position: relative; overflow: hidden; }
.cc-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #94a3b8; }
.client-card.is-repair .cc-bar { background: #f59e0b; }
.client-card.is-ready .cc-bar { background: #10b981; }
.client-card.is-returned .cc-bar { background: #64748b; }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cc-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e2e8f0; color: #334155; }
.cc-badge.is-repair { background: #fef3c7; color: #92400e; }
.cc-badge.is-ready { background: #d1fae5; color: #065f46; }
.cc-badge.is-returned { background: #e2e8f0; color: #475569; }
.cc-sum { font-size: 15px; font-weight: 700; color: #0f172a; }
.cc-steps { display: flex; gap: 4px; margin: 8px 0 6px; }
.cc-step { flex: 1 1 0; font-size: 9px; text-align: center; padding: 4px 2px; border-radius: 6px; background: #f1f5f9; color: #94a3b8; }
.cc-step.done { background: #d1fae5; color: #065f46; }
.cc-step.now { background: #0f766e; color: #fff; font-weight: 700; }
.cc-more { margin-top: 6px; font-size: 12px; color: #0f766e; font-weight: 600; }
.ready-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 10px 12px; border-radius: 12px; background: #d1fae5; color: #065f46; font-size: 13px; }
.ready-banner.hidden { display: none; }
.ready-banner span { flex: 1 1 auto; font-size: 12px; }
.ready-call { background: #065f46; color: #fff; border-radius: 9px; padding: 6px 10px; font-size: 12px; font-weight: 700; text-decoration: none; }
/* вкладка «Сервис» */
.client-service-body { padding: 12px; }
.svc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.svc-btn { display: inline-block; padding: 11px 16px; border-radius: 12px; background: #0f766e; color: #fff;
  font-size: 14px; font-weight: 700; text-decoration: none; }
.svc-btn.svc-wa { background: #128c7e; }
.svc-note { margin-top: 8px; font-size: 12px; color: #6b7280; }

/* бейдж оплаты в карточке заказа */
.cc-pay { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.cc-pay.is-paid { background: #d1fae5; color: #065f46; }
.cc-pay.is-due { background: #fef3c7; color: #92400e; }
.cc-pay.is-na { background: #e2e8f0; color: #475569; }
.cc-pay.is-unknown { background: #f1f5f9; color: #64748b; }

/* чипы состояний и сортировка в кабинете */
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 2px; }
.st-chip { border: 1px solid #d1d5db; background: #fff; color: #334155; border-radius: 999px; padding: 6px 10px; font-size: 12px; }
.st-chip.is-on { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 700; }
.st-num { opacity: .75; font-size: 11px; }
.st-sort { display: flex; gap: 6px; padding: 6px 12px 2px; }
.st-sort-btn { border: 0; background: transparent; color: #0f766e; font-size: 12px; text-decoration: underline; padding: 4px 2px; }
.st-sort-btn.is-on { font-weight: 700; text-decoration: none; }
.cb-plain { margin-left: 8px; font-size: 12px; color: #0f766e; font-weight: 600; }
/* ======================= КАБИНЕТ КЛИЕНТА: оформление ======================= */
/* Опирается на переменные приложения (--surface, --border, --shadow-card, --accent). */

#client-app { max-width: 1160px; margin: 0 auto; width: 100%; padding: 0 16px 24px; box-sizing: border-box; }
#client-app .topbar, #client-app .client-head { padding: 16px 0 8px; }
#client-app .client-name { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
#client-app .topbar-sub { font-size: 14px; color: var(--muted); margin: 0; }

/* организации */
#client-companies { padding: 12px 0 4px; }
#client-companies .cc-label { font-size: 11px; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
#client-companies .cc-chip { border-radius: 999px; padding: 8px 14px; font-size: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
#client-companies .cc-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* счётчики */
#client-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 16px; }
#client-summary .summary-tile { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 16px 12px; min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: var(--shadow-card); }
#client-summary .summary-num { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--text); }
#client-summary .summary-cap { font-size: 12px; color: var(--muted); text-align: center; }
#client-summary .is-repair .summary-num { color: var(--st-work-fg); }
#client-summary .is-ready .summary-num { color: var(--st-done-fg); }
#client-summary .is-returned .summary-num { color: var(--muted); }

/* чипы фильтров: одна строка с прокруткой */
.status-chips { display: flex; gap: 8px; padding: 4px 0 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.status-chips::-webkit-scrollbar { display: none; }
.st-chip { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; line-height: 1; white-space: nowrap; }
.st-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.st-num { font-size: 11px; color: var(--muted); margin-left: 2px; }
.st-chip.is-on .st-num { color: rgba(255,255,255,.75); }
.st-sort { display: flex; gap: 14px; padding: 10px 0 12px; }
.st-sort-btn { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 0; }
.st-sort-btn.is-on { color: var(--accent); font-weight: 600; }

/* список заказов: сетка на ПК */
#client-orders { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { #client-orders { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1440px) { #client-orders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* карточка */
.client-card { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px 18px 14px;
  box-shadow: var(--shadow-card); overflow: hidden; min-height: 172px; }
.client-card .cc-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--st-plain-fg); }
.client-card.is-work .cc-bar { background: var(--st-work-fg); }
.client-card.is-ready .cc-bar { background: var(--st-done-fg); }
.client-card.is-parts .cc-bar { background: var(--st-part-fg); }
.client-card.is-approve .cc-bar { background: var(--st-warn-fg); }
.client-card.is-pay .cc-bar { background: var(--st-pay-fg); }
.client-card.is-muted .cc-bar { background: var(--border); }

.cc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cc-status-text { font-size: 15px; font-weight: 700; color: var(--text); }
.cc-sum { font-size: 20px; font-weight: 700; color: var(--text); white-space: nowrap; letter-spacing: -.01em; }
.cc-status-raw { font-size: 12px; color: var(--muted); margin-top: -2px; }
.cc-eq { font-size: 17px; font-weight: 600; color: var(--text); margin-top: 2px; }
.cc-serial { font-size: 13px; color: var(--muted); }
.cc-what { font-size: 13px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.cc-pay2 { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--st-done-fg); }
.dot-warn { background: var(--st-warn-fg); }
.cc-meta { font-size: 12px; color: var(--muted); }
.cc-more { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 6px; }

/* плашка «готово к выдаче» */
.ready-banner { margin: 0 0 16px; border-radius: 14px; background: var(--st-done-bg); color: var(--st-done-fg);
  padding: 14px 16px; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ready-banner span { flex: 1 1 240px; font-size: 13px; }
.ready-call { background: var(--st-done-fg); color: #fff; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; text-decoration: none; }

/* карточка заказа (экран) */
#client-order-body { max-width: 900px; }
.cb-block { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow-card); }
.cb-title { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.cb-eq { font-size: 19px; font-weight: 700; }
.cb-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cb-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 15px; border-bottom: 1px solid var(--border-soft); }
.cb-row:last-child { border-bottom: 0; }
.cb-row .k { color: var(--muted); font-size: 14px; }
.cb-row .v { text-align: right; color: var(--text); }
.cb-list { list-style: none; margin: 0; padding: 0; }
.cb-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 15px; }
.cb-list li:last-child { border-bottom: 0; }
.cb-list .li-name { flex: 1 1 auto; }
.cb-list .li-qty { color: var(--muted); font-size: 13px; }
.cb-list .li-sum { white-space: nowrap; font-weight: 600; }
.cb-plain { margin-left: 10px; font-size: 13px; color: var(--muted); }

/* мобильный */
@media (max-width: 640px) {
  #client-app { padding: 0 14px 20px; }
  #client-summary { gap: 8px; }
  #client-summary .summary-tile { min-height: 76px; padding: 12px 8px; }
  #client-summary .summary-num { font-size: 24px; }
  .client-card { padding: 14px 15px 12px; min-height: 0; }
  .cc-eq { font-size: 16px; }
  .cc-sum { font-size: 18px; }
}
/* ПК: снимаем ограничения ширины у внутренних контейнеров кабинета */
#client-app .topbar,
#client-app .summary-row,
#client-app .client-tools,
#client-app .view-scroll,
#client-app .view { max-width: none !important; width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }
@media (min-width: 1100px) {
  #client-app .topbar, #client-app .client-tools, #client-app .view-scroll { padding-left: 8px; padding-right: 8px; }
  #client-app .summary-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* список заказов занимает всю доступную высоту, пустое состояние — по центру */
#client-app .view { min-height: 0; }
#client-app .view-scroll { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding-bottom: 16px; }
#client-app .view-scroll .list { flex: 0 0 auto; align-content: start; }
#client-app .client-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; min-height: 220px; margin: 0; padding: 24px 16px; color: var(--muted); }
#client-app .client-empty.hidden { display: none; }
#client-app .client-empty h3 { font-size: 16px; color: var(--text); margin: 8px 0 6px; font-weight: 600; }
#client-app .client-empty p { font-size: 13px; margin: 0 0 14px; }
#client-app .client-empty .ce-ico { opacity: .5; }
.svc-link { color: var(--accent); text-decoration: none; }
.svc-btn.svc-tg { background: #229ed9; }
.svc-btn.svc-mail { background: var(--st-plain-fg); }
@media (max-width: 640px) {
  #client-app .view-scroll { padding: 12px 14px 20px; }
  #client-app .list { gap: 12px; }
}
/* нижнее меню кабинета фиксировано, чипы в одну строку */
.status-chips { flex-wrap: nowrap !important; overflow-x: auto; }
#client-tabbar { display: flex; flex-wrap: nowrap; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--border-soft); }
#client-tabbar .tab { flex: 1 1 0; min-width: 0; padding: 8px 4px 10px; }
#client-tabbar .tab span { font-size: 11px; }
#client-tabbar .tab .ico { width: 20px; height: 20px; }
#client-app .view-scroll { padding-bottom: 84px; }
@media (min-width: 1100px) {
  #client-app .view-scroll { padding-bottom: 96px; }
}
.svc-btn.svc-max { background: #6d28d9; }
.svc-btn.svc-route { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
/* согласие на обработку ПД */
.consent-box { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 10px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.consent-box input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.consent-box a { color: var(--accent); }
/* запросы клиента */
.req-select, .req-text { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 15px; background: var(--surface); color: var(--text); }
.req-text { resize: vertical; min-height: 90px; }
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-item { border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.req-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.req-topic { font-size: 15px; font-weight: 600; }
.req-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--st-none-bg); color: var(--st-none-fg); }
.req-status.is-new { background: var(--st-work-bg); color: var(--st-work-fg); }
.req-status.is-work { background: var(--st-warn-bg); color: var(--st-warn-fg); }
.req-status.is-done { background: var(--st-done-bg); color: var(--st-done-fg); }
.req-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.req-text-body { font-size: 14px; margin-top: 6px; }
.req-answer { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--st-done-bg); font-size: 14px; }
.req-order-info { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--st-none-bg); }
.req-order-info.hidden { display: none; }
.roi-num { font-size: 14px; font-weight: 600; }
.roi-line { font-size: 13px; color: var(--muted); margin-top: 2px; }
.roi-defect { font-size: 13px; margin-top: 4px; }
.req-hint { font-size: 12px; color: var(--muted); margin: 6px 0 10px; line-height: 1.4; }
/* запросы клиентов в приложении сотрудника */
.requests-tools { padding: 0 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.requests-search { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.req-card { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-card); }
.req-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.req-card-client { font-size: 15px; font-weight: 600; }
.req-card-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--st-none-bg); color: var(--st-none-fg); }
.req-card-status.is-new { background: var(--st-work-bg); color: var(--st-work-fg); }
.req-card-status.is-work { background: var(--st-warn-bg); color: var(--st-warn-fg); }
.req-card-status.is-done { background: var(--st-done-bg); color: var(--st-done-fg); }
.req-card-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.req-card-text { font-size: 14px; margin-top: 6px; }
.req-card-answer { margin-top: 8px; font-size: 13px; color: var(--st-done-fg); }
.req-full-text { font-size: 15px; margin: 10px 0; white-space: pre-wrap; }
.tab-badge { position: absolute; top: 4px; right: 10px; min-width: 16px; height: 16px; border-radius: 8px; background: #dc2626; color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; }
.tab-badge.hidden { display: none; }
.tab { position: relative; }
/* материалы под работами */
.ol-mats { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-soft); }
.ol-mats-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.ol-mat { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.ol-mat-name { flex: 1 1 auto; }
.ol-mat-qty { color: var(--muted); font-size: 12px; }
.ol-mat-del { border: 0; background: transparent; color: var(--danger); font-size: 18px; line-height: 1; min-width: 40px; min-height: 40px; padding: 0; }
.ol-mat-add { margin-top: 6px; border: 1px dashed var(--border); background: transparent; color: var(--accent); border-radius: 9px; padding: 10px 12px; font-size: 13px; width: 100%; min-height: 42px; }
.mat-list { margin-top: 10px; max-height: 50vh; overflow-y: auto; }
.mat-item { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; font-size: 14px; }
.mat-price { color: var(--muted); font-size: 13px; }


/* ND: контраст в шторке «Материал к работе» (белый фон — тёмный текст) */
.mat-item { color: #111827; background: #ffffff; border-color: #d8dee9; }
.mat-item:hover, .mat-item:active { background: #f3f6fb; }
.mat-item b, .mat-item span, .mat-item div, .mat-item small, .mat-item strong { color: #111827; }
.mat-item small, .mat-item .muted { color: #5b6472; }
.mat-pick, .mat-pick .oe-hint { color: #111827; }
.mat-pick .oe-hint { color: #6b7280; }
#mat-q, .mat-pick input[type=search] { color: #111827; background: #ffffff; border: 1px solid #d8dee9; }
#mat-q::placeholder { color: #9aa3b2; }
/* мобильный кабинет: список занимает основную высоту, шапка компактная */
@media (max-width: 640px) {
  #client-app .topbar { padding: 6px 0 2px; }
  #client-app .client-hello { display: none; }
  #client-app .client-name { font-size: 18px; margin-bottom: 2px; }
  #client-app .topbar-sub { font-size: 13px; }
  #client-app #client-companies { padding: 6px 0 2px; }
  #client-app #client-companies .cc-chip { padding: 6px 10px; font-size: 12px; }
  #client-summary { gap: 6px; margin: 6px 0 8px; }
  #client-summary .summary-tile { min-height: 56px; padding: 8px 4px; border-radius: 12px; }
  #client-summary .summary-num { font-size: 20px; }
  #client-summary .summary-cap { font-size: 11px; }
  .status-chips { padding: 2px 0 0; }
  .st-chip { padding: 6px 10px; font-size: 12px; }
  .st-sort { padding: 6px 0 8px; }
  #client-app .view-scroll { flex: 1 1 auto; min-height: 55vh; padding: 8px 14px 20px; }
  .ready-banner { padding: 8px 10px; font-size: 12px; flex-wrap: nowrap; overflow: hidden; }
  .ready-banner span { display: none; }
}
