/* ===== Фон сайта qazwater.kz на всех страницах (перенос с equrylys 2026-08-25) =====
 * Фото лежит в user_files этого же инстанса (загружено для equrylys, файл общий).
 * Контент рабочих страниц — на светлой панели; страница входа — тёмный слой
 * 70% и белая карточка формы, как на сайте qazwater.kz. */
body {
  background-image: url("https://digital.qazwater.kz/media/user_files/I1fi7PEMtjfig4fZU36KZ000nsXFZI37_e621ab429f429a60cc595e062283163543bb1879bc7773999be9d47c459dd6d4.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-color: #f7fafbff;
}
@media (hover: none) {
  body { background-attachment: scroll; } /* iOS: fixed рисуется рывками */
}
/* Рабочие страницы (нет формы входа): прозрачные подложки, светлая панель. */
body:not(:has(.auth-form-element)) .page,
body:not(:has(.auth-form-element)) .page__content-wrapper {
  background: transparent !important;
}
body:not(:has(.auth-form-element)) .page__content {
  background: rgba(247, 250, 251, .95) !important;
  border-radius: 12px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .28);
  padding: 20px 24px 28px;
  margin: 16px auto 28px;
  max-width: 1320px;
}
body:not(:has(.auth-form-element)) header,
body:not(:has(.auth-form-element)) .header {
  background: rgba(247, 250, 251, .95);
}
/* ===== Страница входа: тёмный слой и карточка формы ===== */
body.public-page:has(.auth-form-element)::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, .7));
  pointer-events: none;
  z-index: 0;
}
body.public-page:has(.auth-form-element) .page,
body.public-page:has(.auth-form-element) .page__content,
body.public-page:has(.auth-form-element) .element__wrapper,
body.public-page:has(.auth-form-element) .element__inner-wrapper {
  background: transparent !important;
  position: relative;
  z-index: 1;
}
body.public-page:has(.auth-form-element) .page__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88vh;
  gap: 4px;
}
/* заголовок и подпись над формой — белым, по центру */
body.public-page:has(.auth-form-element) h1,
body.public-page:has(.auth-form-element) .page__content > div > p {
  color: #ffffff !important;
  text-align: center !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}
body.public-page:has(.auth-form-element) .auth-form-element {
  background: rgba(255, 255, 255, .96);
  padding: 26px 24px 22px;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .38);
  max-width: 380px;
  min-width: 320px;
  width: 100%;
}
body.public-page:has(.auth-form-element) .auth-form-element button,
body.public-page:has(.auth-form-element) .auth-form-element .ab-button {
  background-color: #ff8562 !important;
  border-color: #ff8562 !important;
  color: #ffffff !important;
}
body.public-page:has(.auth-form-element) .auth-form-element button:hover,
body.public-page:has(.auth-form-element) .auth-form-element .ab-button:hover {
  background-color: #ef6f4b !important;
  border-color: #ef6f4b !important;
}

/* sk-menu-emphasis — пункты главного меню жирнее и крупнее (перенос с
   e-Qurylys, 2026-08-28). */
.menu-element__menu-item-link .ab-link {
  font-size: 15px;
  font-weight: 700;
}

/* sk-multiline — таблица-коллекция, уважающая переводы строк в ячейках. */
.sk-multiline td .ab-text,
.sk-multiline td {
  white-space: pre-line;
}
.sk-multiline p,
.sk-multiline .ab-text,
p.sk-multiline {
  white-space: pre-line;
}

/* sk-scroll-x — широкая таблица-коллекция получает СВОЮ горизонтальную
   прокрутку: своей у элемента-таблицы конструктора нет. */
