/* /assets/css/pages/cars.css */

.cars-page {
  --line: #656565;
  --muted: #666666;
  --green: #38b236;
  --red: #e53935;
}

/* views */
.cars-view {
  display: none;
}
.cars-view.is-visible {
  display: flex;
  flex-direction: column;
}

/* верхняя полоса */
.cars__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-left: 10px;
}
.cars__title {
  font-size: 24px;
  font-weight: 500;
  margin: 0;
  text-decoration: underline;
  cursor: pointer;
}
.cars__filters {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

/* прячем нативные select'ы */
.cars__filters select.filter-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* кастомные select (как drivers) */
:root {
  --filter-height: 60px;
}
.filter {
  position: relative;
  flex: 0 0 280px;
  font-size: 14px;
  box-sizing: border-box;
}
.filter__control {
  width: 100%;
  height: var(--filter-height);
  padding: 18px 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid #656565;
  cursor: pointer;
  color: #666666;
  outline: none;
  justify-content: space-between;
  font-weight: 500;
  font-size: 18px;
  width: 312px;
}
.filter__block {
  display: flex;
  align-items: center;
}
.filter__label {
  margin-right: 2px;
  white-space: nowrap;
  font-size: 16px;
}
.filter__value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  text-overflow: ellipsis;
}

.filter.is-open .filter__control,
.filter.is-filled .filter__control {
  background: #161616;
  border-color: #161616;
  color: rgba(255, 255, 255, 0.6);
}
.filter.is-open .filter__label,
.filter.is-filled .filter__label {
  color: rgba(255, 255, 255, 0.6);
}
.filter.is-open .filter__value,
.filter.is-filled .filter__value {
  color: #ffffff;
}
.filter__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #161616;
  padding: 0 0 12px;
  box-sizing: border-box;
  max-height: 260px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}
.filter.is-open .filter__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.filter__option {
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  text-align: left;
  font-size: 20px;
  line-height: 24px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  box-sizing: border-box;
}
.filter__option + .filter__option {
  position: relative;
}
.filter__option + .filter__option::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  border-top: 0.5px solid #666666;
}
.filter__option:hover {
  background: #202020;
  color: #ffffff;
}
.filter__option.is-active {
  color: #ffffff;
  position: relative;
}
.filter__option.is-active::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 6px;
  border-left: 1.5px solid #ffffff;
  border-bottom: 1.5px solid #ffffff;
  transform: translateY(-60%) rotate(-45deg);
}

/* таблица */
.cars-page #car-table {
  table-layout: fixed;
  width: 100%;
}
.cars-page .table thead th,
.cars-page .table tbody td {
  text-align: left;
}
.cars-page .table thead th,
.cars-page .table tbody td {
  padding-right: 1.25rem;
}
.cars-page .table thead th:last-child,
.cars-page .table tbody td:last-child {
  padding-right: 0;
}

/* Глобальный tr { height: 60px } ломает перенос ФИО — строка растёт по контенту */
.cars-page #car-table tbody tr.cars-row {
  height: auto;
  min-height: 3.75rem;
}
.cars-page #car-table tbody td {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  vertical-align: middle;
  overflow: hidden;
}

.cars-row {
  cursor: pointer;
}
.cars-row.selected {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Доли колонок: компактные поля слева, ФИО — основная ширина */
.cars-page #car-table .cars-cell--model {
  width: 14%;
}
.cars-page #car-table .cars-cell--plate {
  width: 12%;
}
.cars-page #car-table .cars-cell--tariff {
  width: 8%;
}
.cars-page #car-table .cars-cell--status {
  width: 12%;
}
.cars-page #car-table .cars-cell--activity {
  width: 13%;
}
.cars-page #car-table .cars-cell--driver,
.cars-page #car-table .cars-cell--partner {
  width: 20.5%;
}

.cars-model__name {
  display: block;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cars-model__meta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #9a9a9a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cars-model__meta[hidden] {
  display: none;
}

.cars-page .table tbody td.cars-cell--plate {
  white-space: nowrap;
}
.cars-page .table tbody td.cars-cell--tariff,
.cars-page .table tbody td.cars-cell--status,
.cars-page .table tbody td.cars-cell--activity {
  white-space: nowrap;
}

