/* ==========================================================
   БАЗА
========================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    "Mulish",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}
/* hidden должен всегда скрывать элемент */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}
body {
  font-size: 1rem;
  color: #333;
  background: #d4d4d4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
  line-height: 1;
  overflow-wrap: anywhere;
}

a {
  text-decoration: none;
  color: inherit;
}

:root {
  --sidebar-width: 15.9375rem; /* 255px */
  --sidebar-bg: #2f2f2f;
  --sidebar-hover: #3a3a3a;
  --text: #ffffff;
  --active-text: #333333;
  --accent-1: #cb9451;
  --accent-2: #9c6230;
  --main-fs: 1rem;
  --main-lh: 1;
  --main-ls: 0;
  --color-9: #999999;
  --color-16: #161616;
  --color-notActive: #c9c9c9;
}
/* Глобально выключаем стандартный фокус */
:where(input, textarea, select, button):focus,
:where(input, textarea, select, button):focus-visible,
:where(input, textarea, select, button):active {
  outline: none !important;
  box-shadow: none !important;
}

/* Не меняем бордер на фокусе (если где-то были стили) */
:where(input, textarea, select):focus {
  border-color: inherit !important;
}

/* Мобильный WebKit: убираем серый тап-хайлайт */
:where(input, textarea, select, button) {
  -webkit-tap-highlight-color: transparent;
}

/* Firefox: снимаем внутреннюю пунктирную обводку */
:where(input, button, select, textarea):-moz-focusring {
  outline: none !important;
}

/* Старые Firefox: убираем внутреннюю рамку у кнопок/инпутов */
button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
}
/* textarea: без ручки resize и без стандартного фокуса */
textarea {
  resize: none; /* запретить растягивание */
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
}

textarea:focus,
textarea:focus-visible,
textarea:active {
  outline: none !important; /* убрать синий/пунктирный контур */
  box-shadow: none !important; /* убрать glow у некоторых браузеров */
  border-color: inherit !important; /* не менять бордер на фокусе */
}

/* Firefox: на некоторых темах добавляет свою обводку */
textarea:-moz-focusring {
  outline: none !important;
}

/* (не обязательно) если нужно убрать «уголок» в Chrome старых версий */
textarea::-webkit-resizer {
  display: none;
}
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}
button {
  border-radius: 1px;
}
/* SPA: на 1 кадр прячем main во время атомарной замены, чтобы не было FOUC */
main.spa-swap {
  visibility: hidden;
}

/* ==========================================================
   САЙДБАР
========================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  z-index: 2000;
}
.sidebar .nav a[href*="page=support"] {
  position: relative;
}
.sidebar-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e53935;
  position: absolute;
}
/* Логотип */
.sidebar .logo {
  padding: 2.5rem 0 0 1.5rem; /* 40px 0 0 24px */
}
.sidebar .logo img {
  display: block;
  max-width: calc(var(--sidebar-width) - 3rem); /* -48px */
  height: auto;
}

/* Заголовок "Меню" */
.sidebar .section-title {
  width: calc(100% - 1.5rem);
  margin: 1.5rem 0 1rem 1.5rem; /* 24px 0 16px 24px */
  line-height: var(--main-lh);
  font-size: var(--main-fs);
  letter-spacing: var(--main-ls);
  font-weight: 500;
  opacity: 0.8;
  flex: 0 0 auto;
}

.sidebar .section-title p {
  margin: 0;
}

/* Навигация */
.sidebar .nav {
  list-style: none;
  margin: 0 0 1.5rem; /* 0 0 24px */
  padding: 0;
  flex: 1;
}
.sidebar .nav li {
  margin-bottom: 0.5rem; /* 8px */
}

.sidebar .nav li > a {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* 8px */
  margin-left: 1.5rem; /* 24px */
  padding: 0.5rem 0.75rem; /* 10px 18px */
  color: var(--text);
  transition:
    background 0.2s ease,
    color 0.2s ease;
  font-size: 1.5rem; /* 24px */
  font-weight: 500;
  border-top-left-radius: 0.125rem; /* 2px */
  border-bottom-left-radius: 0.125rem;
  background-clip: padding-box;
}

