/* =========================================================
   ЭкоМетр — общий дизайн сайта и рабочей области
   ========================================================= */
:root {
  --ink: #102733;
  --ink-soft: #334b59;
  --muted: #687d8a;
  --line: #dbe7eb;
  --line-strong: #c7d7dd;
  --bg: #f4f8f9;
  --card: #ffffff;
  --brand: #0b6b62;
  --brand-2: #0f9186;
  --brand-dark: #064a44;
  --brand-soft: #e6f6f3;
  --navy: #0b2438;
  --navy-soft: #15364e;
  --aqua: #dff4f1;
  --amber: #f3b23c;
  --amber-soft: #fff4d8;
  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --success: #067647;
  --success-soft: #e8f7ee;
  --blue: #175cd3;
  --blue-soft: #eaf1fd;
  --orange: #e04f16;
  --orange-soft: #fff0e6;
  --yellow: #b54708;
  --yellow-soft: #fff8e6;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(15, 52, 62, 0.05);
  --shadow: 0 16px 44px rgba(15, 52, 62, 0.09);
  --shadow-lg: 0 30px 70px rgba(8, 38, 48, 0.16);
  --font: "Manrope", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar: 264px;
  --topbar: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.hidden, [hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; line-height: 1; transition: .18s ease;
  white-space: nowrap; cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(11, 107, 98, .2); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-whatsapp { background: #25d366; color: #073b21; }
.btn-whatsapp:hover { background: #1cbf59; color: #073b21; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-soft:hover { background: var(--aqua); color: var(--brand-dark); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f5c2be; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: 12.5px; gap: 6px; }
.btn-lg { min-height: 54px; padding: 15px 24px; border-radius: 14px; font-size: 15px; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: 11px; }
.btn-link { border: 0; background: transparent; color: var(--brand); font-weight: 700; padding: 0; }
.btn-link:hover { color: var(--brand-dark); text-decoration: underline; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* ---------- Бейджи и статусы ---------- */
.badge, .status-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; line-height: 1.4;
  background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-warn { background: var(--amber-soft); color: #8a5a00; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-grey { background: #eef3f5; color: #516874; }
.badge-new { background: var(--amber); color: #3d2a00; }
.badge-soft { background: #f1f6f7; color: var(--ink-soft); }

/* ---------- Служебные сообщения ---------- */
.messages { display: grid; gap: 10px; margin: 0 0 18px; }
.message {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.message-success { border-color: #b6e4c9; background: var(--success-soft); color: #075e3c; }
.message-warning { border-color: #f5d58b; background: var(--amber-soft); color: #714800; }
.message-error, .message-danger { border-color: #f3b7b2; background: var(--danger-soft); color: #9f1e15; }
.message-info { border-color: #b9d4f4; background: var(--blue-soft); color: #154c9c; }
.message .icon { margin-top: 1px; }

/* =========================================================
   Публичная часть
   ========================================================= */
.public-body { background: #fff; }
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px); border-bottom: 1px solid rgba(219,231,235,.8);
}
.site-header-inner { display: flex; align-items: center; gap: 26px; min-height: 78px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); flex: 0 0 auto; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 10px 22px rgba(11,107,98,.23); font-weight: 800; font-size: 20px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.03em; line-height: 1.05; }
.brand-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); margin-top: 3px; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--ink-soft); font-weight: 650; font-size: 13.5px; padding: 9px 11px; border-radius: 9px;
}
.site-nav a:hover, .site-nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-phone { display: flex; flex-direction: column; line-height: 1.1; margin-right: 4px; }
.header-phone span { font-size: 10px; color: var(--muted); }
.header-phone a { font-size: 13px; font-weight: 800; color: var(--ink); }
.header-phone a:hover { color: var(--brand); }
.header-login { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); padding: 9px 11px; border-radius: 9px; }
.header-login:hover { background: #eef3f5; color: var(--brand); }
.header-install {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  padding: 9px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
}
.header-install:hover { border-color: var(--brand); color: var(--brand); }
.mobile-toggle { display: none; }
.sidebar-overlay { display: none; }
.sidebar-overlay.visible { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8,30,40,.42); backdrop-filter: blur(2px); }
.next-date-block.disabled-block { opacity: .45; }
.next-date-block.disabled-block input, .next-date-block.disabled-block button { pointer-events: none; }
.ghost-date.ghost-visible strong { opacity: .45; }
@media (max-width: 1080px) {
  .site-nav.open {
    display: flex; position: absolute; left: 12px; right: 12px; top: calc(100% + 8px);
    flex-direction: column; align-items: stretch; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; padding: 9px; box-shadow: var(--shadow-lg); z-index: 60;
  }
  .site-nav.open a { padding: 11px 13px; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(8,30,40,.25); z-index: 45;
  }
}

.hero {
  position: relative; overflow: hidden; padding: 76px 0 64px;
  background:
    radial-gradient(circle at 85% 20%, rgba(15,145,134,.12), transparent 34%),
    radial-gradient(circle at 5% 80%, rgba(243,178,60,.12), transparent 30%),
    linear-gradient(180deg, #f7fcfb 0%, #fff 78%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 70px;
  background: radial-gradient(ellipse at 50% 100%, rgba(11,107,98,.05), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: 58px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--brand-dark);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: clamp(36px, 4.5vw, 62px); line-height: 1.03; margin: 21px 0 18px; letter-spacing: -.045em; }
.hero h1 .accent { color: var(--brand); }
.hero-sub { font-size: 17px; line-height: 1.65; color: var(--ink-soft); max-width: 590px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 26px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.trust-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-soft); font-weight: 650; }
.trust-item .icon { color: var(--brand); }
.hero-visual { position: relative; min-height: 460px; display: grid; place-items: center; }
.hero-visual::before {
  content: ""; position: absolute; inset: 4% 6% 7% 4%; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  background: linear-gradient(145deg, var(--brand-soft), #f7fcff 70%);
  transform: rotate(-5deg);
}
.hero-visual img { position: relative; z-index: 1; width: min(480px, 100%); filter: drop-shadow(0 30px 35px rgba(10,70,65,.13)); }
.float-card {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 12px 15px;
  box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700;
}
.float-card small { display: block; color: var(--muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.float-card .icon { color: var(--brand); }
.float-card.one { top: 10%; right: 0; }
.float-card.two { bottom: 12%; left: 0; }
.float-card.three { bottom: 1%; right: 8%; }

.section { padding: 76px 0; }
.section-soft { background: var(--bg); }
.section-dark { background: var(--navy); color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 34px; }
.section-title { font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.035em; margin-bottom: 10px; }
.section-sub { color: var(--muted); max-width: 620px; font-size: 15.5px; margin-bottom: 0; }
.section-dark .section-sub { color: #b9cbd5; }
.services-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.service-card {
  position: relative; display: flex; flex-direction: column; gap: 13px; min-height: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: .2s ease; color: var(--ink); overflow: hidden;
}
.service-card::after {
  content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: var(--brand-soft); right: -50px; bottom: -50px; opacity: .7;
}
.service-card:hover { transform: translateY(-4px); border-color: #b8ddd7; box-shadow: var(--shadow); color: var(--ink); }
.service-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); position: relative; z-index: 1;
}
.service-icon .icon { width: 25px; height: 25px; }
.service-card h3 { font-size: 16.5px; margin: 0; position: relative; z-index: 1; }
.service-card p { font-size: 12.8px; color: var(--muted); margin: 0; position: relative; z-index: 1; flex: 1; }
.service-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; padding-top: 7px; }
.service-price { font-size: 13px; font-weight: 800; color: var(--brand-dark); }
.service-arrow { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--brand); }
.service-card:hover .service-arrow { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Новости ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.news-card {
  display: flex; flex-direction: column; overflow: hidden; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: .2s ease; min-height: 100%;
}
.news-card:hover { transform: translateY(-4px); border-color: #b8ddd7; box-shadow: var(--shadow); color: var(--ink); }
.news-card-media { aspect-ratio: 16 / 10; background: var(--brand-soft); overflow: hidden; }
.news-card-media img { width: 100%; height: 100%; object-fit: cover; }
.news-card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px; flex: 1; }
.news-card-date { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.news-card h3 { font-size: 18px; margin: 0; }
.news-card p { font-size: 13.5px; color: var(--muted); margin: 0; flex: 1; }
.news-card-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--brand); }
.news-admin-list { display: grid; gap: 10px; }
.news-admin-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.news-admin-thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--brand-soft); flex: 0 0 auto; }
.news-admin-thumb-empty { display: grid; place-items: center; color: var(--brand); }
.news-admin-main { min-width: 0; flex: 1; }
.news-admin-title { font-weight: 800; font-size: 13.5px; }
.news-admin-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.news-admin-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.news-detail { max-width: 820px; margin: 0 auto; }
.news-detail-cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 28px; }
.news-detail h1 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 12px; }
.news-detail-meta { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 22px; }
.news-detail-body { font-size: 16px; line-height: 1.75; color: var(--ink-soft); white-space: pre-line; }
.install-steps { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.install-steps li { margin-bottom: 7px; }
.install-notes { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.install-notes li { margin-bottom: 8px; }
.pwa-check-results { display: grid; gap: 8px; }
.pwa-check-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.pwa-check-label { font-weight: 700; flex: 1 1 220px; }
.pwa-check-detail { color: var(--muted); font-size: 12.5px; flex: 1 1 100%; word-break: break-word; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .icon { color: var(--brand); width: 28px; height: 28px; margin-bottom: 16px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { font-size: 13.5px; color: var(--muted); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; }
.step { position: relative; padding: 0 22px 0 0; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(11,107,98,.25);
}
.step h3 { font-size: 16px; margin-bottom: 7px; }
.step p { font-size: 13px; color: var(--muted); margin: 0; max-width: 230px; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 22px; left: 54px; right: 12px; height: 1px;
  background: linear-gradient(90deg, #c9e6e1, #e8f3f1);
}

.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-box { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 24px; }
.stat-box strong { display: block; font-size: 34px; letter-spacing: -.04em; color: #fff; }
.stat-box span { font-size: 12.5px; color: #b9cbd5; }
.review-band {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center;
  padding: 30px; border-radius: var(--radius-lg); background: linear-gradient(120deg, #fff8e8, #fff); border: 1px solid #f4e3be;
}
.rating-big { display: flex; align-items: center; gap: 18px; }
.rating-number { font-size: 52px; font-weight: 800; letter-spacing: -.05em; color: #8a5a00; line-height: 1; }
.stars { color: #f3b23c; letter-spacing: 2px; font-size: 20px; }
.review-band h3 { font-size: 21px; margin-bottom: 6px; }
.review-band p { color: #6e603f; margin: 0; font-size: 13.5px; }

.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.contact-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; }
.contact-list { display: grid; gap: 15px; margin: 22px 0; }
.contact-row { display: flex; gap: 13px; align-items: flex-start; }
.contact-row .icon { color: var(--brand); margin-top: 2px; }
.contact-row small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.contact-row a, .contact-row span { font-weight: 700; color: var(--ink); font-size: 14px; }
.contact-row a:hover { color: var(--brand); }
.map-panel {
  position: relative; min-height: 430px; border-radius: var(--radius-lg); overflow: hidden;
  background:
    linear-gradient(135deg, rgba(11,107,98,.12), rgba(15,145,134,.04)),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(11,36,56,.06) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(11,36,56,.06) 47px 48px),
    #eef6f5;
  border: 1px solid var(--line); display: grid; place-items: center;
}
.map-panel::before {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  border: 30px solid rgba(11,107,98,.07); top: 20%; left: 15%;
}
.map-panel::after {
  content: ""; position: absolute; width: 240px; height: 120px; border-radius: 50%;
  background: rgba(243,178,60,.08); bottom: 8%; right: 4%;
}
.map-card-inner { position: relative; z-index: 2; background: #fff; border-radius: 18px; padding: 25px; box-shadow: var(--shadow); text-align: center; max-width: 320px; }
.map-pin { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; margin: 0 auto 14px; box-shadow: 0 12px 25px rgba(11,107,98,.3); }
.map-card-inner h3 { font-size: 17px; margin-bottom: 5px; }
.map-card-inner p { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-sm); }
.form-card h2 { font-size: 25px; margin-bottom: 6px; }
.form-card .muted { font-size: 13px; margin-bottom: 22px; }
.cta-band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  background: linear-gradient(120deg, var(--brand-dark), var(--brand) 65%, var(--brand-2));
  color: #fff; box-shadow: var(--shadow-lg);
}
.cta-band::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  border: 50px solid rgba(255,255,255,.08); right: -90px; top: -110px;
}
.cta-band h2 { font-size: clamp(26px, 3.2vw, 40px); margin-bottom: 8px; }
.cta-band p { color: #cdeae6; margin: 0; max-width: 560px; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.cta-band .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }
.cta-band .btn-whatsapp { color: #073b21; }

.site-footer { background: var(--navy); color: #c2d2dc; padding: 54px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .7fr .8fr 1fr; gap: 34px; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-sub { color: #8ba6b4; }
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }
.footer-links { display: grid; gap: 9px; }
.footer-links a, .footer-contact a { color: #c2d2dc; font-size: 13px; }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-contact { display: grid; gap: 10px; font-size: 13px; }
.footer-contact .icon { color: var(--brand-2); }
.footer-contact-row { display: flex; gap: 9px; align-items: flex-start; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; gap: 20px; font-size: 11.5px; color: #8ba6b4; }
.footer-bottom a { color: #b9cbd5; }
.footer-install {
  border: 0; background: transparent; color: #b9cbd5; font: inherit;
  padding: 0; margin-right: 14px; cursor: pointer;
}
.footer-install:hover { color: #fff; text-decoration: underline; }

.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; background: #25d366; color: #063d20;
  box-shadow: 0 16px 30px rgba(37,211,102,.35); transition: .2s;
}
.wa-float:hover { transform: translateY(-3px) scale(1.03); color: #063d20; }
.wa-float .icon { width: 29px; height: 29px; }
.mobile-cta { display: none; }

/* ---------- Публичные формы ---------- */
.public-form .field { margin-bottom: 14px; }
.public-form .btn { width: 100%; }
.form-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.form-note a { text-decoration: underline; }

/* =========================================================
   Авторизация
   ========================================================= */
.auth-page { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.auth-side {
  position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.13), transparent 30%), linear-gradient(145deg, var(--brand-dark), var(--brand) 60%, var(--brand-2));
  color: #fff;
}
.auth-side::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255,255,255,.07);
  right: -220px; bottom: -250px;
}
.auth-side .brand-name { color: #fff; }
.auth-side .brand-sub { color: #b7ddd7; }
.auth-copy { position: relative; z-index: 1; max-width: 480px; }
.auth-copy h1 { font-size: clamp(34px, 4vw, 54px); letter-spacing: -.045em; margin-bottom: 16px; }
.auth-copy p { color: #c9e8e3; font-size: 15px; max-width: 430px; }
.auth-features { display: grid; gap: 12px; margin-top: 30px; }
.auth-feature { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #d7efeb; }
.auth-feature .icon { color: #fff; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(410px, 100%); }
.auth-card h2 { font-size: 30px; margin-bottom: 7px; }
.auth-card .muted { margin-bottom: 28px; }
.auth-card .btn { width: 100%; margin-top: 8px; }
.auth-footer { margin-top: 24px; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-note { margin-top: 20px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* =========================================================
   Рабочая область
   ========================================================= */
.dash-body { background: var(--bg); min-height: 100dvh; }
.dash-shell { min-height: 100dvh; }
.sidebar {
  position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: var(--sidebar);
  background: var(--navy); color: #b9cbd5; padding: 22px 15px 18px; overflow-y: auto;
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; color: #fff; }
.sidebar-brand:hover { color: #fff; }
.sidebar-brand .brand-mark { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
.sidebar-brand .brand-name { font-size: 17px; }
.sidebar-brand .brand-sub { color: #7999a8; font-size: 9.5px; }
.sidebar-nav { display: grid; gap: 2px; }
.nav-group-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .13em; color: #6f8c9b; padding: 17px 10px 7px; font-weight: 800; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: #b9cbd5; font-size: 13px; font-weight: 650; transition: .15s;
}
.nav-link .icon { width: 18px; height: 18px; color: #7fa0af; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link:hover .icon { color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(11,107,98,.3); }
.nav-link.active .icon { color: #fff; }
.nav-badge { margin-left: auto; background: var(--amber); color: #3d2a00; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 2px 6px; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-install {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin-bottom: 10px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04);
  color: #cfe1e7; font-size: 12px; font-weight: 700; text-align: left;
}
.sidebar-install:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 800; font-size: 12px;
  flex: 0 0 auto;
}
.avatar-lg { width: 52px; height: 52px; font-size: 16px; }
.sidebar-user-name { color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.15; }
.sidebar-user-role { color: #7fa0af; font-size: 10.5px; margin-top: 3px; }
.dash-main { margin-left: var(--sidebar); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: rgba(244,248,249,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.topbar-sub { font-size: 11.5px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-date { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); }
.user-chip:hover { border-color: var(--brand); color: var(--ink); }
.user-chip .avatar { width: 30px; height: 30px; font-size: 10px; }
.user-chip-name { font-size: 12px; font-weight: 750; line-height: 1.1; }
.user-chip-role { font-size: 9.5px; color: var(--muted); }
.mobile-menu-btn { display: none; }
.page { padding: 26px 28px 42px; width: 100%; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.page-title { font-size: clamp(24px, 2.7vw, 34px); margin-bottom: 5px; letter-spacing: -.035em; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section-title-sm { font-size: 16px; margin: 0; letter-spacing: -.02em; }
.section-head-sm { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: 0 0 auto; }
.stat-icon.amber { background: var(--amber-soft); color: #9a6500; }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat-label { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.stat-meta { font-size: 10.5px; color: var(--muted); margin-top: 8px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 14px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.panel-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.panel-body { padding: 19px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 12px 19px; border-top: 1px solid var(--line); background: #fbfdfd; }
.dash-grid { display: grid; grid-template-columns: 1.55fr .95fr; gap: 18px; align-items: start; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: left; padding: 11px 12px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); background: #f8fbfb; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 800;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid #edf3f5; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfdfd; }
.data-table .main-cell { font-weight: 750; color: var(--ink); }
.data-table .sub-cell { font-size: 11px; color: var(--muted); margin-top: 2px; }
.data-table .actions-cell { white-space: nowrap; text-align: right; }
.data-table .num { white-space: nowrap; }

.row-white td:first-child { box-shadow: inset 4px 0 0 #fff; }
.row-red td { background: #fffafa; }
.row-red td:first-child { box-shadow: inset 4px 0 0 #d92d20; }
.row-blue td { background: #fbfdff; }
.row-blue td:first-child { box-shadow: inset 4px 0 0 #175cd3; }
.row-green td { background: #fbfefc; }
.row-green td:first-child { box-shadow: inset 4px 0 0 #067647; }
.row-yellow td { background: #fffdf7; }
.row-yellow td:first-child { box-shadow: inset 4px 0 0 #b54708; }
.row-orange td { background: #fffbf7; }
.row-orange td:first-child { box-shadow: inset 4px 0 0 #e04f16; }

.color-menu { position: relative; display: inline-block; }
.color-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 7px; border: 1px solid var(--line); background: #fff; }
.color-menu summary::-webkit-details-marker { display: none; }
.color-menu[open] summary { border-color: var(--brand); }
.color-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); display: inline-block; }
.color-dot.white { background: #fff; }
.color-dot.red { background: #d92d20; }
.color-dot.blue { background: #175cd3; }
.color-dot.green { background: #067647; }
.color-dot.yellow { background: #f3b23c; }
.color-dot.orange { background: #e04f16; }
.color-popover { position: absolute; z-index: 1000; left: calc(100% + 6px); top: 0; right: auto; bottom: auto; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 132px; }
.color-popover form { display: flex; flex-direction: column; gap: 2px; }
.color-option { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 7px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; }
.color-option:hover { background: var(--brand-soft); }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); padding: 0; flex: 0 0 auto; }
.swatch:hover { transform: scale(1.12); }
.swatch.white { background: #fff; }
.swatch.red { background: #d92d20; }
.swatch.blue { background: #175cd3; }
.swatch.green { background: #067647; }
.swatch.yellow { background: #f3b23c; }
.swatch.orange { background: #e04f16; }

.avatar-sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-size: 9.5px; font-weight: 800; }
.person { display: flex; align-items: center; gap: 8px; }
.person-name { font-size: 12.5px; font-weight: 700; }
.person-role { font-size: 10px; color: var(--muted); }

/* ---------- Панель фильтров и даты ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding: 13px 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 15px; }
.toolbar .spacer { flex: 1; }
.input, .select, .form-input, .form-select, .form-textarea {
  width: 100%; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; color: var(--ink); padding: 9px 11px; outline: none; font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .input:focus, .select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,107,98,.1);
}
.form-textarea { min-height: 94px; resize: vertical; }
.select, .form-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.form-checkbox { width: 18px; height: 18px; accent-color: var(--brand); vertical-align: middle; }
.form-color { width: 52px; height: 40px; padding: 3px; }
.search-wrap { position: relative; min-width: 210px; flex: 1 1 210px; }
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search-wrap .input { padding-left: 34px; }
.date-nav { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.date-tabs { display: inline-flex; background: #eef4f5; border-radius: 10px; padding: 3px; gap: 2px; }
.date-tabs a { padding: 6px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.date-tabs a:hover { color: var(--ink); }
.date-tabs a.active { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow-sm); }
.date-input { width: 145px; min-height: 38px; }
.date-arrow { width: 38px; height: 38px; padding: 0; }
.date-label { font-size: 14px; font-weight: 800; padding: 0 6px; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }
.stat-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.stat-chip strong { color: var(--ink); }

/* ---------- Загрузка / capacity ---------- */
.capacity-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.capacity-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; font-weight: 700; }
.capacity-chip .cap-count { color: var(--ink); }
.capacity-chip .cap-label { font-weight: 600; color: var(--muted); }
.capacity-chip.red { background: var(--danger-soft); border-color: #f3c0bb; color: #a5251a; }
.capacity-chip.orange { background: var(--orange-soft); border-color: #f6cdb8; color: #9f3d11; }
.capacity-chip.green { background: var(--success-soft); border-color: #bfe6cd; color: #06603a; }
.capacity-chip.grey { background: #f4f7f8; color: var(--muted); }
.capacity-chip.red .cap-count, .capacity-chip.orange .cap-count, .capacity-chip.green .cap-count { color: inherit; }
.capacity-chip.red .cap-label, .capacity-chip.orange .cap-label, .capacity-chip.green .cap-label { color: inherit; opacity: .75; }
.cap-widget { margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #f8fbfb; display: none; }
.cap-widget.visible { display: block; }
.cap-widget.red { background: var(--danger-soft); border-color: #f3c0bb; color: #9f1e15; }
.cap-widget.orange { background: var(--orange-soft); border-color: #f6cdb8; color: #9f3d11; }
.cap-widget.green { background: var(--success-soft); border-color: #bfe6cd; color: #06603a; }
.cap-widget.grey { background: #f4f7f8; color: var(--muted); }
.cap-widget strong { font-size: 12.5px; }
.cap-widget .tiny { opacity: .8; }
.progress { height: 5px; border-radius: 999px; background: rgba(16,39,51,.1); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; border-radius: inherit; background: currentColor; }

/* ---------- Календарь ---------- */
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); gap: 18px; align-items: start; }
.calendar-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.calendar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.calendar-month { font-size: 17px; font-weight: 800; letter-spacing: -.02em; text-transform: capitalize; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); background: #fbfdfd; font-size: 10.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.row-color-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 9px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 11px; color: var(--muted); }
.selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.selection-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--ink); cursor: pointer; }
.selection-bar .selected-count { font-size: 12px; color: var(--muted); }
.selection-bar .selected-count strong { color: var(--ink); }
.selection-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.selection-actions + .selection-actions { margin-left: 0; }
.selection-actions [data-selection-hidden] { display: none; }
.order-select { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
.select-cell { text-align: center; vertical-align: middle !important; }
.selection-bar .btn[disabled] { opacity: .45; cursor: not-allowed; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-dot.red { background: #d92d20; }
.legend-dot.orange { background: #e04f16; }
.legend-dot.green { background: #067647; }
.legend-dot.grey { background: #94a3b8; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head { padding: 8px 4px; text-align: center; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; background: #fbfdfd; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 92px; padding: 7px; border-right: 1px solid #edf3f5; border-bottom: 1px solid #edf3f5; position: relative; color: var(--ink); display: block; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { color: var(--ink); }
.cal-day.empty { background: #fbfdfd; pointer-events: none; }
.cal-day.today { box-shadow: inset 0 0 0 2px rgba(11,107,98,.35); }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-day-num { font-size: 12px; font-weight: 800; margin-bottom: 6px; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .cal-day-num { background: var(--brand); color: #fff; }
.cal-day-meta { display: grid; gap: 3px; }
.cal-count { font-size: 11px; font-weight: 800; }
.cal-sub { font-size: 9.5px; color: var(--muted); }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 3px; }
.cal-day.level-red { background: linear-gradient(180deg, #fff5f4, #fff); }
.cal-day.level-red .cal-count { color: #b42318; }
.cal-day.level-orange { background: linear-gradient(180deg, #fff8f2, #fff); }
.cal-day.level-orange .cal-count { color: #b54708; }
.cal-day.level-green { background: linear-gradient(180deg, #f5fdf8, #fff); }
.cal-day.level-green .cal-count { color: var(--success); }
.cal-day.level-grey { background: #fff; }
.cal-day.level-grey .cal-count { color: var(--muted); }
.cal-day-badge { position: absolute; right: 6px; bottom: 6px; font-size: 8.5px; font-weight: 800; padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.8); color: var(--muted); }
.calendar-side { display: grid; gap: 15px; }
.day-detail-title { font-size: 15px; font-weight: 800; margin: 0 0 2px; }
.day-detail-sub { font-size: 11px; color: var(--muted); }
.cap-row { padding: 11px 0; border-bottom: 1px solid #edf3f5; }
.cap-row:last-child { border-bottom: 0; }
.cap-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.cap-row-name { font-weight: 700; display: flex; align-items: center; gap: 7px; }
.cap-row-value { font-weight: 800; }
.cap-row.red .cap-row-value { color: var(--danger); }
.cap-row.orange .cap-row-value { color: var(--orange); }
.cap-row.green .cap-row-value { color: var(--success); }
.cap-row.grey .cap-row-value { color: var(--muted); }
.cap-row .progress { color: inherit; }
.cap-row.red .progress { color: var(--danger); }
.cap-row.orange .progress { color: var(--orange); }
.cap-row.green .progress { color: var(--success); }
.order-mini { display: flex; align-items: flex-start; gap: 9px; padding: 10px 0; border-bottom: 1px solid #edf3f5; color: var(--ink); }
.order-mini:last-child { border-bottom: 0; }
.order-mini:hover { color: var(--brand); }
.order-mini .color-dot { margin-top: 5px; }
.order-mini-main { flex: 1; min-width: 0; }
.order-mini-title { font-size: 11.5px; font-weight: 750; }
.order-mini-sub { font-size: 10px; color: var(--muted); }

/* ---------- Карточки заявок на мобильном ---------- */
.order-cards { display: none; gap: 10px; }
.order-card {
  position: relative; display: block; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 14px 14px 18px; color: var(--ink); overflow: hidden;
}
.order-card:hover { color: var(--ink); border-color: #b8ddd7; }
.order-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #fff; }
.order-card.row-red::before { background: #d92d20; }
.order-card.row-blue::before { background: #175cd3; }
.order-card.row-green::before { background: #067647; }
.order-card.row-yellow::before { background: #f3b23c; }
.order-card.row-orange::before { background: #e04f16; }
.order-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.order-card-number { font-size: 10.5px; color: var(--muted); font-weight: 800; letter-spacing: .04em; }
.order-card-title { font-size: 14.5px; font-weight: 800; margin: 3px 0 4px; letter-spacing: -.02em; }
.order-card-meta { display: flex; flex-wrap: wrap; gap: 5px 11px; font-size: 11px; color: var(--muted); }
.order-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.order-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf3f5; }
.order-card-amount { font-size: 12.5px; font-weight: 800; }
.order-card-link { display: block; color: inherit; }
.order-card-link:hover { color: var(--ink); }
.order-card-select { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 10.5px; font-weight: 700; color: var(--muted); cursor: pointer; }

/* ---------- Маршрут заявок ---------- */
.route-root { display: grid; gap: 12px; }
.route-status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.route-status { font-size: 12px; font-weight: 700; color: var(--muted); }
.route-status.ok { color: var(--success); }
.route-status.error { color: var(--danger); }
.route-list { display: grid; gap: 10px; }
.route-card {
  padding: 0; overflow: hidden; cursor: default; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: pan-y;
}
.route-card .order-card-body { touch-action: pan-y; }
.route-drag-handle {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 32px; height: 32px; margin-right: 1px; border-radius: 9px;
  background: rgba(11, 107, 98, .05);
  box-shadow: inset 0 0 0 1px rgba(11, 107, 98, .08);
  color: #6f8b96; cursor: grab; touch-action: none;
  -webkit-touch-callout: none; user-select: none;
  transition: background-color .15s ease, color .15s ease;
}
.route-drag-handle .icon { width: 16px; height: 20px; }
.route-drag-handle:hover,
.route-drag-handle:focus-visible {
  background: var(--brand-soft); color: var(--brand);
}
.route-drag-handle:active {
  cursor: grabbing; background: var(--brand-soft); color: var(--brand);
}
.route-card.route-chosen { border-color: var(--brand); box-shadow: 0 12px 30px rgba(11,107,98,.16); }
.route-card-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: #f5faf9; border-bottom: 1px solid var(--line);
}
.route-position {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800;
  flex: 0 0 auto;
}
.route-card-client { flex: 1; min-width: 0; font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
.route-card-client:hover { color: var(--brand); }
.route-card .order-card-body { position: relative; padding: 14px 16px 12px; }
.order-card-stretch { display: block; color: inherit; }
.order-card-stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.order-card-body .order-card-meta a { position: relative; z-index: 2; }
.route-ghost { opacity: .35; }
.route-card .order-card-meta a { color: var(--brand); }
.route-group { display: grid; gap: 10px; }
.route-group + .route-group { margin-top: 6px; }
.route-group-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 4px 2px; font-size: 13px;
}
.route-group-head strong { letter-spacing: -.01em; }
@media (max-width: 760px) {
  .route-drag-handle { width: 40px; height: 40px; }
}

/* ---------- Карточка заявки ---------- */
.order-screen { display: grid; gap: 16px; }
.order-hero { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.order-hero-top { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.order-number { font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .06em; }
.order-client { font-size: clamp(22px, 3vw, 32px); letter-spacing: -.04em; margin: 4px 0 8px; }
.order-hero-meta { display: flex; flex-wrap: wrap; gap: 9px 16px; font-size: 12px; color: var(--muted); }
.order-hero-meta a { color: var(--ink-soft); font-weight: 650; }
.order-hero-meta a:hover { color: var(--brand); }
.order-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; }
.info-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 14px; }
.kv { display: grid; gap: 10px; }
.kv-row { display: flex; justify-content: space-between; gap: 15px; font-size: 12.5px; padding-bottom: 9px; border-bottom: 1px solid #f0f5f6; }
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-label { color: var(--muted); }
.kv-value { font-weight: 700; text-align: right; }
.kv-value a { color: var(--brand); }
.comment-box { font-size: 12.5px; color: var(--ink-soft); white-space: pre-line; }
.history-list { display: grid; gap: 0; }
.history-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f5f6; font-size: 11.5px; }
.history-item:last-child { border-bottom: 0; }
.history-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); margin-top: 6px; flex: 0 0 auto; }
.history-time { color: var(--muted); font-size: 10px; margin-top: 2px; }
.verification-mini { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf3f5; font-size: 12px; }
.verification-mini:last-child { border-bottom: 0; }
.verification-mini-main { min-width: 0; }
.verification-mini-title { font-weight: 750; }
.verification-mini-sub { font-size: 10.5px; color: var(--muted); }

/* ---------- Клиенты ---------- */
.client-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.client-hero-main { display: flex; gap: 15px; align-items: flex-start; }
.client-hero h1 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 5px; }
.client-hero .muted { font-size: 12.5px; }
.client-contact-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; font-size: 12px; }
.client-contact-row a { color: var(--ink-soft); font-weight: 650; }
.client-contact-row a:hover { color: var(--brand); }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 18px 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: 3px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-2); }
.timeline-item.kind-verification .timeline-dot { border-color: var(--amber); }
.timeline-date { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.timeline-title { font-size: 13px; font-weight: 750; margin: 2px 0; }
.timeline-title a { color: var(--ink); }
.timeline-title a:hover { color: var(--brand); }
.timeline-sub { font-size: 11px; color: var(--muted); }

/* ---------- Фильтры отчёта ---------- */
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.report-card .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.report-card .value { font-size: 26px; font-weight: 800; letter-spacing: -.04em; margin-top: 6px; }
.report-card.cash { border-top: 3px solid var(--success); }
.report-card.cashless { border-top: 3px solid var(--blue); }
.report-card.total { border-top: 3px solid var(--brand); }
.report-card.count { border-top: 3px solid var(--amber); }
.report-summary-dynamic { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.report-index-groups { display: grid; gap: 22px; }
.report-index-group { display: grid; gap: 11px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 11px; }
.report-tile {
  display: flex; flex-direction: column; gap: 7px; padding: 15px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.report-tile:hover {
  color: var(--ink); border-color: #a9d6cf; box-shadow: 0 8px 22px rgba(15, 52, 62, .08);
  transform: translateY(-1px);
}
.report-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.report-tile-title { font-size: 13.5px; font-weight: 800; letter-spacing: -.02em; }
.report-tile-desc { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.report-filters { align-items: flex-end; }
.filter-field { display: grid; gap: 5px; min-width: 0; }
.filter-field .input, .filter-field .select { width: 100%; min-width: 0; }
.filter-field-wide { min-width: 180px; }
.filter-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* ---------- Формы ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; color: var(--ink-soft); margin-bottom: 6px; }
.field > label .req { color: var(--danger); }
.field .help { font-size: 10.5px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.field .error { font-size: 10.5px; color: var(--danger); margin-top: 5px; font-weight: 650; }
.field.has-error .form-input, .field.has-error .form-select, .field.has-error .form-textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217,45,32,.07); }
.field-check { display: flex; align-items: flex-start; gap: 8px; }
.field-check label { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.form-actions .spacer { flex: 1; }
.form-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; margin: 24px 0 12px; }
.form-section-title:first-child { margin-top: 0; }
.form-two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .8fr); gap: 18px; align-items: start; }
.form-two-col .panel { overflow: visible; }
.form-side { display: grid; gap: 15px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; font-weight: 650; cursor: pointer; background: #fff; }
.radio-row input { accent-color: var(--brand); }
.radio-row label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.form-hint-box { padding: 11px 13px; background: var(--brand-soft); border: 1px solid #c4e7e1; border-radius: 10px; font-size: 11.5px; color: var(--brand-dark); }
.form-hint-box.warn { background: var(--amber-soft); border-color: #f1d494; color: #714800; }
.client-picker-note { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.ghost-date { margin-top: 8px; padding: 9px 11px; border: 1px dashed #b9d7d2; border-radius: 9px; background: #f8fcfb; font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ghost-date strong { color: var(--brand-dark); opacity: .55; font-weight: 700; }
.ghost-date .btn { min-height: 29px; padding: 4px 8px; font-size: 10.5px; }
.next-date-block .form-checkbox { margin-top: 9px; }

/* ---------- Справочники ---------- */
.dir-list { display: grid; gap: 0; }
.dir-item { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid #edf3f5; }
.dir-item:last-child { border-bottom: 0; }
.dir-item:hover { background: #fbfdfd; }
.dir-main { flex: 1; min-width: 0; }
.dir-title { font-size: 13px; font-weight: 750; }
.dir-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dir-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.color-square { width: 13px; height: 13px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }

/* ---------- Прочее ---------- */
.empty-state { padding: 42px 22px; text-align: center; color: var(--muted); }
.empty-state .icon { width: 35px; height: 35px; color: #a9bdc7; margin-bottom: 11px; }
.empty-state h3 { font-size: 15px; color: var(--ink); margin-bottom: 5px; }
.empty-state p { font-size: 12px; margin: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 16px; flex-wrap: wrap; }
.pagination-top {
  position: sticky; top: var(--topbar); z-index: 30;
  padding: 10px 16px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(16, 39, 51, .08);
}
.pagination a, .pagination span { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { opacity: .4; pointer-events: none; }
.pagination .pagination-total { min-width: 0; padding: 0 4px; border: 0; background: transparent; }
.alert-inline { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; background: var(--amber-soft); border: 1px solid #f1d494; font-size: 11.5px; color: #714800; }
.alert-inline.danger { background: var(--danger-soft); border-color: #f3c0bb; color: #9f1e15; }
.alert-inline.info { background: var(--blue-soft); border-color: #bfd8f5; color: #154c9c; }
.alert-inline.success { background: var(--success-soft); border-color: #bfe6cd; color: #06603a; }
.notice-list { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.notice-list li { margin-bottom: 5px; }
.settings-section { margin-bottom: 22px; }
.settings-section h3 { font-size: 13px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.settings-section h3 .icon { color: var(--brand); }
.logo-preview { width: 74px; height: 74px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; margin-top: 8px; }
.code-textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.55; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.link-muted { color: var(--muted); }
.link-muted:hover { color: var(--brand); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-action { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.quick-action:hover { border-color: var(--brand); color: var(--brand); background: #fbfdfd; }
.quick-action .icon { color: var(--brand); }
.only-mobile { display: none; }

/* ---------- Модальные окна ---------- */
dialog.modal {
  width: min(560px, calc(100% - 30px)); border: 0; border-radius: 20px; padding: 0;
  box-shadow: var(--shadow-lg); background: #fff; color: var(--ink);
}
dialog.modal::backdrop { background: rgba(8, 30, 40, .5); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 18px; font-weight: 800; margin: 0; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--line); background: #fbfdfd; }
.modal-close { border: 0; background: transparent; color: var(--muted); padding: 5px; border-radius: 7px; }
.modal-close:hover { background: #f1f5f6; color: var(--ink); }

/* ---------- Печать ---------- */
.print-body { background: #eef3f5; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; justify-content: center; align-items: center; padding: 12px; background: #fff; border-bottom: 1px solid var(--line); }
.print-page { width: 210mm; min-height: 297mm; margin: 18px auto; background: #fff; padding: 14mm 13mm; box-shadow: var(--shadow); }
.protocol { font-family: "Times New Roman", Times, serif; color: #111; font-size: 11pt; line-height: 1.45; }
.protocol-head { display: flex; justify-content: space-between; gap: 18px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 22px; }
.protocol-brand { display: flex; gap: 10px; align-items: center; }
.protocol-logo { width: 47px; height: 47px; border-radius: 10px; background: #0b6b62; color: #fff; display: flex; align-items: center; justify-content: center; font: 800 22px Arial, sans-serif; }
.protocol-company { font-size: 14pt; font-weight: 700; }
.protocol-muted { font-size: 8.5pt; color: #555; }
.protocol-contacts { text-align: right; font-size: 8.5pt; color: #333; line-height: 1.5; }
.protocol-title { text-align: center; margin: 18px 0 22px; }
.protocol-title-main { font-size: 17pt; font-weight: 700; letter-spacing: .06em; }
.protocol-title-number { font-size: 11pt; margin-top: 5px; }
.protocol-title-date { font-size: 10pt; }
.protocol-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.protocol-table th, .protocol-table td { border: 1px solid #333; padding: 6px 8px; vertical-align: top; font-size: 10pt; }
.protocol-table th { width: 34%; text-align: left; background: #f3f5f5; font-weight: 600; }
.protocol-result { display: flex; align-items: center; gap: 15px; margin: 16px 0; padding: 10px 14px; border: 1px solid #333; font-size: 11pt; }
.protocol-result-value { font-weight: 700; text-transform: uppercase; }
.protocol-comment { margin: 12px 0; padding: 8px 10px; border-left: 3px solid #0b6b62; background: #f7fbfa; font-size: 9.5pt; }
.protocol-note { font-size: 9pt; color: #333; margin: 14px 0 30px; text-align: justify; }
.protocol-signatures { width: 100%; border-collapse: collapse; margin-top: 28px; }
.protocol-signatures td { width: 50%; padding: 0 18px; vertical-align: bottom; }
.protocol-signature-line { border-bottom: 1px solid #333; height: 28px; margin-bottom: 4px; }
.protocol-footer { margin-top: 32px; padding-top: 8px; border-top: 1px solid #999; font-size: 7.5pt; color: #555; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; }
.print-only { display: none; }

/* Уведомления */
.notification-bell { position: relative; }
.notification-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.notification-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.notifications-list { display: grid; gap: 10px; }
.notification-item { display: flex; gap: 13px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; position: relative; }
.notification-item.unread { border-color: #b9e3dc; background: #fbfffe; }
.notification-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); flex: 0 0 auto; }
.notification-icon.capacity { background: var(--danger-soft); color: var(--danger); }
.notification-icon.website_request { background: var(--amber-soft); color: #8a5a00; }
.notification-icon.verification_due { background: var(--blue-soft); color: var(--blue); }
.notification-icon.office_due { background: var(--brand-soft); color: var(--brand-dark); }
.notification-icon .icon { width: 18px; height: 18px; }
.notification-body { flex: 1; min-width: 0; }
.notification-title { border: 0; background: none; padding: 0; font: inherit; font-weight: 750; color: var(--ink); text-align: left; cursor: pointer; }
.notification-title:hover { color: var(--brand); }
.notification-text { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.notification-meta { font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); position: absolute; top: 16px; right: 16px; }
.notification-permission { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 1240px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-side { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 1080px) {
  .site-nav { display: none; }
  .mobile-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
  .site-header-inner { gap: 12px; }
  .header-phone { display: none; }
  .site-header-inner .header-actions { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { min-height: 380px; order: -1; }
  .hero-visual img { width: min(370px, 85%); }
  .hero { padding-top: 42px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; gap: 28px; }
  .step::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .dash-main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
  .mobile-menu-btn .icon { width: 18px; height: 18px; }
  .dash-grid, .dash-grid-2, .form-two-col { grid-template-columns: 1fr; }
  .topbar { padding: 0 18px; }
  .page { padding: 20px 18px 90px; }
  .only-mobile { display: initial; }
  .desktop-only { display: none !important; }
  .mobile-bottom-nav {
    display: flex; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .mobile-nav-link { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 54px; padding: 5px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-family: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
  .mobile-nav-link .icon { width: 20px; height: 20px; }
  .mobile-nav-link.active { color: var(--brand); background: var(--brand-soft); }
  body.is-fullscreen .mobile-bottom-nav,
  body.is-fullscreen .mobile-cta { display: none !important; }
  body.is-fullscreen .page { padding-bottom: 20px; }
  .orders-table { display: none; }
  .order-cards { display: grid; }
  .order-screen { margin: -20px -18px 0; gap: 0; min-height: calc(100dvh - var(--topbar)); }
  .order-hero { border-radius: 0; border-left: 0; border-right: 0; border-top: 0; padding: 18px; }
  .order-screen .info-grid { grid-template-columns: 1fr; gap: 0; }
  .order-screen .info-card { border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }
  .order-actions { position: sticky; bottom: 64px; z-index: 20; background: #fff; padding: 10px; margin: 12px -18px -18px; border-top: 1px solid var(--line); }
  .order-actions .btn { flex: 1 1 40%; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 30px); }
  .site-header-inner { min-height: 66px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }
  .brand-name { font-size: 16px; }
  .brand-sub { font-size: 8.5px; }
  .header-actions .btn-whatsapp { display: none; }
  .header-login span { display: none; }
  .header-install span { display: none; }
  .hero { padding: 34px 0 44px; }
  .hero h1 { font-size: 34px; }
  .hero-sub { font-size: 14.5px; }
  .hero-trust { gap: 11px; }
  .trust-item { font-size: 11px; }
  .section { padding: 52px 0; }
  .section-head { display: block; margin-bottom: 24px; }
  .section-head .btn { margin-top: 14px; }
  .services-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .news-grid { grid-template-columns: 1fr; gap: 14px; }
  .news-card-body { padding: 16px; }
  .service-card { min-height: 205px; padding: 16px; }
  .service-card h3 { font-size: 14.5px; }
  .service-card p { font-size: 11.5px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .stats-band { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-box { padding: 17px; }
  .stat-box strong { font-size: 27px; }
  .review-band { grid-template-columns: 1fr; padding: 22px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .contact-panel, .form-card { padding: 22px; }
  .map-panel { min-height: 300px; }
  .cta-band { display: block; padding: 28px 22px; }
  .cta-actions { margin-top: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
  .footer-bottom { display: block; }
  .footer-bottom div + div { margin-top: 8px; }
  .wa-float { bottom: 78px; width: 52px; height: 52px; }
  .mobile-cta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .mobile-cta .btn { min-height: 43px; font-size: 12.5px; }
  .public-body { padding-bottom: 68px; }
  .auth-form-wrap { padding: 24px 18px; }
  .auth-card h2 { font-size: 26px; }
  .topbar { height: 64px; padding: 0 13px; gap: 9px; }
  .topbar-date { display: none; }
  .topbar-title { font-size: 13px; }
  .topbar-sub { display: none; }
  .user-chip-name, .user-chip-role { display: none; }
  .user-chip { padding: 4px; border: 0; background: transparent; }
  .page { padding: 16px 13px 88px; }
  .page-head { display: block; }
  .page-actions { margin-top: 13px; }
  .page-title { font-size: 25px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 13px; gap: 9px; border-radius: 12px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 9px; }
  .stat-icon .icon { width: 18px; height: 18px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 9.5px; }
  .stat-meta { display: none; }
  .panel-head { padding: 13px 14px; }
  .panel-body { padding: 14px; }
  .toolbar { padding: 10px; gap: 7px; }
  .toolbar .search-wrap { flex-basis: 100%; }
  .toolbar .select, .toolbar .input { font-size: 12px; min-height: 37px; }
  .date-nav { width: 100%; gap: 5px; }
  .date-label { font-size: 12.5px; flex: 1; text-align: center; }
  .date-tabs { width: 100%; justify-content: space-between; }
  .date-tabs a { flex: 1; text-align: center; }
  .date-input { width: 128px; }
  .date-arrow { width: 35px; height: 35px; }
  .stat-chips { gap: 5px; }
  .stat-chip { font-size: 10px; padding: 5px 8px; }
  .capacity-strip { gap: 5px; }
  .capacity-chip { font-size: 10px; padding: 5px 7px; }
  .calendar-top { padding: 12px; }
  .calendar-legend { padding: 8px 12px; gap: 8px; font-size: 9px; }
  .cal-day { min-height: 68px; padding: 4px; }
  .cal-day-num { font-size: 10px; width: 20px; height: 20px; margin-bottom: 3px; }
  .cal-count { font-size: 9.5px; }
  .cal-sub { font-size: 8px; }
  .cal-day-badge { display: none; }
  .calendar-side { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .report-card { padding: 13px; }
  .report-card .value { font-size: 20px; }
  .form-row-2, .form-row-3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .info-grid { grid-template-columns: 1fr; }
  .client-hero { padding: 16px; }
  .client-hero-main { display: block; }
  .order-hero-top { display: block; }
  .order-actions { bottom: 58px; }
  .order-actions .btn { font-size: 11.5px; padding: 8px 9px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 15px; padding-right: 15px; }
  dialog.modal { width: calc(100% - 16px); max-height: 92dvh; overflow: auto; }
  .data-table.desktop-table { display: none; }
  .form-two-col { gap: 0; }
  .form-actions { position: sticky; bottom: 58px; z-index: 15; background: #fff; margin: 18px -13px -16px; padding: 10px 13px; }
}
@media (max-width: 460px) {
  .services-grid { grid-template-columns: 1fr; }
  .service-card { min-height: auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid .stat-card:last-child { grid-column: span 2; }
  .hero h1 { font-size: 30px; }
  .hero-actions .btn { width: 100%; }
  .header-actions .header-login { padding: 8px; }
  .cal-day { min-height: 58px; }
  .cal-sub { display: none; }
  .report-summary { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
}

/* ---------- Печать ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-head, .print-toolbar, .mobile-bottom-nav, .wa-float, .mobile-cta,
  .site-header, .site-footer, .no-print { display: none !important; }
  .dash-main { margin: 0; }
  .page { padding: 0; max-width: none; }
  .print-page { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .print-only { display: block; }
  .panel, .data-table, .order-hero, .info-card { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
  @page { size: A4; margin: 12mm; }
  .protocol { font-size: 10.5pt; }
  .print-page .protocol { page-break-after: avoid; }
}

/* ---------- Карточки заявок 7×7 см ---------- */
.cards-page { width: 210mm; min-height: 297mm; box-sizing: border-box; margin: 18px auto; background: #fff; padding: 6mm; box-shadow: var(--shadow); }
.cards-grid { display: grid; grid-template-columns: repeat(2, 70mm); gap: 5mm; justify-content: center; align-content: start; }
.order-card-print {
  width: 70mm; height: 70mm; box-sizing: border-box; display: flex; flex-direction: column; gap: 1.1mm;
  padding: 3mm; border: 1px solid #333; background: #fff; color: #111; overflow: hidden;
  font-size: 8pt; line-height: 1.25; break-inside: avoid; page-break-inside: avoid;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.order-card-print.row-white { border-top: 3px solid #94a3b8; }
.order-card-print.row-red { border-top: 3px solid #d92d20; }
.order-card-print.row-blue { border-top: 3px solid #175cd3; }
.order-card-print.row-green { border-top: 3px solid #067647; }
.order-card-print.row-yellow { border-top: 3px solid #f3b23c; }
.order-card-print.row-orange { border-top: 3px solid #e04f16; }
.order-card-print-head { display: flex; justify-content: space-between; gap: 2mm; padding-bottom: 1mm; border-bottom: 1px solid #999; }
.order-card-print-number { font-size: 9pt; font-weight: 800; }
.order-card-print-date { font-size: 7.5pt; color: #333; white-space: nowrap; }
.order-card-print-client { font-size: 9.5pt; font-weight: 800; line-height: 1.15; }
.order-card-print-line { display: flex; align-items: baseline; gap: 1.5mm; }
.order-card-print-label { flex: 0 0 17mm; color: #555; font-size: 6.8pt; letter-spacing: .02em; text-transform: uppercase; }
.order-card-print-value { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.order-card-print-foot { display: flex; justify-content: space-between; gap: 2mm; margin-top: auto; padding-top: 1mm; border-top: 1px solid #ccc; font-size: 7.5pt; font-weight: 700; }

@media print {
  @page { size: A4 portrait; margin: 6mm; }
  .print-body { background: #fff; }
  .cards-page { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .cards-page:last-of-type { break-after: auto; page-break-after: auto; }
  .order-card-print { break-inside: avoid; page-break-inside: avoid; }
}

/* ---------- Протоколы поверки: A4 ---------- */
.badge-warning { background: #fff3d6; color: #8a5a00; }

.detail-list { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.2fr); gap: 8px 14px; margin: 0; font-size: 12px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.checkbox-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checkbox-list > div { display: flex; }
.checkbox-list label { display: flex; gap: 6px; align-items: flex-start; font-weight: 400; }
.checkbox-list input { margin-top: 2px; }

.radio-row { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.radio-row > div { display: flex; }
.radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 400; }

.protocol-sheet {
  width: 210mm;
  min-height: 297mm;
  box-sizing: border-box;
  margin: 18px auto;
  background: #fff;
  padding: 11mm 12mm;
  box-shadow: var(--shadow);
  font-family: "Times New Roman", Times, serif;
  color: #111;
  font-size: 11pt;
  line-height: 1.38;
}
.protocol-sheet + .protocol-sheet { margin-top: 12px; }

.protocol-first-page { font-size: 11pt; }
.protocol-doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1.5px solid #111; padding-bottom: 8px; margin-bottom: 12px; }
.protocol-doc-company { font-size: 9.5pt; line-height: 1.3; }
.protocol-doc-company-name { font-weight: 700; font-size: 11pt; }
.protocol-doc-accred { text-align: right; font-size: 8.5pt; line-height: 1.3; max-width: 72mm; }
.protocol-doc-title { text-align: center; font-weight: 700; font-size: 14pt; margin: 12px 0 6px; }
.protocol-doc-date { text-align: center; margin-bottom: 14px; }
.protocol-doc-body p { margin: 0 0 5px; text-align: justify; }
.protocol-label { font-weight: 700; }
.protocol-section-label { font-weight: 700; margin-top: 8px; }
.protocol-list { margin: 0 0 8px 14px; }
.protocol-list div { margin-bottom: 2px; }
.protocol-conditions { margin: 8px 0; }
.protocol-conclusion { font-size: 12pt; margin-top: 10px; }
.protocol-doc-signature { margin-top: 28px; font-size: 10pt; line-height: 1.8; }
.protocol-signature-line { margin-top: 18px; }

.protocol-second-page { font-size: 7.5pt; line-height: 1.2; padding: 8mm; }
.protocol-second-title { text-align: center; font-weight: 700; font-size: 11pt; }
.protocol-second-subtitle { text-align: center; font-weight: 700; font-size: 9pt; margin-bottom: 6px; }
.protocol-meta-table { width: 100%; border-collapse: collapse; margin-bottom: 5px; font-size: 7.5pt; }
.protocol-meta-table td { border: 1px solid #444; padding: 2px 3px; vertical-align: top; }
.protocol-meta-table td:nth-child(odd) { font-weight: 700; background: #f3f3f3; width: 18%; }
.protocol-compact-table { width: 100%; border-collapse: collapse; margin: 4px 0 7px; font-size: 7pt; }
.protocol-compact-table th, .protocol-compact-table td { border: 1px solid #444; padding: 1.5px 3px; vertical-align: middle; }
.protocol-compact-table th { background: #eee; text-align: center; font-weight: 700; }
.protocol-compact-table td.protocol-cell-label { text-align: center; font-weight: 700; width: 10%; }
.protocol-compact-table td.protocol-cell-range { text-align: center; }
.protocol-compact-table td.protocol-cell-value { text-align: center; }
.protocol-out td { background: #ffe8e5; color: #9f1e15; }
.protocol-warning { border: 1px solid #c00; background: #fff0ee; color: #9f1e15; padding: 3px 5px; margin: 4px 0; font-size: 7.5pt; }
.protocol-second-result { margin-top: 8px; font-size: 8pt; line-height: 1.5; }
.protocol-ts-section { font-weight: 700; margin: 7px 0 2px; font-size: 8pt; }
.protocol-ts-page .protocol-compact-table { font-size: 6.8pt; }

.protocol-manual-image-wrap { text-align: center; }
.protocol-manual-image { max-width: 100%; max-height: 245mm; object-fit: contain; }
.protocol-manual-frame { width: 100%; height: 245mm; border: 0; }
.protocol-manual-html { overflow: hidden; }
.protocol-excel-table { width: 100%; border-collapse: collapse; font-size: 6.5pt; }
.protocol-excel-table td { border: 1px solid #777; padding: 1px 2px; }
.protocol-manual-foot { margin-top: 4px; font-size: 7pt; color: #555; }
.protocol-empty-second { padding: 20mm 10mm; text-align: center; font-size: 11pt; }
.protocol-page-break { break-after: page; }

/* ---------- Первый лист по shablon/shablon.xlsx ---------- */
/* Сетка листа 100 %: A/B — 36 pt, C — 48 pt, D–K — по 42 pt (456 pt = 160,87 мм).
   Высоты строк повторяют Excel: 15 / 7,2 / 9 / 14,4 / 13,2 pt и т.д.
   Поля страницы — как в шаблоне: 19,05 мм сверху/снизу, 17,78 мм по бокам. */
.protocol-title-page {
  padding: 19.05mm 17.78mm;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  line-height: 1.2;
  color: #000;
}
.tp-grid {
  width: 456pt;
  border-collapse: collapse;
  table-layout: fixed;
}
.tp-grid col.tp-col-ab { width: 36pt; }
.tp-grid col.tp-col-c { width: 48pt; }
.tp-grid col.tp-col-dk { width: 42pt; }
.tp-grid td {
  height: 15pt;
  padding: 0 0.8mm;
  vertical-align: middle;
}
.tp-grid tr.tp-r14 > td { height: 14.4pt; }
.tp-grid tr.tp-r156 > td { height: 15.6pt; }
.tp-grid tr.tp-header-block > td { height: 87.6pt; padding: 0; }
.tp-grid tr.tp-block-docs > td { height: 30pt; }
.tp-grid tr.tp-block-si > td { height: 103.2pt; }

.tp-protocol-number,
.tp-protocol-date { font-size: 11pt; }
.tp-title { font-size: 10pt; font-weight: 700; text-align: center; }
.tp-title-number { font-size: 10pt; font-weight: 700; }
.tp-label { font-size: 12pt; font-weight: 700; white-space: nowrap; }
.tp-item { font-size: 12pt; white-space: nowrap; }
.tp-value { font-size: 11pt; overflow-wrap: anywhere; }
/* «Изготовитель:» (12 pt bold) шире ячейки A13:B13 — значение сдвинуто вправо */
.tp-grid td.tp-value-indent { padding-left: 4.2mm; }
.tp-grid td.tp-value-indent-sm { padding-left: 1.6mm; }
.tp-block { white-space: pre-line; }
.tp-grid td.tp-block { vertical-align: top; }
.tp-page-number { font-size: 11pt; }

/* Шапка: A2:B8 — 25,40 мм, C2:H8 — 91,03 мм, I2:K8 — 44,46 мм; высота 87,6 pt.
   Рамка нарисована тенью, чтобы не «съедать» размеры ячеек. */
.tp-header {
  width: 100%;
  box-shadow: 0 0 0 1.5pt #000;
  border-collapse: collapse;
  table-layout: fixed;
}
.tp-header col.tp-col-logo { width: 25.4mm; }
.tp-header col.tp-col-company { width: 91.03mm; }
.tp-header col.tp-col-address { width: 44.46mm; }
.tp-header td { height: auto; padding: 0; vertical-align: middle; }
.tp-header tr.tp-h-name td { height: 16.2pt; }
.tp-header tr.tp-h-lab td { height: 71pt; }
.tp-header .tp-logo { border-right: 1.5pt solid #000; vertical-align: top; }
.tp-header .tp-company-name { border-right: 1.5pt solid #000; border-bottom: 1.5pt solid #000; }
.tp-header .tp-lab { border-right: 1.5pt solid #000; }
/* «Рисунок 1» — 24,7 × 30,1 мм, прижат к левому верхнему углу ячейки */
.tp-logo img {
  display: block;
  width: 24.7mm;
  height: 30.1mm;
  margin: 0.39mm 0 0 0.35mm;
}
.tp-company-name { font-size: 14pt; line-height: 1.15; text-align: center; }
.tp-lab { font-size: 12pt; text-align: center; line-height: 1.25; }
.tp-address {
  padding: 0 0.8mm;
  font-size: 11pt;
  line-height: 1.25;
  text-align: center;
  vertical-align: top;
}

/* ---------- Второй лист ТС: сетка по шаблону ---------- */
.protocol-ts-page {
  width: 210mm;
  min-height: 297mm;
  padding: 0;
  position: relative;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
}
.ts2-sheet {
  position: absolute;
  left: 17.8mm;
  top: 19.05mm;
  width: 635.77pt;
  transform: scale(0.8);
  transform-origin: top left;
}
.ts2-grid {
  width: 635.77pt;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Times New Roman", Times, serif;
  font-size: 10pt;
  line-height: 1.0;
  color: #000;
}
.ts2-grid tr { height: 13.2pt; }
.ts2-grid td {
  padding: 0;
  border: 0;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}
.ts2-grid td.b { border: 0.5pt solid #000; }
.ts2-grid .center { text-align: center; }
.ts2-grid .vcenter { vertical-align: middle; }
.ts2-grid .strong { font-weight: 700; }
.ts2-grid .big { font-size: 11pt; }
.ts2-grid .nowrap { white-space: nowrap; overflow: visible; }
.ts2-grid .wrap { white-space: normal; }

/* ---------- Второй лист ВКТ-7 / ТВ7 ---------- */
.protocol-calc-page {
  padding: 5mm 6mm;
  font-family: "Courier New", Courier, monospace;
  font-size: 6.6pt;
  line-height: 1.12;
}
.calc-head { display: grid; gap: 0.4mm; margin-bottom: 1mm; }
.calc-head-row { display: flex; gap: 2mm; align-items: baseline; }
.calc-head-label { width: 47mm; flex: 0 0 47mm; }
.calc-head-date { margin-left: auto; white-space: nowrap; }
.calc-protocol-title { text-align: center; font-weight: 700; font-size: 9pt; margin-top: 1.5mm; }
.calc-protocol-subtitle { text-align: center; font-weight: 700; font-size: 7.6pt; margin-bottom: 0.8mm; }
.calc-owner, .calc-method { font-size: 6.6pt; }
.calc-section-title { font-weight: 700; margin: 1.4mm 0 0.6mm; }
.calc-instruments { border: 0.6pt solid #000; min-height: 7mm; padding: 0.8mm 1mm; }
.calc-conditions-table { width: 100%; border-collapse: collapse; margin: 1mm 0; }
.calc-conditions-table th, .calc-conditions-table td { border: 0.6pt solid #000; padding: 0.35mm 0.8mm; text-align: left; }
.calc-conditions-table th { font-weight: 700; }
.calc-check-row { display: flex; gap: 2mm; margin: 0.2mm 0; }
.calc-check-row span:first-child { min-width: 48mm; }
.calc-table { width: 100%; border-collapse: collapse; margin: 0.8mm 0 1.2mm; table-layout: fixed; }
.calc-table th, .calc-table td { border: 0.6pt solid #000; padding: 0.35mm 0.7mm; vertical-align: middle; }
.calc-table th { text-align: center; font-weight: 700; }
.calc-label { text-align: center; font-weight: 700; width: 8%; }
.calc-unit { text-align: center; width: 8%; }
.calc-range { text-align: center; width: 30%; }
.calc-value { text-align: center; width: 27%; }
.calc-row-out td { background: #ffe8e5; color: #9f1e15; }
.calc-result { margin-top: 1.5mm; line-height: 1.4; }
.calc-footer { display: flex; justify-content: space-between; margin-top: 3mm; }
.calc-page-number { text-align: right; }

/* ---------- Универсальный второй лист ---------- */
.protocol-generic-page { padding: 9mm 10mm; font-family: "Times New Roman", Times, serif; font-size: 10pt; line-height: 1.3; }
.generic-head { text-align: center; font-size: 9pt; margin-bottom: 4mm; }
.generic-company { font-weight: 700; font-size: 11pt; }
.generic-title { text-align: center; font-weight: 700; font-size: 13pt; margin: 4mm 0 1mm; }
.generic-subtitle { text-align: center; font-weight: 700; font-size: 10pt; margin-bottom: 5mm; }
.generic-meta, .generic-conditions { width: 100%; border-collapse: collapse; margin-bottom: 4mm; }
.generic-meta th, .generic-meta td, .generic-conditions th, .generic-conditions td { border: 0.8pt solid #000; padding: 1.4mm 2mm; vertical-align: top; }
.generic-meta th, .generic-conditions th { width: 42%; text-align: left; background: #f3f3f3; }
.generic-section-title { font-weight: 700; margin: 4mm 0 1.5mm; }
.generic-instruments { border: 0.8pt solid #000; min-height: 18mm; padding: 2mm; }
.generic-check { display: flex; gap: 2mm; margin: 1mm 0; }
.generic-check span:first-child { min-width: 65mm; }
.generic-conclusion { margin-top: 6mm; }
.generic-footer { display: flex; justify-content: space-between; margin-top: 14mm; }
.generic-page-number { text-align: right; }

/* ---------- Второй лист расходомера: сетка по шаблону ---------- */
.protocol-flowmeter-page {
  width: 297mm;
  min-height: 210mm;
  padding: 0;
  position: relative;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
  font-size: 8pt;
  line-height: 1.0;
  color: #000;
}
.fm2-sheet {
  position: absolute;
  left: 14.2mm;
  top: 4.83mm;
  width: 761.42pt;
  height: 540pt;
  font-size: 8pt;
  line-height: 1.0;
}
.fm2-title {
  position: absolute;
  left: 0;
  width: 761.42pt;
  text-align: center;
  font-size: 16pt;
  font-weight: 700;
  line-height: 1.1;
}
.fm2-toprow { position: absolute; left: 0; top: 0; width: 761.42pt; height: 14.4pt; font-size: 8pt; }
.fm2-abs { position: absolute; top: 0; }
.fm2-meta {
  position: absolute;
  left: 0;
  width: 476.15pt;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8pt;
}
.fm2-meta th,
.fm2-meta td {
  height: 11.1pt;
  padding: 0;
  border: 0;
  font-weight: 400;
  line-height: 11.1pt;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: visible;
}
.fm2-meta-instruments-text {
  display: block;
  width: 494.87pt;
  font-size: 6pt;
  line-height: 5.4pt;
  white-space: normal;
}
.fm2-table-wrap { position: absolute; left: 4.32pt; width: 693.07pt; }
.fm2-table { width: 693.07pt; border-collapse: collapse; table-layout: fixed; }
.fm2-table th,
.fm2-table td {
  border: 0.6pt solid #000;
  padding: 0;
  font-size: 8pt;
  font-weight: 400;
  line-height: 1.0;
  text-align: center;
  vertical-align: middle;
}
.fm2-table thead tr.fm2-head-group th { height: 7.5pt; }
.fm2-table thead tr.fm2-head-detail th { height: 41.4pt; }
.fm2-table tbody tr { height: 11.1pt; }
.fm2-result { position: absolute; left: 0; width: 761.42pt; font-size: 8pt; padding-top: 2pt; }
.fm2-signature { position: absolute; left: 0; width: 761.42pt; height: 12pt; font-size: 8pt; }
.fm2-sign-label { position: absolute; left: 0; top: 0; }
.fm2-sign-name { position: absolute; left: 413.82pt; top: 0; font-size: 11pt; }
.fm2-sign-line { position: absolute; top: 8pt; border-bottom: 0.5pt solid #000; }
.fm2-sign-cap { position: absolute; top: 8.5pt; font-size: 5pt; text-align: center; line-height: 1; }
.fm2-footer { position: absolute; left: 0; width: 761.42pt; height: 14pt; }

/* --- Второй лист расходомера: буквальная сетка Excel --- */
.fm3-grid {
  width: 761.42pt;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Times New Roman", Times, serif;
  font-size: 8pt;
  line-height: 1.0;
  color: #000;
}
.fm3-grid th,
.fm3-grid td {
  padding: 0;
  border: 0;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}
.fm3-grid td.b,
.fm3-grid th.b {
  border: 0.5pt solid #000;
  overflow-wrap: break-word;
}
.fm3-grid .center { text-align: center; }
.fm3-grid .vcenter { vertical-align: middle; }
.fm3-grid .fm3-fio { font-size: 11pt; white-space: nowrap; }
.fm3-grid tr.tiny td { line-height: 0; overflow: visible; }
.fm3-grid tr.r1 td { white-space: nowrap; }
.fm3-grid tr.r26 td { white-space: nowrap; }
.fm3-grid tr.r1 { height: 14.4pt; }
.fm3-grid tr.r2 { height: 2.85pt; }
.fm3-grid tr.r3,
.fm3-grid tr.r4,
.fm3-grid tr.r5 { height: 11.1pt; }
.fm3-grid tr.r6 { height: 13.65pt; }
.fm3-grid tr.r7 { height: 0.75pt; }
.fm3-grid tr.r8 { height: 7.5pt; }
.fm3-grid tr.r9 { height: 41.4pt; }
.fm3-grid tr.r10 { height: 0.75pt; }
.fm3-grid tr.r11 { height: 10.35pt; }
.fm3-grid tr.r12 { height: 0.75pt; }
.fm3-grid tr.r13 { height: 10.35pt; }
.fm3-grid tr.r14 { height: 0.75pt; }
.fm3-grid tr.r15 { height: 10.35pt; }
.fm3-grid tr.r16 { height: 13.65pt; }
.fm3-grid tr.r17 { height: 0.75pt; }
.fm3-grid tr.r18 { height: 3.6pt; }
.fm3-grid tr.r19 { height: 0.6pt; }
.fm3-grid tr.r20 { height: 0.75pt; }
.fm3-grid tr.r21 { height: 7.2pt; }
.fm3-grid tr.r22 { height: 16.2pt; }
.fm3-grid tr.r23 { height: 3.6pt; }
.fm3-grid tr.r24 { height: 7.5pt; }
.fm3-grid tr.r25 { height: 5.4pt; }
.fm3-grid tr.r26 { height: 13.65pt; }
.fm3-grid tr.r27 { height: 16.5pt; }

/* ---------- Водосчётчик: сетка по шаблону ---------- */
.protocol-water-meter-page {
  width: 297mm;
  min-height: 210mm;
  padding: 0;
  position: relative;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
}
.wm-excel {
  position: absolute;
  left: 17.8mm;
  top: 19.05mm;
  width: 1170pt;
  transform: scale(0.6);
  transform-origin: top left;
}
.wm-grid {
  width: 1170pt;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Times New Roman", Times, serif;
  font-size: 9pt;
  line-height: 1.05;
  color: #000;
}
.wm-grid th,
.wm-grid td {
  padding: 0;
  border: 0.5pt solid #000;
  font-weight: 400;
  line-height: 1.05;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}
.wm-grid td.nb,
.wm-grid th.nb { border: 0; }
.wm-grid .nowrap { white-space: nowrap; }
.wm-grid .vcell { position: relative; text-align: center; vertical-align: middle; padding: 0; overflow: hidden; }
.wm-grid .vtext {
  position: absolute;
  inset: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transform-origin: center;
  text-align: center;
  line-height: 1.0;
  white-space: normal;
  overflow-wrap: break-word;
  overflow: hidden;
}
.wm-grid tr.hdr-group th[rowspan="2"] .vtext { height: auto; }
.wm-grid tr.top td { height: 14.4pt; }
.wm-grid tr.title-row td {
  height: 17.4pt;
  font-size: 14pt;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
.wm-grid tr.hdr-group { height: 72pt; }
.wm-grid tr.hdr-detail { height: 67.8pt; }
.wm-grid tr.hdr-group th { text-align: center; vertical-align: middle; }
.wm-grid tr.hdr-detail th { text-align: center; vertical-align: middle; }
.wm-grid tr.num td { height: 14.4pt; text-align: center; vertical-align: middle; }
.wm-grid tr.values td { height: 16.2pt; }
.wm-grid tr.gap td { height: 14.4pt; }
.wm-grid tr.gap-sm td { height: 6.6pt; }
.wm-grid tr.line td { height: 14.4pt; }
.wm-grid tr.bottom td { height: 14.4pt; }

/* ---------- Третий лист: техническая запись ---------- */
.protocol-tech-page {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  padding: 0;
  overflow: hidden;
  color: #000;
}
.protocol-tech-page.is-landscape { width: 297mm; min-height: 210mm; }
.protocol-tech-page .tech-form {
  position: absolute;
  transform-origin: top left;
  font-family: "Times New Roman", Times, serif;
}
.tech-page-no { position: absolute; right: 14mm; bottom: 8mm; font-size: 10pt; }

/* --- Техническая запись расходомера (A4, альбомная, 100%) --- */
.tech-flow-page .tech-form { left: 14.2mm; top: 4.83mm; width: 761.42pt; font-size: 8pt; line-height: 1.0; }

/* --- Техническая запись ТС / ТСПТК (A4, портрет, 80%) --- */
.tech-ts-page .tech-form {
  left: 17.8mm;
  top: 19.05mm;
  width: 635.77pt;
  font-size: 10pt;
  line-height: 1.0;
}

/* ---------- Второй лист ВКТ-7 ---------- */
.protocol-vkt7-page {
  width: 210mm;
  min-height: 297mm;
  padding: 0;
  position: relative;
  overflow: visible;
  font-family: "Times New Roman", Times, serif;
}
.vkt2-sheet {
  position: absolute;
  left: 17.8mm;
  top: 19.05mm;
  width: 420.55pt;
}
.vkt2-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Times New Roman", Times, serif;
  font-size: 8pt;
  line-height: 1.0;
  color: #000;
}
.vkt2-grid tr { height: 14.4pt; }
.vkt2-grid td {
  padding: 0;
  border: 0;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}
.vkt2-grid td.b { border: 0.5pt solid #000; }
.vkt2-grid .center { text-align: center; }
.vkt2-grid .vcenter { vertical-align: middle; }
.vkt2-grid .strong { font-weight: 700; }
.vkt2-grid .big { font-size: 10pt; }
.vkt2-grid .page { font-size: 10pt; }
.vkt2-grid .nowrap { white-space: nowrap; overflow: visible; }
.vkt2-grid .wrap { white-space: normal; }

.protocol-vkt7-page .vkt2-grid { font-size: 5.6pt; }
.protocol-vkt7-page .vkt2-grid tr { height: 10.08pt; }
.protocol-vkt7-page .vkt2-grid td.b { border-width: 0.35pt; }
.protocol-vkt7-page .vkt2-grid .big,
.protocol-vkt7-page .vkt2-grid .page { font-size: 7pt; }

/* --- Техническая запись ВКТ-7 (A4, портрет, 70%) --- */
.tech-vkt7-page .tech-form {
  left: 17.8mm;
  top: 19.05mm;
  width: 648.72pt;
  font-size: 8pt;
  line-height: 1.0;
}
.tech-vkt7-page .vkt2-grid .page { font-size: 11pt; }

/* ---------- Второй лист ТВ7 ---------- */
.protocol-tv7-page {
  width: 210mm;
  min-height: 297mm;
  padding: 0;
  position: relative;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
}
.tv2-sheet {
  position: absolute;
  left: 17.8mm;
  top: 19.05mm;
  width: 600.7pt;
  transform: scale(0.7);
  transform-origin: top left;
}
.tv2-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Times New Roman", Times, serif;
  font-size: 8pt;
  line-height: 1.0;
  color: #000;
}
.tv2-grid tr { height: 14.4pt; }
.tv2-grid td {
  padding: 0;
  border: 0;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}
.tv2-grid td.b { border: 0.5pt solid #000; }
.tv2-grid .center { text-align: center; }
.tv2-grid .vcenter { vertical-align: middle; }
.tv2-grid .strong { font-weight: 700; }
.tv2-grid .page { font-size: 10pt; }
.tv2-grid .nowrap { white-space: nowrap; overflow: visible; }
.tv2-grid .wrap { white-space: normal; }

/* --- Техническая запись ТВ7 (A4, портрет, 70%) --- */
.tech-tv7-page .tech-form {
  left: 17.8mm;
  top: 19.05mm;
  width: 744.72pt;
  font-size: 8pt;
  line-height: 1.0;
}
.tech-tv7-page .tv2-grid .page { font-size: 11pt; }

/* --- Техническая запись водосчётчика (A4, альбомная, 60%) --- */
.tech-wm-page .tech-form { left: 17.8mm; top: 19.05mm; width: 1170pt; }

@media (max-width: 900px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; gap: 2px; }
  .detail-list dt { margin-top: 8px; }
}

@media print {
  body.protocol-print-body { background: #fff; }
  body.protocol-print-body .protocol-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 10mm 11mm;
    box-shadow: none;
    break-after: page;
  }
  body.protocol-print-body .protocol-sheet:last-of-type { break-after: auto; }
  body.protocol-print-body .protocol-title-page { padding: 19.05mm 17.78mm; }
  body.protocol-print-body .protocol-tech-page { width: 210mm; min-height: 297mm; padding: 0; margin: 0; break-after: auto; }
  body.protocol-print-body .protocol-tech-page.is-landscape { width: 297mm; min-height: 210mm; }
  body.protocol-print-body .protocol-ts-page { padding: 0; }
  body.protocol-print-body .protocol-calc-page { padding: 5mm 6mm; }
  body.protocol-print-body .protocol-vkt7-page { padding: 0; }
  body.protocol-print-body .protocol-tv7-page { padding: 0; }
  body.protocol-print-body .protocol-generic-page { padding: 9mm 10mm; }
  body.protocol-print-body .protocol-flowmeter-page {
    width: 297mm;
    min-height: 210mm;
    padding: 0;
  }
  body.protocol-print-body .protocol-water-meter-page {
    width: 297mm;
    min-height: 210mm;
    padding: 0;
  }
  body.protocol-print-body .protocol-page-break { break-after: page; }
  body.protocol-print-body .protocol-compact-table { page-break-inside: auto; }
  body.protocol-print-body .protocol-compact-table tr { page-break-inside: avoid; }
}

@media (max-width: 760px) {
  .report-grid { grid-template-columns: 1fr; }
  .report-filters .filter-field { flex: 1 1 140px; }
  .report-filters .filter-field-wide { flex-basis: 100%; }
  .report-filters .filter-actions { flex: 1 1 100%; }
}