/* Госномер: спокойный «премиум»-бейдж в духе панели, без Consolas */
.cars-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 28px;
  min-width: 6.75rem;
  padding: 0 0.7rem 0 0.55rem;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: "Mulish", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  color: #1a1a1a;
  line-height: 1;
  position: relative;
}
.cars-plate::before {
  content: "";
  width: 3px;
  align-self: stretch;
  margin: 3px 0.45rem 3px 0;
  border-radius: 1px;
  background: #1b4f9c;
  flex: 0 0 3px;
}
.cars-plate--empty {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  font-weight: 400;
  letter-spacing: normal;
  color: #b0b0b0;
}
.cars-plate--empty::before {
  display: none;
}

.cars-muted {
  color: #b0b0b0;
}

/* ФИО целиком: перенос по словам внутри колонки, без вылезания в соседнюю */
.cars-page .table tbody td.cars-cell--driver,
.cars-page .table tbody td.cars-cell--partner {
  overflow: hidden;
}
.cars-page .table .cars-driver-link,
.cars-page .table .cars-partner-link,
.cars-page .table .cars-person-text {
  display: block;
  max-width: 100%;
  color: #2a2a2a;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
  transition: color 0.15s ease;
}
.cars-page .table .cars-driver-link:hover,
.cars-page .table .cars-partner-link:hover {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cars-page .cars-driver-link.is-empty {
  color: #b0b0b0;
  text-decoration: none;
  pointer-events: none;
}

.cars-status--active {
  color: #38b236;
}
.cars-status--pending {
  color: #999999;
}
.cars-status--blocked,
.cars-status--rejected {
  color: #d32525;
}

/* активность */
.cars-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.cars-dot--online {
  background-color: #38b236;
}
.cars-dot--offline {
  background-color: #d32525;
}

/* карточка (как partners/drivers) */
.cars-page .card-header.cars-card-header {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 1.875rem;
}

.cars-page .card-title {
  font-size: 24px;
  font-weight: 500;
  color: #000;
  margin: 0;
}

.cars-page .card-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* табы */
.cars-page .tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 3px;
  border: 1px solid #161616;
  margin: 24px 0;
}
.cars-page .tab {
  min-height: 40px;
  background: #ffffff;
  border: none;
  color: #999999;
  cursor: pointer;
  font-size: 20px;
  font-weight: 500;
  line-height: 40px;
}
.cars-page .tab.is-active {
  background: #161616;
  color: #ffffff;
}

.cars-page .tab-panes {
  margin-top: 12px;
}
.cars-page .tab-pane {
  display: none;
}
.cars-page .tab-pane.is-active {
  display: block;
}

/* инфо-сетка */
.cars-page .info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
}
.cars-page .info-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-evenly;
}
.cars-page .info-col.full-width {
  grid-column: 1 / -1;
}

.cars-page .info-row {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8.5px 0;
  border-bottom: 0.5px solid #666666;
  justify-content: space-between;
}
.cars-page .info-col.full-width.cars-partner-row .info-row {
  border-bottom: 1px solid #656565;
}
.partner-span {
  color: #333333 !important;
}
.cars-page .info-two-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}
.cars-page .info-label {
  color: #666666;
  font-size: 18px;
}
.cars-page .info-value-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  font-weight: 500;
}
.cars-page .info-value {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
  font-size: 18px;
  color: #333333;
  outline: none;
  border: none;
}
.cars-page .info-value:empty::before {
  content: attr(data-placeholder);
  color: #9b9b9b;
}

/* партнер / водитель в карточке — подчеркнутые ссылки */
.cars-partner-link,
.cars-driver-link {
  font-weight: 500;
  font-size: 18px;
  color: #333333;
  text-decoration: underline;
}

/* статус в карточке (точка + текст) */
.cars-activity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cars-activity__text {
  font-size: 18px;
  color: #333333;
  font-weight: 500;
}