.sidebar .nav li > a .icon {
  width: 1.75rem; /* 28px */
  height: 1.75rem;
  flex: 0 0 1.75rem;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: var(--icon) no-repeat center;
  mask: var(--icon) no-repeat center;
}

.sidebar .nav li > a .icon-duo {
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 1.75rem;
  display: inline-block;
}
.sidebar .nav li > a .icon-duo::before,
.sidebar .nav li > a .icon-duo::after {
  content: "";
  position: absolute;
  inset: 0;
}
.sidebar .nav li > a .icon-duo::before {
  background: currentColor;
  -webkit-mask: var(--icon-bg) no-repeat center;
  mask: var(--icon-bg) no-repeat center;
}
.sidebar .nav li > a .icon-duo::after {
  background: #333333;
  -webkit-mask: var(--icon-fg) no-repeat center;
  mask: var(--icon-fg) no-repeat center;
}

/* Актив */
.sidebar .nav li > a:hover {
  background: var(--sidebar-hover);
}
.sidebar .nav li.active > a {
  background: #fff;
  color: var(--active-text);
  font-weight: 600;
}
.sidebar .nav li.active > a .icon-duo::after {
  background: #ffffff;
}

/* Logout */
.sidebar .logout {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem; /* 4px */
  width: calc(100% - 1.5rem);
  margin-bottom: 2.5rem; /* 40px */
  justify-content: center;
  padding-top: 0.625rem; /* 10px */
}
.sidebar .logout .icon {
  width: 1.5rem; /* 24px */
  height: 1.5rem;
  flex: 0 0 1.5rem;
  background-color: currentColor;
  -webkit-mask: var(--icon) no-repeat center;
  mask: var(--icon) no-repeat center;
}
.sidebar .logout::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 0;
  top: 0;
  height: 0.0625rem; /* 1px */
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  opacity: 0.9;
}

/* ============================================================
   Footer buttons — flow (not fixed)
============================================================ */
.card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  z-index: auto;
  margin-top: auto;
  padding-top: 30px;
}

.card-footer button {
  width: 260px;
  height: 56px;
}

/* ==========================================================
   ОСНОВНАЯ ОБЛАСТЬ
========================================================== */

/*
  Белый фон должен расти с контентом. height:100svh обрезал фон по viewport —
  при скролле карточек/detail торчал серый body (#d4d4d4).
  Списки пагинированы (≤50), поэтому рост страницы безопасен.
*/
.content {
  min-height: 100svh;
  height: auto;
  background: #ffffff;
  padding: 2.5rem;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

/*
  Flex-цепочка только для видимого table-wrapper.
  Скрытая export-table (как на payouts) и list-view[hidden] больше не
  натягивают section на 100% поверх длинной карточки.
*/
section:has(> .table-wrapper:not([hidden])):not([hidden]),
.orders-view.is-visible:has(.table-wrapper),
.drivers-view.is-visible:has(.table-wrapper),
.cars-view.is-visible:has(.table-wrapper),
.partners-view.is-visible:has(.table-wrapper) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 0 auto;
}

.table-wrapper {
  overflow: auto; /* скролл только тут */
}

.content:has(.reviews-page),
.content:has(.support-page) {
  padding: 0 !important;
}

.reviews-page,
.support-page {
  width: 100%;
  min-height: 100%;
  flex: 1 0 auto;
  display: flex;
}

/* Страница авторизации */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-height: 100svh;
  height: auto;
  margin: 0;
  padding: 32px 16px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f2f2f2;
}

/* ==========================================================
   МОДАЛКА
========================================================== */

/* disabled — кнопка недоступна (форма не заполнена) */
button:disabled,
.btn[disabled] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  border: none !important;
  background: var(--color-notActive) !important;
}

/* loading — кнопка заблокирована во время запроса */
.btn--disabled {
  opacity: 0.6;
  cursor: wait !important;
  pointer-events: none;
  border: none !important;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: #00000066;
  backdrop-filter: blur(0.25rem); /* 4px */
  z-index: 3000;
}