.sk-scroll-x {
  overflow-x: auto;
}
.sk-scroll-x table {
  min-width: 940px;
  width: 100%;
  /* fixed + ширины всех столбцов: под таблицей стоит ВТОРАЯ таблица
     в одну строку (итоги, sk-total-row), столбцы обязаны совпасть. */
  table-layout: fixed;
}
.sk-scroll-x th:nth-child(1), .sk-scroll-x td:nth-child(1) { width: 200px; }
.sk-scroll-x th:nth-child(2), .sk-scroll-x td:nth-child(2) { width: 200px; }
.sk-scroll-x th:nth-child(4), .sk-scroll-x td:nth-child(4),
.sk-scroll-x th:nth-child(5), .sk-scroll-x td:nth-child(5) { width: 140px; }
/* 6 — АСУ (светофор договора на автоматизацию, 2026-09-13) */
.sk-scroll-x th:nth-child(6), .sk-scroll-x td:nth-child(6) { width: 130px; text-align: center; }
.sk-scroll-x td { overflow-wrap: anywhere; vertical-align: top; }

/* sk-total-row — строка итогов под таблицей договоров Главной. */
.sk-total-row thead { display: none; }
.sk-total-row { margin-top: -36px; }
.sk-total-row .collection-element__header { display: none; }
.sk-total-row .ab-table { border-top: 0; }
.sk-total-row td {
  font-weight: 600;
  background: #eef2f5;
  border-top: 2px solid #0b3d4d;
}
.sk-total-row button, .sk-total-row .ab-button, .sk-total-row .baserow-table__more { display: none !important; }
.sk-total-row .baserow-table-wrapper, .sk-total-row table { margin-top: 0; }

/* sk-cmp-cA-cB — ячейка столбца A красится ОРАНЖЕВЫМ, когда её число
   меньше числа столбца B той же строки. Класс ставит custom JS. */
.table-element tbody tr td.sk-below {
  background-color: #fdba74 !important;
}
/* Ширины столбцов таблицы договоров (Главная). Индексы nth-child
   ЖЁСТКИЕ: 1 контракт, 2 подрядчик, 3 ПСД/Мест/Ед., 4 по договору,
   5 прогноз, 6 АСУ. */