/* причина блокировки */
.cars-block-reason {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cars-block-reason__title {
  color: #d32525;
  font-size: 14px;
}
.cars-block-reason__text {
  color: #161616;
  font-size: 16px;
  line-height: 24px;
  padding: 6px 10px;
  border: 1px solid #999999;
}

/* футер кнопок */
.cars-page .card-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  background: #fff;
  margin: 0px 40px 40px 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  z-index: 50;
  margin-left: var(--sidebar-width);
}
.cars-page .card-footer button {
  width: 260px;
  height: 56px;
}

/* документы */
.cars-page .docs-block {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 120px;
}
.cars-page .doc-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cars-page .doc-top {
  display: flex;
    justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #656565;
}
.cars-page .doc-top:has(.mini-btn--approve) {
  justify-content: space-between;
}
.cars-page .doc-title {
  font-size: 20px;
  font-weight: 500;
  color: #333333;
}
.cars-page .doc-status {
  font-size: 12px;
  padding: 5px 8px;
  border: 0.5px solid #656565;
  color: #38b236;
  background: #fff;
  border-radius: 1px;
}
.cars-page .mini-btn--approve {
  background: #38b236;
  color: #fff;
  border: none;
  padding: 3.5px 20px;
  font-size: 16px;
  cursor: pointer;
}
.cars-page .doc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cars-page .doc-fields .info-row {
  border-bottom: 0.5px solid #666666;
}
.cars-page .doc-file {
  font-weight: 500;
  font-size: 18px;
  color: #333333;
  letter-spacing: 0.02rem;
  text-decoration: underline;
}

.cars-page .tab[data-tab="docs"] {
  position: relative;
}
.cars-page .docs-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.cars-page .docs-work {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 48px;
}
.cars-page .docs-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafafa;
}
.cars-page .docs-summary--ok {
  border-color: var(--green);
  background: #f3faf3;
}
.cars-page .docs-summary--wait {
  border-color: #c9a227;
  background: #fffbeb;
}
.cars-page .docs-summary--bad {
  border-color: var(--red);
  background: #fff6f6;
}
.cars-page .docs-summary__title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}
.cars-page .docs-summary__hint {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}
.cars-page .docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) {
  .cars-page .docs-grid {
    grid-template-columns: 1fr;
  }
}
.cars-page .doc-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  min-height: 100%;
}
.cars-page .doc-card--ok {
  border-color: #9fd39e;
}
.cars-page .doc-card--optional {
  border-color: #d9d9d9;
  opacity: 0.85;
}
.cars-page .doc-card--wait {
  border-color: #e0c36a;
}
.cars-page .doc-card--missing,
.cars-page .doc-card--expired {
  border-color: #f0b4b4;
}
.cars-page .doc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cars-page .doc-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #222;
}
.cars-page .doc-chip {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: #555;
  background: #fff;
}
.cars-page .doc-chip--ok {
  color: var(--green);
  border-color: var(--green);
}
.cars-page .doc-chip--wait {
  color: #8a6d12;
  border-color: #c9a227;
}
.cars-page .doc-chip--missing,
.cars-page .doc-chip--expired {
  color: var(--red);
  border-color: var(--red);
}
.cars-page .doc-chip--optional {
  color: var(--muted);
}
.cars-page .doc-card__preview {
  display: block;
  height: 148px;
  border: 1px solid #e6e6e6;
  border-radius: 3px;
  overflow: hidden;
  background: #f4f4f4;
}
.cars-page .doc-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cars-page .doc-card__preview--empty,
.cars-page .doc-card__preview--file {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.cars-page .doc-card__preview--file {
  color: #222;
  text-decoration: underline;
}
.cars-page .doc-card__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cars-page .doc-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  border-bottom: 0.5px solid #e0e0e0;
  padding-bottom: 6px;
}
.cars-page .doc-card__row span {
  color: var(--muted);
}
.cars-page .doc-card__row b {
  font-weight: 600;
  color: #222;
  text-align: right;
}
.cars-page .doc-card__row b.is-expired {
  color: var(--red);
}
.cars-page .doc-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.cars-page .doc-card__btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
}
.cars-page .doc-card__btn--ok {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.cars-page .table tbody td.cars-cell--activity .cars-activity-text {
  display: inline-block;
  vertical-align: middle;
}

.info-col.full-width.cars-partner-row .info-row:nth-last-of-type(1) {
  justify-content: flex-start;
}