.modal {
  position: relative;
  background: #fff;
  border-radius: 0.125rem; /* 2px */
  box-shadow: 0 0.125rem 0.75rem rgba(0, 0, 0, 0.2); /* 2px 12px */
  padding: 2.5rem 1.5rem 1.5rem; /* 40px 24px 24px */
  max-width: 574px;
}
.modal__title {
  margin-bottom: 1.5rem; /* 24px */
  font-size: 1.5rem; /* 24px */
  font-weight: 500;
  color: #333333;
}
.modal__close {
  position: absolute;
  top: 1.5rem; /* 24px */
  right: 1.375rem; /* 22px */
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 21px; /* 19px */
  line-height: 1;
  font-weight: 900;
  color: #666666;
}

/* Форма */
.modal__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; /* 14px 16px */
}
.modal__text {
  font-size: 18px;
  color: #666;
  margin: 8px 0 24px;
}
.modal__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.modal__actions button {
  font-size: 24px !important;
  font-weight: 500;
  width: 100%;
  min-width: 258px;
  max-width: 258px;
  height: 60px;
  max-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal__actions .btn--danger {
  background: #d32525;
  border: 1px solid #d32525;
  color: #fff;
  width: 100%;
  height: 60px;
}
.modal__actions .btn--success {
  background: #38b236;
  color: #fff;
  border: none;
  width: 100%;
  height: 60px;
}
.modal.modal--lg {
  display: flex;
  flex-direction: column;
  max-height: 92dvh; /* dvh лучше на мобильных, можно 90dvh */
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* 8px */
}
.field label {
  font-size: 0.875rem; /* 14px */
  color: #666666;
}
.field label span {
  color: #d32525;
}
.field input,
.field textarea,
.field select {
  padding: 1.125rem 0.625rem; /* 18px 10px */
  border: 1px solid #999999;
  font-size: 1.25rem; /* 20px */
  line-height: 1.5rem; /* 24px */
  color: #333333;
  max-width: 258px;
  width: 100%;
}
.field .req {
  color: #d32525;
}
input {
  max-height: 60px;
}
/* Префикс */
.input-with-prefix {
  position: relative;
}
.input-with-prefix input {
  padding-left: 1.25rem; /* 20px */
}
.input-with-prefix::before {
  content: attr(data-prefix);
  position: absolute;
  left: 0.625rem; /* 10px */
  top: 51%;
  font-size: 1.25rem; /* 20px */
  line-height: 1.5rem; /* 24px */
  pointer-events: none;
}
/* Универсальный поиск с иконкой слева */
.search {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 52%;
  width: 16px;
  height: 16px;
  transform: translateY(-60%);
  background: #656565;
  -webkit-mask: var(--search-icon) no-repeat center / contain;
  mask: var(--search-icon) no-repeat center / contain;
}

.search__input {
  width: 100%;
  height: 44px;
  border: 1px solid #656565;
  padding: 0 12px 0 44px;
  font-size: 16px;
  color: #333333;
  background: #fff;
  max-width: 320px;
}

.search__input::placeholder {
  color: #b6b6b6;
}

/* если есть текст - темный фон (как было у partner-search) */
.search__input:not(:placeholder-shown) {
  background: #161616;
  color: #ffffff;
  border-color: #161616;
}

/* Кнопки */

.back-btn {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-mask: url("/assets/img/partners/row-left.svg") no-repeat center / 20px
    20px;
  mask: url("/assets/img/partners/row-left.svg") no-repeat center / 20px 20px;
  background-color: #666666;
}
.btn {
  font-size: 20px;
  font-weight: 500;
  min-width: 220px;
  background: #ffffff;
  color: #333333;
  height: 40px;
  line-height: 40px;
  padding: 0 20px;
  cursor: pointer;
}

.btn--ghost {
  background: #ffffff !important;
  font-size: 24px !important;
  font-weight: 500 !important;
  color: #333333 !important;
  border: 2px solid #161616;
}
.btn--primary {
  background: #161616 !important;
  font-size: 24px !important;
  font-weight: 500 !important;
  color: #fff !important;
  border: none !important;
}
.btn--outline-danger {
  font-size: 20px;
  font-weight: 500;
  min-width: 220px;
  background: #ffffff;
  color: #333333;
}
/* на случай если общий .btn не задает border для outline */
.btn.btn--outline-danger {
  border: 1px solid #d32525;
}
.btn.btn--outline-success {
  border: 1px solid #38b236;
}
.field textarea {
  max-width: none;
}

/* English / 中文 рядом с русским полем. Общий блок для витрины. */
.i18n-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.i18n-grid__cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field label .i18n-grid__lang,
.i18n-grid__lang {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8a8a;
}
.i18n-grid__lang .req {
  color: #d32525;
}
.i18n-grid input,
.i18n-grid textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}
.i18n-grid textarea {
  min-height: 72px;
  resize: vertical;
}
.i18n-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.i18n-copy + .i18n-copy {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
/* ==========================================================
   КНОПКА ПЕРИОд С КАЛЕНДАРЁМ
========================================================== */
/* Корневой контейнер */

.custom-period-range {
  position: relative; /* для абсолютной панели */
  box-sizing: border-box;
  border-radius: 1px;
  background-color: #ffffff;
}

/* Кнопка в свернутом состоянии */

.custom-period-range__toggle {
  box-sizing: border-box;
  width: 312px;
  height: 60px;
  padding: 0 12px 0 8px;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #656565;
}

.custom-period-range__text {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.custom-period-range__label {
  font-weight: 500;
  color: #666666;
  font-size: 1rem;
  line-height: 1.25rem;
}

.custom-period-range__value {
  font-weight: 500;
  color: #666666;
  font-size: 18px;
}

/* Панель календаря — абсолютная, поверх контента */

.custom-period-range__panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  display: none;
  background-color: #161616;
  color: #ffffff;
  z-index: 100;
}

/* Строка с месяцем и стрелками */

.custom-period-range__month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 8px;
}