.sk-scroll-x th:nth-child(3),
.sk-scroll-x td:nth-child(3) {
  width: 116px;
  min-width: 116px;
  text-align: center;
}
.sk-scroll-x th:nth-child(4), .sk-scroll-x td:nth-child(4),
.sk-scroll-x th:nth-child(5), .sk-scroll-x td:nth-child(5) {
  min-width: 140px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sk-scroll-x td:nth-child(3) .ab-text,
.sk-scroll-x td:nth-child(4) .ab-text,
.sk-scroll-x td:nth-child(5) .ab-text {
  white-space: nowrap;
}
.sk-scroll-x th:nth-child(6),
.sk-scroll-x td:nth-child(6) {
  min-width: 130px;
  white-space: nowrap;
}
/* ЗАГОЛОВКИ таблиц sk-scroll-x — ВСЕ по центру (2026-09-13). !important нужен:
   правило выше задаёт right сразу для th и td с большей специфичностью. */
.sk-scroll-x thead th { text-align: center !important; }

/* ── /vedomost ──────────────────────────────────────────────────────
   Порядок сводки (тыс. тенге): 1 узел, 2 подрядчик, 3 ед., 4 договор
   тремя строками, 5 ДОГОВОР, 6 прогноз тремя строками, 7 ПРОГНОЗ, 8 Δ. */
.sk-vedomost-uzly table { min-width: 1154px; width: 100%; table-layout: fixed; }
.sk-vedomost-uzly th:nth-child(1), .sk-vedomost-uzly td:nth-child(1) { width: 250px; }
.sk-vedomost-uzly th:nth-child(2), .sk-vedomost-uzly td:nth-child(2) { width: 170px; }
.sk-vedomost-uzly th:nth-child(4), .sk-vedomost-uzly td:nth-child(4),
.sk-vedomost-uzly th:nth-child(6), .sk-vedomost-uzly td:nth-child(6) { width: 190px; }
.sk-vedomost-uzly th:nth-child(5), .sk-vedomost-uzly td:nth-child(5),
.sk-vedomost-uzly th:nth-child(7), .sk-vedomost-uzly td:nth-child(7) { width: 110px; }
.sk-vedomost-uzly th:nth-child(8), .sk-vedomost-uzly td:nth-child(8) { width: 90px; }
.sk-vedomost-uzly td { overflow-wrap: anywhere; }
.sk-vedomost-uzly th, .sk-vedomost-uzly td { white-space: nowrap; vertical-align: top; }
.sk-vedomost-uzly th:nth-child(1), .sk-vedomost-uzly td:nth-child(1) { white-space: normal; }
.sk-vedomost-uzly th:nth-child(2), .sk-vedomost-uzly td:nth-child(2) { white-space: normal; }
.sk-vedomost-uzly th:nth-child(3), .sk-vedomost-uzly td:nth-child(3) { width: 44px; text-align: center; }
.sk-vedomost-uzly td:nth-child(n+4) { text-align: right; font-variant-numeric: tabular-nums; }
.sk-vedomost-uzly th:nth-child(4), .sk-vedomost-uzly td:nth-child(4), .sk-vedomost-uzly td:nth-child(4) .ab-text,
.sk-vedomost-uzly th:nth-child(6), .sk-vedomost-uzly td:nth-child(6), .sk-vedomost-uzly td:nth-child(6) .ab-text { white-space: pre-line; line-height: 1.35; }
.sk-vedomost-uzly th:nth-child(5), .sk-vedomost-uzly td:nth-child(5),
.sk-vedomost-uzly th:nth-child(7), .sk-vedomost-uzly td:nth-child(7) { font-weight: 600; background: #f4f7f9; }
.sk-vedomost-uzly th:nth-child(6), .sk-vedomost-uzly td:nth-child(6) { border-left: 2px solid #cfd8dd; }

/* сумма ширин 1220 ≤ панели контента (~1232px) */
.sk-vedomost-pozicii table { min-width: 1220px; width: 100%; table-layout: fixed; }
.sk-vedomost-pozicii th:nth-child(2), .sk-vedomost-pozicii td:nth-child(2) { width: 150px; white-space: normal; }
.sk-vedomost-pozicii th:nth-child(4), .sk-vedomost-pozicii td:nth-child(4) { width: 90px; }
.sk-vedomost-pozicii th:nth-child(6), .sk-vedomost-pozicii td:nth-child(6) { width: 70px; }
.sk-vedomost-pozicii th:nth-child(7), .sk-vedomost-pozicii td:nth-child(7) { width: 110px; }
.sk-vedomost-pozicii th:nth-child(8), .sk-vedomost-pozicii td:nth-child(8) { width: 120px; }
.sk-vedomost-pozicii th:nth-child(9), .sk-vedomost-pozicii td:nth-child(9) { width: 100px; }
.sk-vedomost-pozicii td { overflow-wrap: anywhere; }
.sk-vedomost-pozicii th, .sk-vedomost-pozicii td { white-space: nowrap; }
.sk-vedomost-pozicii th:nth-child(1), .sk-vedomost-pozicii td:nth-child(1) { width: 230px; white-space: normal; }
.sk-vedomost-pozicii th:nth-child(3), .sk-vedomost-pozicii td:nth-child(3) { width: 200px; white-space: normal; }
.sk-vedomost-pozicii th:nth-child(5), .sk-vedomost-pozicii td:nth-child(5) { width: 150px; white-space: normal; }
.sk-vedomost-pozicii td:nth-child(n+6) { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== sk-modal: модальное подтверждение (перенос с e-Qurylys) ===== */
.sk-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(7, 8, 16, .55);
  overflow: auto;
  padding: 10vh 16px 16px;
}
.sk-modal .sk-modal-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  padding: 22px 24px;
  max-width: 460px;
  margin: 0 auto;
}
.sk-modal .sk-modal-cancel .ab-button {
  background-color: #eef2f5 !important;
  border-color: #cfe0e6 !important;
  color: #0b3d4d !important;
}

/* sk-total — строка итогов под таблицами /vedomost. */
.sk-total p, .sk-total .ab-text { font-weight: 600; font-variant-numeric: tabular-nums; }