.custom-period-range__month-label {
  font-size: 16px;
  font-weight: 600;
}

.custom-period-range__nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.custom-period-range__nav-button {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* Дни недели */

.custom-period-range__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 41px;
  align-items: center;
  padding: 0 14px;
}

.custom-period-range__weekday {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
}

/* Сетка дней */

.custom-period-range__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 41px;
  border: none;
  box-sizing: border-box;
  padding: 0 14px 10px;
}

.custom-period-range__day {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-color: #161616;
  color: #f5f5f5;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  justify-content: center;
  border-radius: 0;
  border-top: 1px solid #3a3a3a;
  border-left: 1px solid #3a3a3a;
  border-bottom: none;
  border-right: none;
}
/* соседний месяц — приглушённый светлый, не чёрный на #161616 */
.custom-period-range__day--outside {
  color: #9a9a9a;
  font-weight: 500;
}
/* на случай глобальных button/color — дни панели явно светлые */
.custom-period-range__panel .custom-period-range__day {
  color: #f5f5f5;
}
.custom-period-range__panel .custom-period-range__day--outside {
  color: #9a9a9a;
}
.custom-period-range__panel .custom-period-range__day--selected-edge {
  color: #000000;
}
.custom-period-range__panel .custom-period-range__day--in-range {
  color: #ffffff;
}
/* ---- ВЕРХНИЙ РЯД ---- */
.custom-period-range__day:nth-child(-n + 7) {
  border-top: 1px solid #3a3a3a;
}

/* ---- ЛЕВАЯ КОЛОНКА ---- (каждый 7-й начиная с 1) */
.custom-period-range__day:nth-child(7n + 1) {
  border-left: 1px solid #3a3a3a;
}

/* ---- ПРАВАЯ КОЛОНКА ---- (каждый 7-й) */
.custom-period-range__day:nth-child(7n) {
  border-right: 1px solid #3a3a3a;
}

/* ---- НИЖНИЙ РЯД ---- */
.custom-period-range__day:nth-last-child(-n + 7) {
  border-bottom: 1px solid #3a3a3a;
}
/* Пустая ячейка (до начала и после конца месяца) */

.custom-period-range__day--empty {
  cursor: default;
}

/* Внутри выбранного диапазона */

.custom-period-range__day--in-range {
  background-color: #999999;
  color: #ffffff;
  border: 1px solid #3a3a3a;
}

/* Границы диапазона (от и до) */

.custom-period-range__day--selected-edge {
  background-color: #ffffff;
  color: #000000;
  border: none;
}

/* Состояние открытия */

.custom-period-range--open {
  background-color: #161616;
  color: #ffffff;
}

.custom-period-range--open .custom-period-range__label {
  color: #ffffff;
}

.custom-period-range--open .custom-period-range__toggle {
  color: #ffffff;
  border: none;
}

/* показываем панель при открытии */

.custom-period-range--open .custom-period-range__panel {
  display: block;
}

/* После выбора диапазона в кнопке остаются только даты — без "Период:" */

.custom-period-range--has-selection .custom-period-range__label {
  display: none;
}

.custom-period-range--has-selection .custom-period-range__value {
  color: #ffffff;
}

/* Ховеры */

.custom-period-range__nav-button:hover,
.custom-period-range__day:hover:not(.custom-period-range__day--empty) {
  filter: brightness(1.1);
}

/* ==========================================================
   ТАБЛИЦА
========================================================== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem; /* 15px */
  background: none;
  border: none;
}

.table thead tr {
  border-bottom: 1px solid #656565;
}

.table thead th {
  font-weight: 600;
  padding: 0.5rem 0; /* 8px */
  white-space: nowrap;
  font-size: 1.25rem; /* 20px */
  text-align: center;
}

.table tbody td {
  padding: 0.5rem 0; /* 8px */
  border-bottom: 1px solid #999999;
  vertical-align: middle;
  font-size: 1.125rem; /* 18px */
  text-align: center;
}

.table thead th:first-child,
.table tbody td:first-child {
  padding-left: 10px;
}
tr {
  padding-bottom: 0.5rem; /* 8px */
  min-height: 3.75rem; /* 60px */
  height: 3.75rem; /* 60px */
}
.filter__arrow {
  width: 18px;
  height: 10px;
  display: inline-block;

  /* стрелка рисуется маской, цвет берется из color */
  background-color: rgb(102 102 102);
  -webkit-mask-image: url("/assets/img/arrow.svg");
  mask-image: url("/assets/img/arrow.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;

  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
}

/* поворот при открытии */
.filter.is-open .filter__arrow,
.custom-period-range--open .filter__arrow {
  transform: rotate(-180deg);
}

/* цвет стрелки */
.filter.is-open .filter__arrow,
.filter.is-filled .filter__arrow {
  color: #ffffff;
}

/* ==========================================================
   GOOGLE MAP (clean modal)
========================================================== */
.wa-map-modal {
  width: 80%;
  height: 80%;
  max-width: 94vw;
  max-height: 86vh;
  display: block;
  position: relative;
  overflow: hidden;
  max-width: 100% !important;
}
.wa-map-modal .modal__close {
  top: 0.5rem;
  right: 0.5rem;
  z-index: 6;
}
.wa-map-canvas--full {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

/* лоадер как был */
.wa-map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #444;
  background: rgba(255, 255, 255, 0.75);
  z-index: 2;
}

.wa-car-marker {
  position: absolute;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  transform-origin: center center;
  cursor: pointer;
  pointer-events: auto;
}
.wa-car-marker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* Состояние машины на карте: на карту попадают все машины с открытой сменой,
   поэтому «нет связи» и «пауза» обязаны читаться с одного взгляда. */
.wa-car-marker__dot {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}
.wa-car-marker.is-free .wa-car-marker__dot {
  background: #16a34a;
}
.wa-car-marker.is-busy .wa-car-marker__dot {
  background: #f59e0b;
}
.wa-car-marker.is-break .wa-car-marker__dot {
  background: #2563eb;
}
.wa-car-marker.is-lost .wa-car-marker__dot,
.wa-car-marker.is-paused .wa-car-marker__dot {
  background: #dc2626;
}
.wa-car-marker.is-lost img,
.wa-car-marker.is-paused img {
  filter: grayscale(1);
  opacity: 0.55;
}
.wa-car-marker.is-hidden {
  display: none;
}
.wa-car-marker.is-selected {
  width: 60px;
  height: 60px;
  z-index: 2;
}
.wa-car-marker.is-selected img {
  filter: drop-shadow(0 0 6px rgba(22, 22, 22, 0.55));
}

/* карточка выбранного авто на карте */
.wa-map-car-card {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 18px 16px 16px;
  background: #ffffff;
  color: #161616;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
}
.wa-map-car-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 18px;
  line-height: 32px;
  cursor: pointer;
}
.wa-map-car-card__close:hover {
  color: #161616;
}
.wa-map-car-card__body {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wa-map-car-card__driver {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 28px;
}
.wa-map-car-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}
.wa-map-car-card__avatar.is-empty {
  object-fit: contain;
  background: #ffffff;
}
.wa-map-car-card__driver-main {
  min-width: 0;
  flex: 1;
}
.wa-map-car-card__name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}
.wa-map-car-card__meta {
  margin-top: 4px;
  font-size: 13px;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.wa-map-car-card__phone {
  color: #161616;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.wa-map-car-card__phone:hover {
  border-bottom-color: #161616;
}
.wa-map-car-card__rating {
  font-weight: 600;
  color: #161616;
}
.wa-map-car-card__activity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.wa-map-car-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38b236;
  flex-shrink: 0;
}
.wa-map-car-card__dot--to-client,
.wa-map-car-card__dot--waiting,
.wa-map-car-card__dot--trip {
  background: #161616;
}
.wa-map-car-card__dot--busy {
  background: #d4a017;
}
.wa-map-car-card__dot--off {
  background: #999;
}
.wa-map-car-card__dot--lost {
  background: #dc2626;
}
.wa-map-car-card__dot--break {
  background: #2563eb;
}
.wa-map-car-card__ago {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #888;
}
.wa-map-car-card__hr {
  height: 1px;
  margin: 14px 0;
  background: #ececec;
  border: 0;
}
.wa-map-car-card__car-title {
  font-size: 16px;
  font-weight: 700;
}
.wa-map-car-card__car-line {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}
.wa-map-car-card__plate {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 6px;
  padding: 0 8px 0 0;
  border: 1px solid #cfd4dc;
  border-radius: 3px;
  background: #f7f8fa;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.wa-map-car-card__plate::before {
  content: "";
  width: 3px;
  align-self: stretch;
  margin: 3px 8px 3px 0;
  background: #1b4f9c;
}
.wa-map-car-card__trip-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wa-map-car-card__trip-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
}
.wa-map-car-card__trip-route {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}
.wa-map-car-card__hint {
  margin-top: 8px;
  font-size: 13px;
  color: #888;
}
.wa-map-car-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.wa-map-car-card__link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #161616;
  border-radius: 8px;
  background: #ffffff;
  color: #161616;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.wa-map-car-card__link:hover {
  background: #f4f4f4;
}
.wa-map-car-card__link--primary {
  background: #161616;
  color: #ffffff;
}
.wa-map-car-card__link--primary:hover {
  background: #2a2a2a;
}
.wa-map-car-card__state--error {
  padding: 8px 4px 4px;
}
.wa-map-car-card__error-text {
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}
.wa-map-car-card__retry {
  margin-top: 12px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #161616;
  border-radius: 8px;
  background: #161616;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.wa-map-car-card__skel-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.wa-map-car-card__skel-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-map-car-card__skel {
  background: #ececec;
  border-radius: 6px;
  animation: wa-map-skel 1.2s ease-in-out infinite;
}
.wa-map-car-card__skel--avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wa-map-car-card__skel--line {
  height: 12px;
  width: 100%;
  margin-bottom: 8px;
}
.wa-map-car-card__skel--short {
  width: 55%;
  margin-bottom: 0;
}
.wa-map-car-card__skel--mid {
  width: 70%;
}
@keyframes wa-map-skel {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}
@media (max-width: 640px) {
  .wa-map-car-card {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }
}

/* doc edit modal styles */
.doc-edit-section {
  margin-bottom: 8px;
  gap: 0.5rem;
  display: flex;
  flex-direction: column;
}
.doc-edit-subtitle {
  font-size: 20px;
  font-weight: 500;
  color: #333;
  margin-bottom: 10px;
}
.doc-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.doc-edit-field {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}
.doc-edit-field--full {
  grid-column: 1 / -1;
}
.doc-edit-label {
  display: block;
  font-weight: 500;
}
.doc-edit-label .req {
  color: #d32525;
}
.doc-edit-input {
  max-width: none !important;
  width: 100%;
  padding: 18px 10px;
  border: 1px solid var(--color-9);
  font-size: 20px;
  line-height: 24px;
  color: var(--color-16) !important;
}
.doc-edit-input:focus {
  border-color: inherit !important;
}
.doc-edit-file-block {
  gap: 0.5rem;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}
.doc-edit-file-label {
  height: 60px;
  border: 1px solid #999999;
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.doc-edit-file-name {
  font-size: 20px;
  line-height: 24px;
  color: #333333 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 10px;
}
.doc-edit-file-hidden {
  display: none;
}

/* doc top layout fix */
.doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.doc-top__left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-top__right {
  display: flex;
  align-items: center;
}
.doc-edit-btn {
  border: 0;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================
   ПАГИНАЦИЯ СПИСКОВ И СОСТОЯНИЯ ТАБЛИЦЫ
   Разметка .wa-pager одинаковая на всех страницах — стили общие,
   в CSS конкретной страницы их дублировать не нужно.
========================================================== */
.wa-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 0 4px;
  flex: 0 0 auto;
}
.wa-pager[hidden] {
  display: none;
}
.wa-pager__btn {
  min-width: 140px;
  height: 40px;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 500;
  background: #ffffff;
  color: #333333;
  border: 2px solid #161616;
  cursor: pointer;
}
.wa-pager__info {
  font-size: 18px;
  color: #333333;
  min-width: 120px;
  text-align: center;
}

/* Служебная строка таблицы: загрузка / пусто / ошибка */
.table-state td {
  text-align: center;
  color: #666666;
  font-size: 1.125rem; /* 18px */
}
.table-state__msg {
  display: block;
  padding: 4px 10px;
}
.table-state__retry {
  min-width: 160px;
  height: 36px;
  margin-top: 8px;
  padding: 0 16px;
  font-size: 16px;
  background: #ffffff;
  color: #333333;
  border: 2px solid #161616;
  cursor: pointer;
}
.table-state--error td {
  color: #d32525;
}
tr.table-state--error[data-list-error] td {
  font-weight: 500;
}
.reviews-list__state--error[data-list-error] {
  color: #d32525;
}

/* ---- Empty state (списки / таблицы) ---- */
.wa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 12rem;
  padding: 40px 24px;
  text-align: center;
}
.wa-empty__mark {
  width: 44px;
  height: 52px;
  margin-bottom: 6px;
  border: 1.5px solid #161616;
  border-radius: 1px;
  position: relative;
  opacity: 0.45;
  flex-shrink: 0;
}
.wa-empty__mark::before,
.wa-empty__mark::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  height: 1.5px;
  background: #161616;
}
.wa-empty__mark::before {
  top: 16px;
}
.wa-empty__mark::after {
  top: 24px;
  right: 14px;
  box-shadow: 0 8px 0 #161616;
}
.wa-empty__title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  color: #161616;
}
.wa-empty__text {
  margin: 0;
  max-width: 28rem;
  font-size: 15px;
  line-height: 1.45;
  color: #666666;
}
.table-state--empty td {
  border-bottom: none !important;
  padding: 0 !important;
  vertical-align: middle;
}

/* Скелетон: прячем серые полоски — вместо них спиннер на обёртке */
.skeleton-bar {
  display: block;
  height: 18px;
  margin: 0 10px;
  opacity: 0;
  pointer-events: none;
}

/* Невидимый скелетон не должен оставлять «полоски» бордерами строк */
.table-state:has(.skeleton-bar) td,
.table-state--loading td {
  border: none !important;
  border-bottom: none !important;
  padding: 0 !important;
  height: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
}

.table-wrapper:has(.skeleton-bar),
.table-wrapper:has(.table-state--loading),
.support-list-view:has(.support-list-state--loading) {
  position: relative;
  min-height: 14rem;
}
.table-wrapper:has(.skeleton-bar) > table,
.table-wrapper:has(.table-state--loading) > table {
  opacity: 0;
}
.table-wrapper:has(.skeleton-bar)::after,
.table-wrapper:has(.table-state--loading)::after,
.support-list-view:has(.support-list-state--loading)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border-radius: 50%;
  border: 2.5px solid rgba(22, 22, 22, 0.1);
  border-top-color: #cb9451;
  border-right-color: #9c6230;
  animation: wa-spin 0.85s linear infinite;
  pointer-events: none;
  z-index: 2;
}
.support-list-view:has(.support-list-state--loading) .support-list-state--loading {
  opacity: 0;
}
.reviews-stream:has(.reviews-list__state--loading),
.reviews-list:has(.reviews-list__state--loading) {
  position: relative;
  min-height: 14rem;
}
.reviews-stream:has(.reviews-list__state--loading) .reviews-list__state--loading,
.reviews-list:has(.reviews-list__state--loading) .reviews-list__state--loading {
  opacity: 0;
}
.reviews-stream:has(.reviews-list__state--loading)::after,
.reviews-list:has(.reviews-list__state--loading)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border-radius: 50%;
  border: 2.5px solid rgba(22, 22, 22, 0.1);
  border-top-color: #cb9451;
  border-right-color: #9c6230;
  animation: wa-spin 0.85s linear infinite;
  pointer-events: none;
  z-index: 2;
}

/* SPA / навигационный лоадер поверх контента */
.wa-nav-loader {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 212, 212, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
body.wa-nav-loading .wa-nav-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.wa-nav-loader__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 40px rgba(22, 22, 22, 0.12);
}
.wa-nav-loader__spin {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 2.5px solid rgba(22, 22, 22, 0.1);
  border-top-color: #cb9451;
  border-right-color: #9c6230;
  animation: wa-spin 0.85s linear infinite;
}
.wa-nav-loader__text {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
}
@keyframes wa-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes wa-skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* Подгрузка следующей страницы: старые данные приглушаем, но не убираем */
.table-wrapper.is-refreshing {
  opacity: 0.55;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar {
    animation: none;
  }
}

/* ==========================================================
   BOOT GATE — до проверки Firebase Auth
   Кручение на .wa-boot__ring (не на SVG). Critical CSS в main.php.
========================================================== */
.wa-boot {
  font-family: "Mulish", system-ui, sans-serif;
  overflow: hidden;
}

.wa-boot__aura {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 55% 40% at 50% 42%, rgba(203, 148, 81, 0.22), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(156, 98, 48, 0.12), transparent 65%);
  pointer-events: none;
  animation: wa-boot-aura 4.5s ease-in-out infinite alternate;
}

.wa-boot__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem;
  animation: wa-boot-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wa-boot__logo {
  width: min(14rem, 62vw);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.wa-boot__spinner {
  width: 3.5rem;
  height: 3.5rem;
  filter: drop-shadow(0 0 14px rgba(203, 148, 81, 0.35));
}

.wa-boot__ring {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
  animation: wa-boot-spin 0.95s linear infinite;
}

.wa-boot__ring svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wa-boot__track {
  stroke: rgba(255, 255, 255, 0.12);
}

.wa-boot__arc {
  stroke-dasharray: 36 110;
  transform-origin: 28px 28px;
  transform: rotate(-90deg);
}

.wa-boot__hint {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  animation: wa-boot-hint 1.6s ease-in-out infinite;
}

@keyframes wa-boot-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes wa-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes wa-boot-hint {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes wa-boot-aura {
  from {
    opacity: 0.75;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-boot__aura,
  .wa-boot__stage,
  .wa-boot__hint {
    animation: none !important;
  }
  .wa-boot__hint {
    opacity: 0.65;
  }
  .wa-boot__ring {
    animation-duration: 1.4s;
  }
}

