@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  /* Cyprus/Sand palette — mirrors Mobile app_palette.dart kLight */
  --color-bg: #f0ede4;
  --color-surface: #fcfbf7;
  --color-surface-2: #e7e2d4;
  --color-primary: #004741;
  --color-primary-hover: #015c54;
  --color-accent: #3d6e8e;
  --color-danger: #c0392b;
  --color-warning: #b47a12;
  --color-success: #2e7d5b;
  --color-text-primary: #15211e;
  --color-text-secondary: #4c5a55;
  --color-text-muted: #8b948e;
  --color-border: #d8d1c2;
  --color-divider: #e6e0d2;
  --shadow-glow: 0 8px 18px rgba(0, 71, 65, 0.16);
  --shadow-panel: 0 8px 22px rgba(21, 33, 30, 0.055);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --environment-banner-height: 40px;
}

:root[data-web-style="compact"] {
  --color-bg: #eef2f4;
  --color-surface: #ffffff;
  --color-surface-2: #edf3f1;
  --color-primary: #123c36;
  --color-primary-hover: #18584e;
  --color-accent: #315f78;
  --shadow-glow: 0 7px 16px rgba(18, 60, 54, 0.15);
  --shadow-panel: 0 4px 14px rgba(21, 33, 30, 0.045);
}

:root[data-web-style="clear"] {
  --color-bg: #f6f7f8;
  --color-surface: #ffffff;
  --color-surface-2: #eef1f3;
  --color-primary: #1d4f45;
  --color-primary-hover: #25685b;
  --color-accent: #345f7a;
  --color-border: #d6dde1;
  --color-divider: #e5e9ec;
  --shadow-glow: 0 8px 18px rgba(29, 79, 69, 0.14);
  --shadow-panel: none;
}

* {
  box-sizing: border-box;
}

.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;
}

html {
  min-width: 320px;
  text-size-adjust: 100%;
}

body.client-body,
body.auth-body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  background-image: linear-gradient(180deg, #fdfcf9 0%, var(--color-bg) 42%, #e9e4d9 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* iOS: закрасить и notch/status bar, и home indicator тем же тоном,
   что и подложка страницы — чтоб не было ощущения «кусок отрезали». */
html {
  background-color: var(--color-bg);
}

.environment-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px calc(14px + env(safe-area-inset-right)) 7px calc(14px + env(safe-area-inset-left));
  color: #ffffff;
  background: #b91c1c;
  border-bottom: 1px solid rgba(127, 29, 29, 0.55);
  box-shadow: 0 4px 12px rgba(127, 29, 29, 0.22);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.environment-banner-label {
  overflow-wrap: anywhere;
}

body.has-environment-banner .client-sidebar {
  top: var(--environment-banner-height);
  height: calc(100vh - var(--environment-banner-height));
}

:root[data-web-style="compact"] body.client-body,
:root[data-web-style="compact"] body.auth-body {
  background: var(--color-bg);
}

:root[data-web-style="compact"] .client-content {
  padding-top: 18px;
}

:root[data-web-style="compact"] .client-sidebar {
  gap: 10px;
  padding-top: 14px;
}

:root[data-web-style="compact"] .client-nav-item,
:root[data-web-style="compact"] .client-nav-button {
  min-height: 34px;
}

:root[data-web-style="compact"] .panel {
  padding: 14px;
}

:root[data-web-style="clear"] body.client-body,
:root[data-web-style="clear"] body.auth-body {
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  min-width: 0;
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.photo-preview-frame {
  display: none;
  margin-top: 12px;
  padding: 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.photo-preview-frame img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: calc(var(--radius) - 2px);
  background: #fff;
}

.photo-preview-caption {
  margin: 8px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.ocr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.54);
}

.ocr-modal-backdrop.is-open {
  display: flex;
}

.ocr-modal {
  width: min(980px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  padding: 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.ocr-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ocr-modal-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.05fr);
  gap: 18px;
}

.ocr-photo-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.ocr-photo-panel img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.ocr-timer {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 7px 10px;
  color: var(--color-warning);
  background: rgba(180, 83, 9, 0.08);
  border-radius: 999px;
  font-weight: 700;
}

.ocr-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(180, 83, 9, 0.25);
  border-top-color: var(--color-warning);
  border-radius: 50%;
  animation: ocr-spin 0.8s linear infinite;
}

.ocr-timer.is-done {
  display: none;
}

.ocr-results {
  display: grid;
  gap: 12px;
  align-content: start;
}

.ocr-result-card {
  padding: 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.ocr-result-summary {
  margin: 10px 0;
  padding: 10px 12px;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-divider);
  border-radius: 6px;
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: pre-line;
  line-height: 1.45;
}

.ocr-result-raw {
  margin: 10px 0;
  background: #fff;
  border: 1px solid var(--color-divider);
  border-radius: 6px;
}

.ocr-result-raw summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--color-text);
  font-weight: 700;
}

.ocr-result-raw pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--color-divider);
  font-size: 12px;
}

@keyframes ocr-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .ocr-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .ocr-modal {
    max-height: 94vh;
    border-radius: 14px 14px 0 0;
  }

  .ocr-modal-grid {
    grid-template-columns: 1fr;
  }

  .ocr-modal-head {
    display: grid;
  }

  .ocr-modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .ocr-photo-panel img {
    max-height: 300px;
  }
}

/* Shell */
.client-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

body.has-environment-banner .client-shell {
  padding-top: var(--environment-banner-height);
}

.client-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 14px 18px;
  background: rgba(252, 251, 247, 0.97);
  border-right: 1px solid var(--color-border);
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.04);
}

.client-brand {
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid var(--color-divider);
}

.client-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.client-brand-mark {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  color: var(--color-primary);
  text-transform: uppercase;
}

.client-brand-name {
  display: block;
  margin-top: 5px;
  font-size: 23px;
  line-height: 1.05;
  font-weight: 800;
}

.client-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.client-sidebar-footer {
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
}

.client-nav-item,
.client-nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.2;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.client-nav-button {
  appearance: none;
}

.button_to {
  max-width: 100%;
  margin: 0;
}

.client-nav-item:hover,
.client-nav-button:hover,
.client-nav-item.active {
  color: var(--color-text-primary);
  background: var(--color-surface-2);
  border-color: var(--color-border);
}

.client-nav-item.active {
  color: var(--color-primary);
  background: rgba(0, 71, 65, 0.1);
  border-color: transparent;
  font-weight: 700;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
  color: currentColor;
  background: transparent;
}

.client-nav-item.active .nav-icon {
  color: var(--color-primary);
  background: transparent;
}

.nav-collapsible {
  display: grid;
  gap: 4px;
}

.nav-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin: 10px 10px 4px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-collapsible-summary::-webkit-details-marker {
  display: none;
}

.nav-collapsible-chevron {
  font-size: 14px;
  transition: transform 0.18s ease;
}

.nav-collapsible[open] .nav-collapsible-chevron {
  transform: rotate(180deg);
}

.nav-icon-dashboard::before { content: "⌂"; }
.nav-icon-vehicles::before { content: "◆"; }
.nav-icon-rentals::before { content: "↻"; }
.nav-icon-trips::before { content: "→"; }
.nav-icon-documents::before { content: "▤"; }
.nav-icon-profile::before { content: "●"; }
.nav-icon-logout::before { content: "×"; }
.nav-icon-qr::before { content: "QR"; }
.nav-icon-fines::before { content: "!"; }
.nav-icon-payment::before { content: "₽"; }
.nav-icon-support::before { content: "?"; }
.nav-icon-settings::before { content: "⚙"; }
.nav-icon-about::before { content: "i"; }
.nav-icon-dispatcher::before { content: "≡"; }
.nav-icon-verify::before { content: "✓"; }
.nav-icon-users::before { content: "◉"; }
.nav-icon-balance::before { content: "$"; }
.nav-icon-pricing::before { content: "₽"; }
.nav-icon-deleted::before { content: "−"; }
.nav-icon-notifications::before { content: "◦"; }

.nav-label-with-badge {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-badge,
.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--color-danger);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
}

.client-main {
  min-width: 0;
}

.client-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-top: env(safe-area-inset-top);
  padding-right: calc(clamp(16px, 2.4vw, 28px) + env(safe-area-inset-right));
  padding-left: calc(clamp(16px, 2.4vw, 28px) + env(safe-area-inset-left));
  background: rgba(240, 237, 228, 0.92);
  border-bottom: 1px solid var(--color-divider);
  backdrop-filter: blur(16px);
}

.topbar-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-greeting {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-hello {
  flex: 0 0 auto;
}

.topbar-name {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-weight: 800;
  text-overflow: ellipsis;
}

.client-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-status-chip {
  flex: 0 1 auto;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.environment-chip {
  flex: 0 1 auto;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-user-name {
  min-width: 0;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.user-role {
  color: var(--color-text-muted);
  font-size: 11px;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  color: var(--color-text-secondary);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
}

.icon-button .nav-icon {
  background: transparent;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--color-surface);
  border-radius: 999px;
}

.client-content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 2.4vw, 28px) 40px;
}

/* Page */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.page-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 31px);
  line-height: 1.08;
  letter-spacing: 0;
}

.page-subtitle,
.muted {
  color: var(--color-text-secondary);
}

.page-subtitle {
  margin: 7px 0 0;
  max-width: 660px;
  line-height: 1.55;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
}

/* Layout primitives */
.grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 16px;
}

.split-row,
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--color-surface-2);
  border-radius: var(--radius);
}

.pricing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.pricing-row + .pricing-row {
  margin-top: 8px;
}

.pricing-row__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 200px;
}

.pricing-row__value {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--color-text-muted);
}

.pricing-footer {
  margin-top: 10px;
  font-size: 12px;
}

.complete-error-slot {
  margin-top: 10px;
  font-size: 14px;
  color: var(--color-danger, #b91c1c);
}

.complete-error-slot:empty {
  display: none;
}

.complete-error-slot.is-error {
  padding: 10px 14px;
  background: #fee2e2;
  border-radius: 8px;
}

.finish-geo-hint {
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  color: #92400e;
  background: #fef3c7;
  border-left: 3px solid var(--color-warning, #f59e0b);
  border-radius: 6px;
}

.finish-geo-hint.hidden { display: none; }

/* Единое loading-состояние для submit-кнопок аренды: спиннер + серая заливка.
   Кнопка блокируется через disabled на JS-уровне (submit-once handler). */
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 999px;
  animation: rental-spin 0.7s linear infinite;
}

.btn.btn-primary.is-loading::after {
  border-top-color: #fff;
}

@keyframes rental-spin {
  to { transform: rotate(360deg); }
}

.rental-submitting-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.split-row > :last-child,
.info-row > :last-child {
  text-align: right;
  font-weight: 700;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.actions .button_to {
  display: inline-flex;
}

.actions .button_to .btn {
  width: 100%;
}

.actions-between {
  justify-content: space-between;
}

.center-block {
  width: min(500px, 100%);
  margin: 24px auto 0;
}

.panel,
.vehicle-card,
.auth-card,
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

.panel {
  padding: clamp(16px, 2vw, 20px);
}

/* Единый вертикальный отступ между соседними .panel/.stat-card/.vehicle-card,
   чтобы карточки на любых экранах имели одинаковую дистанцию друг от друга,
   а не по 24px inline в одних местах и без margin — в других. */
.panel + .panel,
.panel + .stat-card,
.stat-card + .panel,
.stat-card + .stat-card,
.panel + .vehicle-card,
.vehicle-card + .panel,
.vehicle-card + .vehicle-card {
  margin-top: 16px;
}

@media (min-width: 761px) {
  .panel + .panel,
  .panel + .stat-card,
  .stat-card + .panel,
  .stat-card + .stat-card,
  .panel + .vehicle-card,
  .vehicle-card + .panel,
  .vehicle-card + .vehicle-card {
    margin-top: 20px;
  }
}

.grid > .panel,
.grid > .stat-card,
.grid > .vehicle-card {
  margin-top: 0;
}

.panel-soft {
  background: linear-gradient(135deg, #ffffff, #f4f8fd);
}

.panel-danger {
  border-color: rgba(220, 38, 38, 0.35);
}

/* Buttons */
.btn {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  color: var(--color-text-primary);
  font-weight: 800;
  line-height: 1.1;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  overflow-wrap: anywhere;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.btn-sm,
.btn-small {
  min-height: 36px;
  padding: 0 14px;
  gap: 6px;
  font-size: 12px;
}

.btn-secondary {
  color: var(--color-text-primary);
  background: var(--color-surface-2);
}

.btn-outline {
  color: var(--color-text-primary);
  background: transparent;
  border-color: var(--color-border);
}

.btn:hover {
  border-color: #b5c2d4;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.btn-primary {
  color: #ffffff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-danger {
  color: #ffffff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-full {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Chips and status */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  border-radius: 999px;
}

.chip-success {
  color: var(--color-success);
  background: rgba(21, 128, 61, 0.1);
}

.chip-warning {
  color: var(--color-warning);
  background: rgba(180, 83, 9, 0.1);
}

.chip-danger {
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.1);
}

.chip-accent {
  color: var(--color-accent);
  background: rgba(15, 118, 110, 0.1);
}

.chip-info {
  color: var(--color-accent);
  background: rgba(61, 110, 142, 0.1);
}

.chip-muted {
  color: var(--color-text-secondary);
  background: rgba(82, 96, 113, 0.1);
}

/* Cards */
.stat-card,
.metric {
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.metric {
  min-height: 68px;
  background: #f8fafc;
  border-color: var(--color-divider);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.metric-label {
  display: block;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  display: block;
  margin-top: 5px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  font-weight: 800;
  word-break: break-word;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 16px;
  min-width: 0;
}

.profile-stats-grid .metric {
  min-width: 0;
}

.profile-stats-date {
  font-size: 16px;
}

.stat-value {
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 30px;
  font-weight: 800;
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vehicle-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.vehicle-card {
  overflow: hidden;
}

.vehicle-card.is-muted {
  opacity: 0.78;
}

.vehicle-media,
.vehicle-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 154px;
  background:
    radial-gradient(circle at 28% 24%, rgba(0, 71, 65, 0.16), transparent 32%),
    linear-gradient(145deg, #fdfcf9, #e7e2d4);
  border-bottom: 1px solid var(--color-divider);
}

.vehicle-media.is-warning {
  background: linear-gradient(135deg, rgba(180, 122, 18, 0.12), #e7e2d4);
}

.vehicle-media.is-danger {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.12), #eef3f8);
}

.vehicle-symbol,
.doc-symbol,
.feature-symbol {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  font-size: 22px;
  font-weight: 800;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.vehicle-symbol::before {
  content: "BD";
}

.vehicle-plate {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: calc(100% - 32px);
  padding: 0 12px;
  overflow: hidden;
  color: #ffffff;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-primary);
  border-radius: 6px;
}

.vehicle-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.vehicle-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.vehicle-summary {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  margin-top: 16px;
}

.vehicle-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: start;
}

.vehicle-detail-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.vehicle-detail-heading .vehicle-symbol {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.vehicle-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vehicle-finance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vehicle-finance-card {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.vehicle-finance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.vehicle-finance-total {
  display: grid;
  gap: 2px;
  min-width: 140px;
  text-align: right;
}

.vehicle-finance-total strong {
  font-size: 20px;
  line-height: 1.2;
}

.vehicle-finance-empty {
  padding: 18px;
}

.vehicle-finance-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
}

.vehicle-finance-form > .field {
  flex: 1 1 180px;
  min-width: 0;
}

.vehicle-finance-form > .field:nth-child(3) {
  flex: 2 1 240px;
}

.vehicle-finance-submit {
  flex: 0 0 auto;
  min-width: max-content;
}

.vehicle-finance-history {
  margin-top: 2px;
}

.initial-expense-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 160px minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
}

.vehicle-qr-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  text-align: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.vehicle-qr-card p {
  margin: 3px 0 0;
  font-size: 12px;
}

.vehicle-qr-image {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.vehicle-qr-card code {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.vehicle-state-actions,
.vehicle-detail-actions {
  justify-content: flex-start;
  margin-top: 16px;
}

.rental-odometer-panel {
  max-width: 900px;
  margin: 0 auto;
}

.rental-vehicle-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-divider);
}

.rental-vehicle-strip .vehicle-symbol {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 16px;
}

.rental-vehicle-strip p {
  margin: 3px 0 0;
}

.rental-vehicle-mileage {
  margin-left: auto;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.rental-odometer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(300px, 1.25fr);
  gap: 16px;
  padding-top: 18px;
}

.rental-odometer-field {
  align-content: start;
}

.odometer-input-wrap {
  display: inline-flex;
  align-items: stretch;
  align-self: start;
  max-width: 260px;
  width: 100%;
  height: 52px;
  min-height: 52px;
  box-sizing: border-box;
}

.odometer-input-wrap .input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 12px;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.odometer-input-unit {
  flex: 0 0 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  padding: 0 14px;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left: none;
  box-sizing: border-box;
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.odometer-input-wrap:focus-within .input,
.odometer-input-wrap:focus-within .odometer-input-unit {
  border-color: var(--color-primary);
}

.odometer-input-wrap .input:focus {
  box-shadow: none;
}

.field-hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: 34rem;
}

.rental-odometer-photo {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.rental-photo-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
}

.rental-photo-actions .rental-ocr-button {
  flex: 1 1 180px;
}

.rental-odometer-preview {
  width: 100%;
  max-height: 170px;
  object-fit: contain;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-2);
}

.odometer-ocr-result {
  min-width: 0;
}

.odometer-ocr-panel {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.odometer-ocr-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.odometer-ocr-panel-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.odometer-ocr-message {
  margin: 0;
}

.odometer-ocr-badge {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
}

.odometer-ocr-facts {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-divider);
}

.odometer-ocr-fact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.odometer-ocr-fact-icon {
  font-size: 14px;
}

.odometer-ocr-fact-label {
  color: var(--color-text-muted);
  font-weight: 600;
}

.odometer-ocr-fact-value {
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.odometer-ocr-raw {
  min-width: 0;
}

.odometer-ocr-raw summary {
  cursor: pointer;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
}

.odometer-ocr-raw-label {
  display: block;
  margin: 10px 0 4px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.odometer-ocr-raw pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.45;
}

.rental-end-ocr-actions {
  margin-top: 10px;
}

.rental-step-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-divider);
}

.rental-photo-head-actions {
  flex-shrink: 0;
  gap: 8px;
}

.rental-photo-head-actions .btn,
.rental-photo-head-actions .button_to {
  min-width: 126px;
}

.rental-photo-head-actions .button_to .btn {
  width: 100%;
}

.rental-start-final {
  max-width: 960px;
  margin: 0 auto;
}

.rental-finish-panel {
  max-width: 960px;
  margin: 0 auto;
}

.rental-final-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rental-odometer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-top: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-divider);
}

.rental-finish-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.rental-finish-geo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rental-vehicle-check {
  max-width: 820px;
  margin: 0 auto;
}

.rental-vehicle-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rental-vehicle-card .vehicle-symbol {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  font-size: 16px;
  box-shadow: none;
}

.rental-vehicle-identity {
  min-width: 0;
  flex: 1;
}

.rental-vehicle-identity h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.rental-vehicle-identity p {
  margin: 4px 0 0;
  font-size: 13px;
}

.rental-vehicle-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rental-vehicle-meta > span:first-child {
  display: grid;
  gap: 2px;
  text-align: right;
}

.rental-vehicle-meta small {
  color: var(--color-text-muted);
  font-size: 11px;
}

.rental-vehicle-note {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 13px;
}

.rental-tariff-section {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
}

.rental-tariff-section h3,
.rental-tariff-section p {
  margin: 0;
}

.rental-tariff-section h3 {
  font-size: 16px;
}

.rental-tariff-section p {
  margin-top: 3px;
  font-size: 12px;
}

.rental-tariff-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rental-tariff-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.rental-tariff-option:hover {
  border-color: var(--color-primary);
}

.rental-tariff-option input[type="radio"] {
  display: none;
}

.rental-tariff-option__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.rental-tariff-option > span {
  display: grid;
  gap: 2px;
  flex: 1;
}

.rental-tariff-option small {
  color: var(--color-text-muted);
  font-size: 12px;
}

.rental-tariff-option.is-selected {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.rental-tariff-option.is-selected .rental-tariff-option__dot {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.rental-nearby {
  max-width: 820px;
  margin: 16px auto 0;
}

.rental-nearby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rental-nearby-head .panel-title {
  margin: 0;
}

.rental-nearby-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rental-nearby-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.rental-nearby-card .vehicle-symbol {
  width: 38px;
  height: 38px;
  font-size: 13px;
  box-shadow: none;
}

.rental-nearby-card > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rental-nearby-card > div strong,
.rental-nearby-card > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rental-nearby-card > div span {
  font-size: 11px;
}

.rental-nearby-card .btn {
  grid-column: 1 / -1;
  width: 100%;
}

.rental-check-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-divider);
}

.rental-final-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.rental-final-head .panel-title,
.rental-final-head p {
  margin-bottom: 0;
}

.photo-progress-compact {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.photo-progress-compact strong {
  color: var(--color-primary);
  font-size: 18px;
}

.rental-photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.rental-photo-grid .photo-box {
  min-height: 112px;
  padding: 12px;
  aspect-ratio: auto;
  gap: 8px;
}

.rental-photo-grid .photo-box small {
  display: block;
  margin-top: 5px;
  line-height: 1.35;
}

.rental-photo-ocr-button {
  width: 100%;
  margin-top: auto;
}

.rental-start-options {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--color-divider);
}

.rental-condition-row,
.rental-geo-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-divider);
}

.rental-service-notes-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.rental-service-note-row {
  display: grid;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr) max-content;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-top: 1px solid var(--color-divider);
}

.rental-service-note-row .chip {
  white-space: normal;
  line-height: 1.15;
  text-align: left;
}

.rental-service-note-row .muted {
  font-size: 12px;
  white-space: nowrap;
}

.rental-service-note-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rental-active-summary {
  gap: 12px;
}

.rental-active-card {
  padding: 14px;
}

.rental-active-card .panel-title {
  font-size: 15px;
}

.rental-active-card .object-row {
  gap: 10px;
}

.rental-active-card .vehicle-symbol {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.active-rental-head {
  align-items: center;
}

.ocr-modal-actions {
  flex-shrink: 0;
  justify-content: flex-end;
}

.rental-dev-photo-button {
  justify-self: start;
}

.photo-source-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(21, 33, 30, 0.42);
}

.photo-source-sheet {
  width: min(420px, 100%);
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.photo-source-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.photo-source-head strong {
  color: var(--color-text-primary);
  font-size: 18px;
}

.photo-source-head span {
  color: var(--color-text-muted);
  font-size: 13px;
}

.photo-source-actions {
  display: grid;
  gap: 8px;
}

.photo-source-actions .btn {
  width: 100%;
}

.photo-source-actions label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-source-native-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
}

.rental-info-grid .metric {
  min-height: auto;
}

.rental-detail-layout {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.rental-detail-main,
.rental-payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rental-detail-participant {
  grid-column: 1 / -1;
}

.rental-detail-layout .metric,
.rental-trip-point {
  min-width: 0;
}

.rental-trip-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.rental-trip-point {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 82px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(18, 35, 32, 0.04);
}

.rental-trip-point strong {
  color: var(--color-text-primary);
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rental-photo-review-section {
  margin-top: 18px;
}

.rental-photo-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rental-photo-review-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.rental-photo-review-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 8px;
  overflow: hidden;
  background: var(--color-surface-2);
  border-radius: 6px;
  cursor: zoom-in;
}

.rental-photo-review-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rental-photo-review-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 1.25;
}

.rental-photo-review-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rental-condition-row > div:first-child,
.rental-geo-row > div:first-child {
  display: grid;
  gap: 3px;
}

.rental-condition-row .muted,
.rental-geo-row .muted {
  font-size: 12px;
}

.rental-fuel-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.rental-fuel-control .input {
  width: 96px;
  min-width: 96px;
  height: 38px;
  text-align: right;
  font-weight: 800;
}

.rental-fuel-control > span {
  color: var(--color-text-muted);
  font-weight: 800;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, 54px);
  padding: 3px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.segmented-control button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--color-text-secondary);
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.segmented-control button.is-active {
  color: #fff;
  background: var(--color-primary);
}

.rental-geo-row code {
  min-height: 16px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.vehicle-hero {
  aspect-ratio: 1;
  min-height: 0;
  border: 0;
  border-radius: var(--radius);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field,
.vtc-field {
  display: grid;
  gap: 8px;
}

.vtc-field > .label {
  margin-bottom: 2px;
}

.field-full {
  grid-column: 1 / -1;
}

.field-readonly {
  gap: 6px;
  padding: 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.field-readonly strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.label {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.input,
.select,
.form-control,
textarea.input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--color-text-primary);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
}

.select {
  height: 40px;
}

textarea.input {
  min-height: 110px;
  padding-top: 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.form-control:focus,
textarea.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 71, 65, 0.12);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-secondary);
}

/* Tables */
.table-panel {
  max-width: 100%;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Видимая подсказка "можно скроллить вбок" на узких экранах: тень у правого
     края появляется/исчезает сама, когда контент реально шире контейнера —
     это background-attachment:local трюк, не требует JS. */
  background:
    linear-gradient(to right, var(--color-surface, #fff) 30%, transparent),
    linear-gradient(to right, transparent, var(--color-surface, #fff) 70%) 100% 0,
    linear-gradient(to right, rgba(0,0,0,0.08), transparent),
    linear-gradient(to left, rgba(0,0,0,0.08), transparent) 100% 0;
  background-repeat: no-repeat;
  background-color: var(--color-surface, #fff);
  background-size: 24px 100%, 24px 100%, 8px 100%, 8px 100%;
  background-attachment: local, local, scroll, scroll;
}

.table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--color-divider);
}

.table th {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions .button_to {
  display: inline-flex;
  max-width: 100%;
  margin: 0;
}

.table-actions .button_to .btn {
  width: 100%;
}

@media (max-width: 720px) {
  .table-panel {
    padding: 12px;
    overflow: visible;
  }

  .table-wrap {
    overflow-x: visible;
    background: none;
  }

  .table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: grid;
    gap: 10px;
  }

  .table tr {
    display: grid;
    gap: 6px;
    padding: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius);
  }

  .table td {
    display: block;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
  }

  .table-actions {
    display: flex;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 2px;
  }

  .table td:last-child:has(.btn) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 2px;
  }

  .table-actions .btn,
  .table-actions .button_to,
  .table-actions .button_to .btn,
  .table td:last-child:has(.btn) .btn,
  .table td:last-child:has(.btn) .button_to {
    width: auto;
    min-width: 0;
  }

  .table-actions .btn,
  .table td:last-child:has(.btn) .btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* Components */
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--color-surface) 30%, transparent),
    linear-gradient(to right, transparent, var(--color-surface) 70%) 100% 0,
    linear-gradient(to right, rgba(0,0,0,0.08), transparent),
    linear-gradient(to left, rgba(0,0,0,0.08), transparent) 100% 0;
  background-repeat: no-repeat;
  background-color: var(--color-surface);
  background-size: 24px 100%, 24px 100%, 8px 100%, 8px 100%;
  background-attachment: local, local, scroll, scroll;
}

.step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.step::before {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  content: attr(data-step);
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.step.is-current {
  color: var(--color-primary);
}

.step.is-current::before {
  color: #ffffff;
  background: var(--color-primary);
}

.step.is-done {
  color: var(--color-success);
}

.step.is-done::before {
  content: "✓";
  color: #ffffff;
  background: var(--color-success);
}

.step-separator {
  flex: 0 0 auto;
  color: var(--color-text-muted);
}

.timer-card {
  text-align: center;
  padding: clamp(26px, 5vw, 44px);
}

.timer-label {
  margin: 0 0 14px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.timer-display {
  color: var(--color-primary);
  font-size: clamp(42px, 8vw, 62px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.object-row,
.doc-row,
.trip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius);
}

.trip-card {
  align-items: flex-start;
  border: 1px solid rgba(21, 128, 61, 0.2);
  background: rgba(21, 128, 61, 0.05);
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notice-box {
  padding: 16px;
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: var(--radius);
}

.notice-box.info {
  background: rgba(0, 71, 65, 0.06);
  border-color: rgba(0, 71, 65, 0.2);
}

.choice-card {
  padding: 22px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
}

.choice-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.upload-zone,
.photo-box {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.upload-zone {
  padding: 38px 18px;
}

.upload-zone:hover,
.photo-box:hover {
  border-color: var(--color-primary);
  background: rgba(0, 71, 65, 0.04);
}

.photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
}

.photo-box {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

.photo-box.is-uploaded {
  border-color: var(--color-success);
  background: rgba(21, 128, 61, 0.04);
}

.photo-preview {
  display: none;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: var(--color-surface-2);
  border-radius: 999px;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.scan-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.scan-entry-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.scan-primary {
  align-content: start;
}

.scan-manual-entry {
  display: grid;
  gap: 10px;
}

@media (max-width: 760px) {
  .scan-primary {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .scan-primary > :nth-child(1) { order: 1; } /* заголовок */
  .scan-primary > .quick-pick   { order: 2; }
  .scan-primary > .scan-manual-entry { order: 3; }
}

.scan-primary .panel-title,
.scan-primary p {
  margin-bottom: 0;
}

.scan-camera-panel {
  display: grid;
  gap: 12px;
}

.qr-reader {
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.scan-camera-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-dev-tools {
  display: grid;
  align-items: stretch;
  grid-template-columns: 1fr;
}

.qr-frame {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px;
  color: var(--color-primary);
  font-size: 44px;
  font-weight: 800;
  background:
    linear-gradient(90deg, rgba(0, 71, 65, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(0, 71, 65, 0.08) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
}

.qr-frame small {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.qr-corners::before,
.qr-corners::after,
.qr-frame::before,
.qr-frame::after {
  position: absolute;
  width: 58px;
  height: 58px;
  content: "";
  border-color: var(--color-primary);
}

.qr-frame::before {
  top: 18px;
  left: 18px;
  border-top: 4px solid;
  border-left: 4px solid;
}

.qr-frame::after {
  top: 18px;
  right: 18px;
  border-top: 4px solid;
  border-right: 4px solid;
}

.qr-corners::before {
  bottom: 18px;
  left: 18px;
  border-bottom: 4px solid;
  border-left: 4px solid;
}

.qr-corners::after {
  right: 18px;
  bottom: 18px;
  border-right: 4px solid;
  border-bottom: 4px solid;
}

.map-panel {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 71, 65, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #f8fbff, #eef6f5);
  background-size: 36px 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.route-line {
  position: absolute;
  top: 52%;
  left: 12%;
  width: 76%;
  height: 6px;
  background: var(--color-primary);
  border-radius: 999px;
  transform: rotate(-8deg);
}

.route-line::before,
.route-line::after {
  position: absolute;
  top: -7px;
  width: 20px;
  height: 20px;
  content: "";
  background: var(--color-primary);
  border: 4px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.route-line::before {
  left: 0;
}

.route-line::after {
  right: 0;
}

.map-pin {
  position: absolute;
  top: 34%;
  left: 18%;
  z-index: 1;
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  background: var(--color-accent);
  border-radius: 999px;
}

.map-pin-end {
  top: 58%;
  left: auto;
  right: 14%;
  background: var(--color-primary);
}

.quick-link {
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
}

.avatar {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: #ffffff;
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 999px;
}

/* Auth */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-body.has-environment-banner {
  padding-top: calc(40px + var(--environment-banner-height));
}

.auth-card {
  width: min(420px, 100%);
  padding: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.auth-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--color-primary);
  font-weight: 700;
}

.auth-link-disabled {
  color: var(--color-text-muted);
  cursor: default;
  font-weight: 700;
}

.auth-links-centered {
  justify-content: center;
}

.auth-intro {
  margin: 0 0 18px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.auth-summary,
.dev-code-box {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.auth-summary strong {
  font-size: 16px;
}

.dev-code-box {
  border-color: rgba(180, 122, 18, 0.32);
  background: rgba(180, 122, 18, 0.08);
}

.dev-code-value {
  color: var(--color-warning);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.field-hint {
  margin-top: 5px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.auth-form {
  gap: 14px;
}

.auth-submit-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.system-banner {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  padding: 9px 16px;
  color: #fff;
  background: var(--color-danger, #dc2626);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.system-banner-warning {
  position: sticky;
  background: var(--color-warning);
}

.system-banner code {
  padding: 2px 6px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 4px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--color-text-muted);
}

.divider::before,
.divider::after {
  flex: 1;
  content: "";
  border-bottom: 1px solid var(--color-divider);
}

.divider span {
  font-size: 12px;
}

.sso-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sso-slot {
  display: block;
  min-width: 0;
}

.sso-slot .sso-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.sso-slot .sso-btn svg {
  flex-shrink: 0;
}

.dev-tools {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed #d97706;
  border-radius: 8px;
}

.dev-tools summary {
  color: #9a5807;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.dev-tools[open] summary {
  margin-bottom: 12px;
}

.dev-tools .muted {
  margin: 0 0 10px;
  font-size: 12px;
}

.dev-tools .field {
  margin-bottom: 10px;
}

.dev-tools-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 10px;
  color: #7c4a03;
  background: #fffbeb;
  border: 1px dashed #d97706;
  border-radius: 8px;
  font-size: 12px;
}

.dev-tools-label {
  flex: 0 0 auto;
  font-weight: 800;
}

.dev-tools-field {
  min-width: 0;
  flex: 1;
  margin: 0;
}

.dev-tools-bar .select {
  min-height: 40px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 12px;
}

.dev-tools-bar .button_to {
  flex: 0 0 auto;
}

.system-health-dots {
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(252, 251, 247, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.system-health-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
}

.system-health-dot.is-backend-down {
  background: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.3);
}

.system-health-dot.is-db-down {
  background: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
}

.system-health-dot.is-migrations-bad {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(180, 122, 18, 0.3);
}

.start-rental-panel {
  display: grid;
  gap: 14px;
}

.start-rental-panel.is-disabled {
  opacity: 0.62;
}

.start-rental-panel.is-disabled .btn-primary {
  pointer-events: none;
}

.start-rental-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.start-rental-main .panel-title,
.start-rental-main p {
  margin-bottom: 0;
}

.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.notifications-head {
  margin-bottom: 12px;
}

.notifications-count-chip {
  margin-left: 8px;
  vertical-align: middle;
  font-size: 14px;
}

.notifications-actions,
.notifications-category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notifications-category-filter {
  margin-bottom: 12px;
}

.notifications-empty {
  padding: 42px;
  text-align: center;
}

.notifications-list-panel {
  padding: 10px;
  overflow: visible;
  display: grid;
  gap: 8px;
}

.notif-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: background 0.3s;
}

.notif-row + .notif-row {
  /* Пришло на смену inline border-top — карточки визуально отделены зазором. */
  margin-top: 0;
}

.notif-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 3px 6px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.16s ease;
}

.notif-row-linkable .notif-row-body {
  cursor: pointer;
}

.notif-row-linkable .notif-row-body:hover,
.notif-row-linkable .notif-row-body:focus-visible {
  background: var(--color-surface-2);
  outline: none;
}

.notif-row-icon {
  flex: 0 0 32px;
  font-size: 1.35rem;
  line-height: 1.2;
  min-width: 32px;
  text-align: center;
  padding-top: 1px;
}

.notif-row-content {
  flex: 1;
  min-width: 0;
}

.notif-row-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 2px;
}

.notif-row-title {
  flex: 1;
  font-size: 14px;
  line-height: 1.25;
}

.notif-row-body-text {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-text-secondary);
}

.notif-row-meta {
  font-size: 11px;
}

.notif-target-hint {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 6px;
  padding: 0 8px;
  color: var(--color-accent);
  background: rgba(61, 110, 142, 0.09);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.notif-row-btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
}

.support-contact-panel {
  margin-top: 18px;
}

.support-contact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.support-feedback-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.support-feedback-actions {
  grid-column: 1 / -1;
}

.support-tickets-page {
  display: grid;
  gap: 16px;
}

.support-tickets-head {
  margin-bottom: 0;
}

.support-tickets-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border: 1px solid rgba(0, 84, 74, 0.14);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
}

.support-ticket-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(18, 35, 32, 0.06);
}

.support-ticket-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  color: var(--color-text-secondary);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.support-ticket-tab:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-2);
}

.support-ticket-tab.is-active {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 8px 18px rgba(0, 84, 74, 0.18);
}

.support-ticket-list-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.support-ticket-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-divider);
}

.support-ticket-list-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.support-ticket-list-head p {
  max-width: 620px;
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.support-ticket-list {
  display: grid;
  gap: 10px;
}

.support-ticket-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(18, 35, 32, 0.06);
}

.support-ticket-main {
  min-width: 0;
}

.support-ticket-topline,
.support-ticket-facts,
.support-ticket-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.support-ticket-id {
  color: var(--color-text-muted);
  font-weight: 800;
}

.support-ticket-date {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 650;
}

.support-ticket-title {
  margin: 9px 0 10px;
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.support-ticket-facts {
  align-items: stretch;
  gap: 8px;
}

.support-ticket-facts span {
  display: grid;
  min-width: min(260px, 100%);
  gap: 2px;
  padding: 8px 10px;
  color: var(--color-text-primary);
  background: var(--color-surface-2);
  border: 1px solid rgba(218, 211, 196, 0.7);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.25;
}

.support-ticket-facts strong {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.support-ticket-preview {
  margin: 10px 0 0;
  padding: 10px 12px;
  color: var(--color-text-secondary);
  background: #fffaf0;
  border: 1px solid rgba(218, 211, 196, 0.72);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.support-ticket-actions {
  justify-content: flex-end;
  align-content: center;
  align-items: flex-end;
  align-self: stretch;
  flex-direction: column;
  min-width: 132px;
}

.support-ticket-actions .btn {
  width: 100%;
  justify-content: center;
}

.support-ticket-empty {
  margin: 0;
}

.support-ticket-detail-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.support-ticket-detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.support-ticket-message {
  padding: 16px;
  white-space: pre-wrap;
  background: var(--color-surface-2);
  border-radius: 8px;
}

@media (max-width: 640px) {
  .notifications-head.page-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .notifications-head .page-kicker {
    display: none;
  }

  .notifications-head .page-title {
    font-size: 22px;
  }

  .notifications-count-chip {
    margin-left: 4px;
    font-size: 12px;
  }

  .notifications-actions,
  .notifications-category-filter {
    gap: 6px;
  }

  .notifications-actions .btn,
  .notifications-category-filter .btn {
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .notifications-empty {
    padding: 28px 16px;
  }

  .notif-row {
    gap: 8px;
    padding: 9px 10px;
  }

  .notif-row-body {
    gap: 9px;
    padding: 0;
  }

  .notif-row-icon {
    flex-basis: 28px;
    min-width: 28px;
    font-size: 1.15rem;
  }

  .notif-row-title {
    font-size: 13px;
  }

  .notif-row-body-text {
    font-size: 12px;
  }

  .notif-row-meta {
    font-size: 10px;
  }

  .notif-row-btn {
    width: auto;
    min-width: 0;
    min-height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  .support-feedback-form,
  .support-ticket-card,
  .support-ticket-detail-facts {
    grid-template-columns: 1fr;
  }

  .support-tickets-page {
    gap: 12px;
  }

  .support-tickets-head.page-head {
    align-items: center;
    gap: 10px;
  }

  .support-tickets-head .page-title {
    font-size: 26px;
  }

  .support-tickets-count {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 15px;
  }

  .support-ticket-tabs {
    width: 100%;
  }

  .support-ticket-tab {
    flex: 1 1 0;
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .support-ticket-list-panel {
    gap: 12px;
    padding: 12px;
  }

  .support-ticket-list-head {
    padding-bottom: 10px;
  }

  .support-ticket-list-head h2 {
    font-size: 18px;
  }

  .support-ticket-list-head p {
    font-size: 12px;
  }

  .support-ticket-card {
    gap: 12px;
    padding: 12px;
  }

  .support-ticket-topline {
    gap: 6px;
  }

  .support-ticket-date {
    font-size: 12px;
  }

  .support-ticket-title {
    font-size: 16px;
  }

  .support-ticket-facts {
    display: grid;
    grid-template-columns: 1fr;
  }

  .support-ticket-facts span {
    min-width: 0;
    padding: 8px;
  }

  .support-ticket-preview {
    padding: 9px;
  }

  .support-ticket-actions {
    align-items: stretch;
    flex-direction: row;
    justify-content: flex-start;
    min-width: 0;
  }

  .support-ticket-actions .btn {
    flex: 1 1 auto;
    min-height: 34px;
    width: auto;
    min-width: min(100%, 96px);
    padding: 0 10px;
    font-size: 12px;
  }

  .support-ticket-detail-panel {
    gap: 12px;
  }

  .support-ticket-message {
    padding: 12px;
    font-size: 13px;
  }
}

.user-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 760px) {
  .user-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.quick-pick {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
}

.quick-pick-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.quick-pick-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 700;
}

.quick-pick-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-height: min(48vh, 360px);
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-width: thin;
}

.quick-pick-grid::-webkit-scrollbar {
  width: 8px;
}

.quick-pick-grid::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 8px;
}

.quick-pick-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.quick-pick-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.quick-pick-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.quick-pick-card-plate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.quick-pick-card-top .chip {
  flex: 0 0 auto;
}

.quick-pick-card-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
}

.quick-pick-card-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.quick-pick-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.quick-pick-card-cta {
  margin-top: 2px;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
}

.rental-dev-tools,
.scan-dev-tools.is-neutral {
  margin-top: 12px;
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.rental-dev-tools .dev-tools-label,
.scan-dev-tools.is-neutral .dev-tools-label {
  color: var(--color-text-primary);
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.sso-btn.is-disabled,
.sso-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.otp-input {
  text-align: center;
  letter-spacing: 6px;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.otp-hint {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.otp-fallback-submit {
  display: none;
}

@media (max-width: 640px) {
  html {
    min-width: 0;
    overflow-x: hidden;
  }

  body.client-body,
  body.auth-body {
    min-width: 0;
    overflow-x: hidden;
  }

  .auth-body {
    align-items: flex-start;
    padding: 54px 0 0;
    background: var(--color-surface);
  }

  .auth-body.has-environment-banner {
    padding-top: calc(54px + var(--environment-banner-height));
  }

  .auth-card {
    width: 100%;
    padding: 24px 20px 28px;
    border: 0;
    box-shadow: none;
  }

  .auth-brand .page-title {
    font-size: 22px;
  }

  .auth-links {
    align-items: center;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .auth-links a {
    min-height: 40px;
    padding: 0 4px;
  }

  .dev-tools-bar,
  .start-rental-main {
    align-items: stretch;
    flex-direction: column;
  }

  .dev-tools-auth,
  .rental-dev-tools,
  .scan-dev-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dev-tools-auth .dev-tools-label,
  .rental-dev-tools .dev-tools-label,
  .scan-dev-tools .dev-tools-label {
    grid-column: 1 / -1;
  }

  .quick-pick-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: none;
  }

  .quick-pick-card {
    padding: 10px 12px;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .dev-tools-auth,
  .rental-dev-tools,
  .scan-dev-tools {
    grid-template-columns: 1fr;
  }

  .dev-tools-auth .btn,
  .rental-dev-tools .btn,
  .scan-dev-tools .btn,
  .dev-tools-auth .select,
  .rental-dev-tools .select,
  .scan-dev-tools .select {
    width: 100%;
  }
}

/* States */
.flash {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-weight: 800;
}

.flash-alert {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.flash-notice {
  color: var(--color-success);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.error-list {
  margin: 0 0 18px;
  padding: 14px 18px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

.empty-state {
  padding: 26px;
  color: var(--color-text-secondary);
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

@media (max-width: 960px) {
  .client-shell {
    display: block;
  }

  .client-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: min(260px, 72vw);
    height: 100dvh;
    max-height: 100dvh;
    padding: 14px 12px calc(10px + env(safe-area-inset-bottom));
    overflow: hidden;
    background: var(--color-surface);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

  /* На мобильном меню — position:fixed с inset:0, поэтому top:0 залезает
     под баннер. Нужно сдвинуть меню НИЖЕ баннера, а не просто урезать
     высоту снизу (иначе внизу остаётся пустая полоса высотой с баннер). */
  body.has-environment-banner .client-sidebar {
    top: var(--environment-banner-height);
    height: calc(100dvh - var(--environment-banner-height));
    max-height: calc(100dvh - var(--environment-banner-height));
  }

  body.sidebar-open .client-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .client-brand {
    min-height: auto;
    padding-bottom: 12px;
  }

  .client-nav {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-bottom: 8px;
    overflow-y: auto;
  }

  .client-sidebar-footer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-divider);
    box-shadow: none;
  }

  .client-sidebar-footer .client-nav-item,
  .client-sidebar-footer .client-nav-button {
    min-height: 42px;
    width: 100%;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
  }

  .client-sidebar-footer .client-nav-item > span:not(.nav-icon),
  .client-sidebar-footer .client-nav-button > span:not(.nav-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .client-sidebar-footer .nav-label-with-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    font-size: 0;
  }

  .client-sidebar-footer .button_to {
    width: 100%;
  }

  .client-sidebar-footer .nav-badge {
    font-size: 10px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid,
  .vehicle-summary,
  .scan-layout,
  .scan-entry-layout,
  .vehicle-detail-layout,
  .rental-odometer-grid {
    grid-template-columns: 1fr;
  }

  .vehicle-facts,
  .vehicle-finance-summary {
    grid-template-columns: 1fr;
  }

  .vehicle-finance-head {
    display: grid;
  }

  .vehicle-finance-total {
    text-align: left;
  }

  .vehicle-finance-form > .field,
  .vehicle-finance-form > .field:nth-child(3),
  .vehicle-finance-submit {
    flex: 1 1 100%;
  }

  .initial-expense-row {
    grid-template-columns: 1fr;
  }

  .rental-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rental-service-note-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 4px;
  }

  .rental-service-note-row .chip {
    width: fit-content;
  }

  .rental-service-note-row .muted {
    white-space: normal;
  }

  .rental-vehicle-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .rental-vehicle-meta {
    width: 100%;
    justify-content: space-between;
    padding-left: 62px;
  }

  .rental-vehicle-meta > span:first-child {
    text-align: left;
  }

  .rental-nearby-grid {
    grid-template-columns: 1fr;
  }

  .rental-finish-fields {
    grid-template-columns: 1fr;
  }

  .rental-odometer-tools,
  .rental-finish-geo-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rental-condition-row,
  .rental-geo-row {
    align-items: stretch;
    flex-direction: column;
  }

  .rental-active-card {
    padding: 12px;
  }

  .rental-active-card .object-row {
    align-items: flex-start;
  }

  .rental-active-card .vehicle-symbol {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .rental-active-card .object-row {
    padding: 8px;
  }

  .rental-active-card .info-row {
    padding: 6px 0;
  }

  .metric {
    padding: 10px;
  }

  .metric-value {
    font-size: 16px;
  }

  .profile-strip {
    padding: 10px 12px;
    gap: 8px;
  }

  .profile-strip strong {
    font-size: 15px;
  }

  .rental-info-grid {
    gap: 8px;
  }

  .rental-info-grid .metric {
    padding: 8px 10px;
  }

  .rental-info-grid .metric-label {
    font-size: 10px;
  }

  .rental-info-grid .metric-value {
    font-size: 14px !important;
    line-height: 1.25;
  }

  .rental-odometer-grid {
    gap: 10px;
  }

  .rental-odometer-photo {
    padding: 10px;
  }

  .rental-odometer-preview {
    max-height: 140px;
  }

  .stepper {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 5px;
    margin-right: -2px;
    margin-left: -2px;
    padding: 10px 8px;
    background: var(--color-surface);
  }

  .step {
    max-width: 92px;
    min-width: 0;
    gap: 5px;
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .step::before {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    font-size: 10px;
  }

  .step-separator {
    font-size: 12px;
  }

  .rental-geo-row .btn {
    width: 100%;
  }

  .vehicle-qr-card {
    width: min(220px, 100%);
  }

  .rental-vehicle-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .rental-vehicle-mileage {
    width: 100%;
    margin-left: 56px;
  }

  .page-head {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .vehicle-hero {
    aspect-ratio: 16 / 9;
  }
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--color-text-primary);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0;
  line-height: 1;
}

.menu-toggle .menu-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-toggle .menu-toggle-icon::before,
.menu-toggle .menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-toggle .menu-toggle-icon::before { top: -6px; }
.menu-toggle .menu-toggle-icon::after { top: 6px; }

.nav-num {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  font-size: 11px;
  border-radius: 6px;
}

.nav-section-title {
  margin: 14px 10px 6px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.status-dot.is-online {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.api-status-dot {
  flex: 0 0 auto;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.api-status-dot.is-online {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.14);
}

.profile-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: none;
}

.profile-strip-main,
.profile-strip-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-strip-name,
.profile-strip-balance {
  display: grid;
  gap: 1px;
}

.profile-strip small {
  color: var(--color-text-muted);
}

.profile-strip strong {
  font-size: 16px;
}

.profile-strip-balance strong {
  color: var(--color-primary);
  font-size: 18px;
}

.compact-panel {
  margin-bottom: 16px;
}

.system-summary-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.compact-stat {
  text-align: center;
}

.compact-stat .stat-value {
  margin: 0;
}

.dispatcher-stat-tiles {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dispatcher-stat-tiles .compact-stat {
  margin-top: 0;
  min-width: 0;
  height: 88px;
  min-height: 88px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
}

.dispatcher-stat-tiles .compact-stat .stat-value {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

.dispatcher-stat-tiles .stat-label {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: nowrap;
  text-wrap: nowrap;
}

@media (max-width: 1180px) {
  .dispatcher-task-grid.grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dispatcher-task-grid > .panel {
    min-width: 0;
  }
}

@media (max-width: 960px) {
  .dispatcher-stat-tiles.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dispatcher-stat-tiles .compact-stat {
    height: 78px;
    min-height: 78px;
    padding: 10px 6px;
  }

  .dispatcher-stat-tiles .compact-stat .stat-value {
    font-size: 23px;
  }

  .dispatcher-stat-tiles .compact-stat .stat-label {
    font-size: 10px;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: nowrap;
    text-wrap: nowrap;
  }
}

@media (max-width: 640px) {
  .dispatcher-task-grid.grid-2 {
    gap: 10px;
  }

  .dispatcher-task-grid > .panel {
    padding: 14px;
    border-radius: 14px;
  }

  .dispatcher-task-grid .panel-title {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .dispatcher-task-grid a[style*="space-between"],
  .dispatcher-task-grid a[style*="justify-content:space-between"],
  .dispatcher-task-grid a[style*="justify-content: space-between"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px !important;
    min-width: 0;
    padding: 7px 0 !important;
  }

  .dispatcher-task-grid a[style*="space-between"] > span,
  .dispatcher-task-grid a[style*="justify-content:space-between"] > span,
  .dispatcher-task-grid a[style*="justify-content: space-between"] > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .dispatcher-task-grid a[style*="space-between"] > span:last-child,
  .dispatcher-task-grid a[style*="justify-content:space-between"] > span:last-child,
  .dispatcher-task-grid a[style*="justify-content: space-between"] > span:last-child {
    max-width: 46vw;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .system-summary-panel {
    padding: 14px;
  }

  .system-summary-panel .panel-title {
    margin-bottom: 10px;
    font-size: 16px;
  }

  .system-summary-grid.grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .system-summary-grid .metric {
    min-height: 0;
    padding: 10px;
  }

  .system-summary-grid .metric-label {
    min-height: 28px;
    font-size: 11px;
    line-height: 1.25;
  }

  .system-summary-grid .metric-value {
    margin-top: 4px;
    font-size: 20px;
  }

  .actions.system-summary-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .actions.system-summary-actions .system-summary-link {
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--color-primary);
    font-size: 13px;
  }

  .stat-tiles.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-tiles .compact-stat {
    padding: 10px 6px;
    border-radius: 14px;
  }

  .stat-tiles .compact-stat .stat-value {
    margin-bottom: 4px;
    font-size: 22px;
  }

  .stat-tiles .compact-stat .stat-label {
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .dispatcher-stat-tiles.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dispatcher-stat-tiles .compact-stat {
    height: 70px;
    min-height: 70px;
    padding: 9px 6px;
    border-radius: 12px;
  }

  .dispatcher-stat-tiles .compact-stat .stat-value {
    font-size: 21px;
  }

  .dispatcher-stat-tiles .compact-stat .stat-label {
    font-size: 8px;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: nowrap;
    text-wrap: nowrap;
  }
}

.rental-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(0, 71, 65, 0.38);
}

.rental-metric {
  padding: 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
}

.rental-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
}

.start-card {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 210px;
  text-align: center;
}

.start-card .panel-title,
.start-card p {
  margin-bottom: 0;
}

.trip-list,
.todo-list {
  display: grid;
  gap: 8px;
}

.trip-row,
.todo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
}

a.trip-row-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.trip-row-secondary {
  text-align: right;
}

.trip-history-head {
  margin-bottom: 14px;
}

.trip-history-title {
  min-width: 0;
}

.trip-history-title .panel-title,
.trip-history-title p {
  margin-bottom: 0;
}

.trip-history-total {
  text-align: right;
}

.trip-history-total strong {
  font-size: 24px;
}

.trip-history-total .muted {
  font-size: 14px;
}

@media (max-width: 640px) {
  .trip-history-head.page-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }

  .trip-history-head.page-head > :first-child,
  .trip-history-head.page-head > :last-child:not(:first-child) {
    flex: initial;
  }

  .trip-history-title {
    flex: 1 1 auto;
  }

  .trip-history-title .panel-title {
    margin-bottom: 2px;
    font-size: 16px;
  }

  .trip-history-title p {
    font-size: 12px;
  }

  .trip-history-total {
    display: inline-grid;
    place-items: center;
    min-width: 48px;
    padding: 6px 8px;
    text-align: center;
    background: var(--color-surface-2);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius);
  }

  .trip-history-total strong {
    font-size: 18px;
    line-height: 1;
  }

  .trip-history-total .muted {
    max-width: 44px;
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.1;
  }

  .trip-list {
    gap: 6px;
  }

  .trip-row {
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .trip-row > :first-child {
    min-width: 0;
  }

  .trip-row-secondary {
    flex-shrink: 0;
    text-align: right;
  }
}

a.trip-row-link:hover,
a.trip-row-link:focus-visible {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
  outline: none;
}

/* Mobile design language on the web dashboard */
.dashboard-page-client {
  width: min(820px, 100%);
  margin-inline: auto;
}

.dashboard-page-staff {
  display: flex;
  flex-direction: column;
}

.dashboard-page-staff .dashboard-heading {
  order: -2;
}

.dashboard-page-staff .dispatcher-tasks {
  order: -1;
  margin-top: 0 !important;
  margin-bottom: 16px;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  margin-bottom: 32px;
}

.document-summary-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.document-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.document-card-actions > .btn,
.document-card-actions > form,
.document-card-actions > form .btn {
  width: 100%;
  min-width: 0;
}

.document-delete-form {
  display: block;
  margin: 0;
}

.dashboard-heading-client {
  margin-bottom: 14px;
}

.dashboard-heading-client .page-kicker {
  display: none;
}

.dashboard-heading-client .page-title {
  font-size: 24px;
}

.dashboard-page-client .profile-strip {
  min-height: 88px;
}

.profile-status-chip svg {
  flex: 0 0 auto;
}

.start-rental-panel {
  padding: clamp(18px, 3vw, 24px);
}

.start-rental-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.start-rental-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  color: var(--color-primary);
  background: rgba(0, 71, 65, 0.1);
  border-radius: var(--radius);
}

.action-icon {
  width: 26px;
  height: 26px;
}

.dashboard-page-client .rental-hero {
  box-shadow: none;
}

.dashboard-page-client .trip-list {
  gap: 10px;
}

.dashboard-page-client .trip-row {
  background: var(--color-surface);
  border-radius: var(--radius);
}

@media (max-width: 640px) {
  .documents-grid {
    grid-template-columns: 1fr;
  }

  .document-card-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-heading-client {
    display: none;
  }

  .dashboard-page-client .profile-strip {
    padding: 14px 16px;
    border-radius: var(--radius);
  }

  .dashboard-page-client .profile-strip-stats {
    align-items: center;
  }

  .profile-status-chip span {
    display: none;
  }

  .start-rental-main {
    align-items: stretch;
  }

  .start-rental-copy {
    align-items: flex-start;
  }

  .start-rental-main > .btn,
  .start-rental-main > .button_to {
    width: 100%;
  }

  .start-rental-main > .btn,
  .start-rental-main > .button_to .btn {
    width: 100%;
  }
}

.todo-group {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.todo-title {
  margin: 0;
  font-weight: 800;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.vehicle-table-plate,
.vehicle-table-name {
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.user-profile-card {
  display: grid;
  gap: 16px;
}

.user-profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-divider);
}

.user-profile-card-head .panel-title {
  margin-bottom: 4px;
}

.user-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.user-profile-item {
  min-width: 0;
  padding: 12px 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
}

.user-profile-item-wide {
  grid-column: span 2;
}

.user-profile-item dt {
  margin-bottom: 6px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-profile-item dd {
  min-width: 0;
  margin: 0;
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.user-profile-money {
  color: var(--color-primary) !important;
  font-size: 18px !important;
}

.user-profile-yes,
.user-profile-no {
  font-weight: 800;
}

.user-profile-yes {
  color: var(--color-success);
}

.user-profile-no {
  color: var(--color-danger);
}

.profile-status-line {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Баннер статуса аккаунта на странице профиля */
.status-banner {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--color-border);
}
.status-banner strong { display: inline; }
.status-banner--warn {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.45);
  color: #92400e;
}
.status-banner--danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.40);
  color: #991b1b;
}

.profile-secure-edit {
  border-bottom: 1px solid var(--color-divider, var(--color-border));
}

.profile-secure-edit:last-child {
  border-bottom: none;
}

.profile-secure-edit > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 14px 0;
}

.profile-secure-edit > summary::-webkit-details-marker {
  display: none;
}

.profile-secure-edit-body {
  padding: 0 0 16px;
}

.form-grid--password {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
}

.password-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.password-input-row .input {
  flex: 1;
  min-width: 0;
}

.password-check-message.is-error {
  color: var(--color-danger, #dc2626);
}

.user-role-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
}

.user-role-editor strong {
  display: block;
  margin-bottom: 3px;
}

.user-role-editor p {
  margin: 0;
  font-size: 12px;
}

.user-role-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-role-form .select {
  min-width: 180px;
}

@media (max-width: 960px) {
  .user-profile-card-head,
  .user-role-editor,
  .user-role-form {
    display: grid;
  }

  .user-profile-grid {
    grid-template-columns: 1fr;
  }

  .user-profile-item-wide {
    grid-column: auto;
  }

  .user-role-form .select {
    min-width: 0;
    width: 100%;
  }
}

.pref-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.pref-nav {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 6px;
  padding: 10px;
  min-width: 0;
}

.pref-nav a {
  min-height: 34px;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  color: var(--color-text-secondary);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
}

.pref-nav a:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-2);
}

.pref-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.pref-section {
  scroll-margin-top: 86px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head .panel-title,
.panel-head p {
  margin-bottom: 0;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.theme-option {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  padding: 12px;
  color: var(--color-text-primary);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.theme-option.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 71, 65, 0.12);
}

.theme-option strong,
.theme-option small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.theme-option > span:not(.theme-swatch) {
  min-width: 0;
}

.date-parts {
  display: grid;
  grid-template-columns: minmax(76px, 0.7fr) minmax(132px, 1.25fr) minmax(94px, 0.9fr);
  gap: 8px;
}

.date-parts .select {
  min-width: 0;
}

.date-parts-error {
  display: none;
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 700;
}

.date-parts.is-invalid + .date-parts-error {
  display: block;
}

.theme-option small {
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.theme-swatch {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.theme-swatch-standard {
  background: linear-gradient(135deg, #004741 0 50%, #f0ede4 50% 100%);
}

.theme-swatch-compact {
  background: linear-gradient(135deg, #123c36 0 50%, #eef2f4 50% 100%);
}

.theme-swatch-clear {
  background: linear-gradient(135deg, #1d4f45 0 50%, #f6f7f8 50% 100%);
}

.pref-list {
  display: grid;
  gap: 10px;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius);
}

.pref-row p {
  margin: 4px 0 0;
}

.pref-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex;
  }

  .pref-layout {
    grid-template-columns: 1fr;
  }

  .pref-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .pref-nav {
    grid-template-columns: 1fr;
  }

  .theme-option {
    align-items: flex-start;
    min-height: 0;
  }

  .password-input-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .profile-strip,
  .profile-strip-main,
  .profile-strip-stats,
  .todo-row {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .profile-strip-stats,
  .todo-row > :last-child {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .client-topbar {
    align-items: center;
    flex-direction: row;
    min-height: 52px;
    gap: 10px;
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-left: calc(12px + env(safe-area-inset-left));
  }

  .client-user {
    margin-left: auto;
    gap: 8px;
  }

  .client-user > .muted,
  .client-user > .client-user-name,
  .client-user > .service-status-chip,
  .client-user > .button_to {
    display: none;
  }

  /* На узком экране прячем "Добро пожаловать," — оставляем только имя,
     чтобы его не приходилось обрезать многоточием. */
  .topbar-hello {
    display: none;
  }

  .topbar-greeting {
    font-size: 15px;
  }

  .topbar-name {
    color: var(--color-text-primary);
    font-weight: 800;
  }

  .date-parts {
    grid-template-columns: 1fr;
  }

  .client-content {
    padding: 14px calc(12px + env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  }

  .page-head {
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .page-head > :first-child {
    min-width: 0;
    flex: 1 1 100%;
  }

  .page-head > :last-child:not(:first-child) {
    flex: 1 1 100%;
    flex-shrink: 0;
  }

  .page-head > .actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
    gap: 8px;
  }

  .page-head > .actions .btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .active-rental-head > :first-child,
  .active-rental-head > :last-child:not(:first-child),
  .rental-step-head > :first-child,
  .rental-step-head > :last-child:not(:first-child) {
    flex: initial;
  }

  .active-rental-head,
  .rental-step-head {
    align-items: center;
    justify-content: space-between;
  }

  .active-rental-head > .btn,
  .rental-step-head > .btn {
    width: auto;
    min-height: 34px;
    padding: 0 12px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-subtitle {
    display: none;
  }

  .client-nav,
  .choice-actions {
    grid-template-columns: 1fr;
  }

  .actions,
  .actions-between,
  .row-top,
  .object-row,
  .doc-row,
  .trip-card,
  .split-row,
  .info-row {
    align-items: stretch;
    flex-direction: column;
  }

  .split-row > :last-child,
  .info-row > :last-child {
    text-align: left;
  }

  .btn {
    width: auto;
  }

  .actions .btn,
  .actions .button_to {
    width: 100%;
  }

  .page-head > .btn,
  .page-head > .actions,
  .client-topbar .btn {
    width: auto;
  }

  .page-head > .rental-photo-head-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .rental-photo-head-actions .btn,
  .rental-photo-head-actions .button_to {
    width: 100%;
    min-width: 0;
  }

  .chip {
    width: fit-content;
  }

  .profile-strip {
    gap: 10px;
    margin-bottom: 12px;
  }

  .profile-strip-stats {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .profile-strip-balance strong {
    font-size: 19px;
  }

  .start-card {
    min-height: 150px;
  }

  .panel {
    padding: 13px;
  }

  .metric {
    min-height: 58px;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .table {
    min-width: 560px;
  }

  .table-wrap .table,
  .table-panel .table {
    min-width: 0;
  }
}

@media (max-width: 360px) {
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Vehicle finance: form and summary must never define the page width on iPhone. */
@media (max-width: 640px) {
  .vehicle-finance-card {
    max-width: 100%;
    overflow: hidden;
  }

  .vehicle-finance-card * {
    min-width: 0;
  }

  .vehicle-finance-head,
  .vehicle-finance-summary,
  .vehicle-finance-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .vehicle-finance-summary {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .vehicle-finance-summary .info-row {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .vehicle-finance-summary .info-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .vehicle-finance-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .vehicle-finance-form > .field,
  .vehicle-finance-form > .field:nth-child(3),
  .vehicle-finance-submit {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: initial !important;
  }

  .vehicle-finance-submit .btn {
    width: 100%;
  }

  .vehicle-finance-history {
    max-width: 100%;
    overflow: hidden;
  }

  .vehicle-finance-history .table {
    min-width: 0;
  }

  .vehicle-expense-user strong,
  .vehicle-expense-description {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .vehicle-finance-history .table td[data-label] {
    align-items: flex-start;
    text-align: right;
  }

  .vehicle-finance-history .table td[data-label] > :last-child,
  .vehicle-finance-history .table td[data-label] strong {
    min-width: 0;
  }

  .vehicle-rentals-card {
    max-width: 100%;
    overflow: hidden;
  }

  .vehicle-rentals-table {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .vehicle-rentals-table .table,
  .vehicle-rentals-table .table tbody,
  .vehicle-rentals-table .table tr {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .vehicle-rentals-table .table tr {
    box-sizing: border-box;
  }

  .vehicle-rentals-table .table td {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .vehicle-rentals-table .cell-actions .btn {
    width: auto;
  }
}

/* ── Admin Settings ──────────────────────────────────── */
.settings-section { margin-top: 24px; }
.settings-section--warning {
  border-left: 3px solid var(--color-warning);
  background: rgba(180, 83, 9, 0.04);
}
.settings-toggle-list { display: flex; flex-direction: column; gap: 2px; }
.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
}
.settings-toggle-row:last-child { border-bottom: none; }
.settings-toggle-row input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }
.settings-toggle-row p { margin: 2px 0 0; font-size: 13px; }
.settings-toggle-row--field { cursor: default; justify-content: space-between; }
.settings-code-list { display: flex; flex-direction: column; gap: 6px; }
.settings-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-surface-2);
  border-radius: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}
.settings-code-row code {
  min-width: 0;
  font-family: monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ── Tabs ─────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid var(--color-divider);
  padding-bottom: 0;
}
.tab-item {
  min-width: 0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-radius: 4px 4px 0 0;
  transition: color 0.15s, border-color 0.15s;
}
.tab-item:hover { color: var(--color-text-primary); }
.tab-item.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--color-divider);
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.tab-item.is-active .tab-count {
  background: var(--color-primary);
  color: white;
}

/* ── Settings redesign ──────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.settings-nav-item {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary, var(--color-muted));
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.settings-nav-item:hover { background: var(--color-surface-2, var(--color-bg)); color: var(--color-text); }
.settings-nav-item.is-active { background: var(--color-primary); color: #fff; }
.settings-nav-item--warn { color: var(--color-warning, #f59e0b); }
.settings-nav-item--warn.is-active { background: var(--color-warning, #f59e0b); color: #000; }

.settings-content { display: flex; flex-direction: column; gap: 20px; }

.settings-panel { padding: 20px 24px; }
.settings-panel--warn { border-left: 3px solid var(--color-warning, #f59e0b); }

.settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.settings-panel-head .panel-title { margin-bottom: 2px; }

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  align-self: end;
}
.pending-actions .button_to { margin: 0; }

.settings-rows { display: flex; flex-direction: column; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-divider, var(--color-border));
}
.settings-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-row:first-child { padding-top: 0; }

.settings-row--field { cursor: default; }
.settings-row--col { flex-direction: column; align-items: stretch; gap: 8px; }

/* Для <details> строк: summary остаётся горизонтальным даже внутри --col,
   иначе Email/Телефон/Telegram растягиваются на весь экран. */
.settings-row--col > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Компактная строка Telegram (без кнопки): текст в ряд, а не столбцом. */
.settings-row--col > .settings-row-text {
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
}

@media (max-width: 640px) {
  .settings-row {
    padding: 10px 0;
    gap: 10px;
  }
  .profile-secure-edit > summary {
    padding: 10px 0;
    gap: 10px;
  }
  .settings-row-text strong { font-size: 13px; }
  .settings-row-text .muted { font-size: 12px; line-height: 1.3; }
  .profile-secure-edit-body { padding-bottom: 12px; }
  .settings-key-row {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-key-row .btn,
  .settings-key-row input {
    width: 100%;
  }
  .settings-textarea {
    min-height: 220px;
    font-size: 12px;
  }
}

.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.settings-row-text strong { font-size: 14px; font-weight: 600; }
.settings-row-text .muted { font-size: 13px; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: inline-flex;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--color-border);
  transition: background 0.2s;
  position: relative;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform 0.2s;
}
.toggle-switch input:checked ~ .toggle-track { background: var(--color-primary); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(18px); }

.settings-input-sm { width: 80px; text-align: center; }
.settings-input-otp { width: 90px; font-family: monospace; font-size: 18px; letter-spacing: 4px; text-align: center; }
.settings-input-key { flex: 1; font-family: monospace; font-size: 13px; }
.settings-input-url { width: 100%; font-size: 13px; }
.settings-select { width: auto; }
.settings-textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  line-height: 1.45;
  white-space: pre-wrap;
}

.settings-key-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.settings-key-row--history {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-divider, var(--color-border));
  flex-wrap: wrap;
}
.settings-key-row--history:last-child { border-bottom: none; }
.settings-key-history { margin-top: 16px; }

.settings-integration-block { padding-top: 4px; }
.settings-integration-block + .settings-integration-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-divider, var(--color-border));
}
.settings-integration-block--prompt .settings-save-row {
  justify-content: flex-start;
}
.settings-ai-prompt-row {
  margin-top: 12px;
  padding-bottom: 0;
  border-bottom: none;
}
.settings-integration-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.settings-integration-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-integration-head strong { font-size: 15px; }

.settings-save-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  margin-top: 4px;
}

.settings-nav-divider { height: 1px; background: var(--color-divider, var(--color-border)); margin: 4px 0; }
.settings-input-md { min-width: 160px; }
.settings-input-mono { font-family: monospace; }
.settings-key-history-title { font-size: 12px; margin-bottom: 6px; }
.settings-key-name { font-size: 12px; }
.settings-key-chip { font-size: 11px; }
.settings-key-date { font-size: 12px; margin-left: auto; }

/* ── Mode banner ────────────────────────────────────────── */
.mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.mode-banner--fleet_lite {
  border-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245,158,11,0.10), rgba(245,158,11,0.02));
}
.mode-banner--rental_full {
  border-color: var(--color-primary);
  background: linear-gradient(90deg, rgba(0,71,65,0.08), rgba(0,71,65,0.01));
}
.mode-banner-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.mode-banner-kicker {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-secondary, var(--color-muted));
  margin: 0;
}
.mode-banner-title { font-size: 22px; margin: 0; }
.mode-banner-hint { font-size: 13px; margin: 0; color: var(--color-text-secondary, var(--color-muted)); }
.mode-banner-chip {
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.mode-banner-chip--fleet_lite  { background: #f59e0b; color: #000; }
.mode-banner-chip--rental_full { background: var(--color-primary); color: #fff; }

/* ── Locked panels/rows (fleet_lite overrides) ──────────── */
.settings-panel--locked { position: relative; }
.settings-panel--locked .settings-panel-head p.muted strong { color: #f59e0b; }
.settings-row--locked { opacity: 0.55; }
.settings-lock-hint {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(245,158,11,0.15);
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: fit-content;
}
.toggle-switch--disabled { cursor: not-allowed; }
.toggle-switch--disabled .toggle-track { opacity: 0.6; }

/* Save row чуть выразительнее */
.settings-save-row { border-top: 1px solid var(--color-divider, var(--color-border)); }

/* ── Sticky save bar (всегда видна пока редактируешь) ─── */
.settings-save-row--sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px 10px 0 0;
  padding: 12px 16px;
  margin-top: 8px;
  box-shadow: 0 -6px 16px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.settings-save-status {
  font-size: 13px;
  color: var(--color-text-secondary, var(--color-muted));
}
.settings-save-row--sticky.is-dirty {
  border-color: var(--color-primary);
  background: linear-gradient(0deg, var(--color-surface), var(--color-surface));
  box-shadow: 0 -8px 20px rgba(0,71,65,0.10);
}
.settings-save-row--sticky.is-dirty .settings-save-status {
  color: #b45309;
  font-weight: 600;
}
.settings-save-row--sticky.is-dirty .settings-save-status::before {
  content: "●";
  margin-right: 6px;
  color: #f59e0b;
}

/* ── Mode picker: две карточки-сегмента ────────────────── */
.mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.mode-card:hover { border-color: var(--color-primary); }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.mode-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.mode-card-title { font-size: 15px; font-weight: 700; color: var(--color-text); }
.mode-card-hint {
  font-size: 12px;
  color: var(--color-text-secondary, var(--color-muted));
  line-height: 1.35;
}
.mode-card-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.15s;
}
.mode-card.is-active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(0,71,65,0.06), rgba(0,71,65,0.01));
  box-shadow: 0 0 0 3px rgba(0,71,65,0.10);
}
.mode-card.is-active .mode-card-check {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ── Collapsible «Модули» (когда заблокировано) ──────── */
.settings-collapsible { padding: 0; }
.settings-collapsible-summary {
  list-style: none;
  cursor: pointer;
  padding: 4px 0;
  display: block;
}
.settings-collapsible-summary::-webkit-details-marker { display: none; }
.settings-collapsible-chevron {
  font-size: 18px;
  color: var(--color-text-secondary, var(--color-muted));
  transition: transform 0.15s;
  align-self: center;
}
.settings-collapsible[open] .settings-collapsible-chevron { transform: rotate(180deg); }
.settings-collapsible[open] .settings-rows { margin-top: 14px; }

@media (max-width: 700px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .mode-banner { flex-direction: column; align-items: flex-start; }
  .mode-picker { grid-template-columns: 1fr; }
  .settings-save-row--sticky {
    flex-direction: row;
    padding: 10px 12px;
    border-radius: 8px 8px 0 0;
  }
  .settings-save-status { font-size: 12px; }
}

/* ── Vehicle Type Configs ───────────────────────────────── */
.vtc-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
}

.vtc-config-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 380px) 213px;
  gap: 18px;
  padding: 11px 16px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-divider);
  background: color-mix(in srgb, var(--color-surface-2) 54%, var(--color-surface));
}

.vtc-config-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 380px) 213px;
  align-items: center;
  gap: 18px;
  margin-top: 0;
  padding: 12px 16px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.vtc-config-card + .vtc-config-card {
  border-top: 1px solid var(--color-divider);
}

.vtc-config-grid > .vtc-config-card {
  margin-top: 0;
}

.vtc-config-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vtc-config-title h2 {
  margin: 0;
  min-width: 0;
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.vtc-config-title code {
  min-width: 0;
  max-width: 100%;
  padding: 3px 8px;
  color: var(--color-text-muted);
  background: var(--color-surface-2, var(--color-bg));
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.vtc-config-title .chip {
  font-size: 11px;
}

.vtc-config-description {
  margin: 5px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.vtc-config-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.vtc-stat {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px 8px;
  background: var(--color-surface-2);
  border: 1px solid rgba(218, 211, 196, 0.72);
  border-radius: 7px;
}

.vtc-stat span {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
}

.vtc-stat strong {
  color: var(--color-text-primary);
  font-size: 18px;
  line-height: 1;
}

.vtc-stat small {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.vtc-config-actions {
  display: grid;
  grid-template-columns: 92px 113px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 0;
  border-top: 0;
}

.vtc-config-actions .button_to {
  display: inline-flex;
  max-width: 100%;
}

.vtc-config-actions .btn,
.vtc-config-actions .button_to,
.vtc-config-actions .button_to .btn,
.vtc-used-label {
  width: 100%;
  min-height: 34px;
}

.vtc-used-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.vtc-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}

.vtc-empty h3,
.vtc-empty p {
  margin: 0;
}

.vtc-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.vtc-slot-card {
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  padding: 11px 13px;
  background: var(--color-surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.vtc-slot-card:hover { border-color: var(--color-primary); }
.vtc-slot-card.is-active {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.vtc-slot-check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}
.vtc-slot-check input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--color-primary);
}
.vtc-slot-label { font-size: 13px; font-weight: 600; line-height: 1.3; }

.vtc-slot-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-divider);
}

.input-sm { font-size: 13px; padding: 4px 8px; height: 30px; }
.select-sm { font-size: 13px; padding: 3px 6px; height: 30px; }

@media (max-width: 640px) {
  .vtc-config-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .vtc-config-head {
    display: none;
  }

  .vtc-config-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }

  .vtc-config-card + .vtc-config-card {
    border-top: 1px solid var(--color-border);
  }

  .vtc-config-grid > .vtc-config-card {
    margin-top: 0;
  }

  .vtc-config-title {
    gap: 6px;
  }

  .vtc-config-title h2 {
    flex-basis: 100%;
    font-size: 18px;
  }

  .vtc-config-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .vtc-stat {
    padding: 8px;
  }

  .vtc-stat span {
    font-size: 10px;
  }

  .vtc-stat strong {
    font-size: 20px;
  }

  .vtc-stat small {
    font-size: 11px;
  }

  .vtc-config-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--color-divider);
  }

  .vtc-config-actions .btn,
  .vtc-config-actions .button_to,
  .vtc-config-actions .button_to .btn {
    min-height: 34px;
    min-width: 0;
  }

  .vtc-used-label {
    min-height: 34px;
    padding: 0 8px;
  }
}

@media (max-width: 640px) {
  .notifications-head.page-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .notifications-head.page-head > :first-child {
    flex: 1 1 100%;
  }

  .notifications-head.page-head > :last-child:not(:first-child) {
    flex: 1 1 100%;
  }

  .notifications-actions {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
  }

  .notifications-actions .btn,
  .notifications-category-filter .btn {
    width: auto;
  }
}

/* ── Компактные фильтры (поиск + селекты) ───────────────── */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.filters-grid .field-search {
  grid-column: 1 / -1;
}
.filters-grid .field-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

@media (max-width: 640px) {
  .filters-panel {
    padding: 12px;
  }
  .filters-grid {
    gap: 10px;
  }
  .filters-grid .label {
    font-size: 12px;
  }
  .filters-grid .field-actions .btn {
    flex: 1;
  }
}

/* ── Таблицы-карточки на мобилке: подпись слева, значение справа ── */
@media (max-width: 640px) {
  .table tr {
    padding: 12px;
  }

  .table td[data-label] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--color-divider);
    font-size: 13px;
    text-align: right;
  }
  .table td[data-label]:last-child {
    border-bottom: 0;
  }
  .table td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
  }

  .table td.cell-primary {
    display: block;
    margin-bottom: 4px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--color-divider);
  }
  .table td.cell-primary strong {
    font-size: 15px;
  }

  .table td.cell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
  }
}

/* ── Строки тарифов (шаблоны) ───────────────────────────── */
.tier-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-divider);
}
.tier-row:last-child {
  border-bottom: 0;
}
.tier-row-main {
  flex: 2;
  min-width: 0;
}
.tier-row-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.tier-row-name strong {
  font-size: 14px;
}
.tier-chip-default {
  font-size: 10px;
  padding: 1px 5px;
}
.tier-row-desc {
  margin-top: 1px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tier-row-vtype {
  width: 90px;
  min-width: 0;
  flex-shrink: 0;
}
.tier-vtype-label {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.tier-row-prices {
  flex: 2;
  min-width: 0;
}
.tier-prices-value {
  font-size: 13px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.tier-prices-empty {
  font-size: 12px;
}
.tier-row-status {
  width: 80px;
  flex-shrink: 0;
  text-align: center;
}
.tier-row-status .chip {
  font-size: 11px;
}
.tier-row-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tier-row-actions .button_to {
  display: inline-flex;
  max-width: 100%;
}

/* Фильтр тарифов */
.tier-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.tier-filters .field-search {
  flex: 1 1 240px;
  min-width: 0;
}
.tier-filters-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}

.tier-filters-form .field {
  min-width: 0;
}
.tier-filters-form .field-actions .btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  /* Тариф → компактная карточка: имя и цены на всю ширину,
     тип + статус + действие уходят в одну нижнюю строку. */
  .tier-row {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius);
  }
  .tier-row:last-child {
    border-bottom: 1px solid var(--color-divider);
  }
  .tier-row-main {
    flex: 1 1 100%;
    order: 1;
  }
  .tier-row-desc {
    white-space: normal;
  }
  .tier-row-prices {
    flex: 1 1 100%;
    order: 2;
  }
  .tier-row-vtype {
    order: 3;
    width: auto;
  }
  .tier-row-vtype .tier-vtype-label::before {
    content: "Тип: ";
    color: var(--color-text-muted);
  }
  .tier-row-status {
    order: 4;
    width: auto;
    text-align: left;
  }
  .tier-row-actions {
    order: 5;
    min-width: 0;
    margin-left: auto;
  }
  .tier-row-actions .button_to,
  .tier-row-actions .button_to .btn {
    width: auto;
  }
  .tier-row-actions .btn {
    min-height: 34px;
  }

  /* Фильтр тарифов на мобилке */
  .tier-filters {
    gap: 10px;
  }
  .tier-filters .field-search {
    flex-basis: 100%;
  }
  .tier-filters-form {
    flex: 1 1 100%;
    gap: 10px;
  }
  .tier-filters-form .field {
    flex: 1;
    min-width: 0;
  }
  .tier-filters-form .field-actions {
    flex: 0 0 auto;
  }
  .tier-filters-form .field-actions .btn {
    min-height: 40px;
  }
}

/* Final mobile overrides for rental OCR screens.
   These stay at the end so shared grid/stepper rules cannot stretch the page after photo upload. */
@media (max-width: 760px) {
  .stepper {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px 8px !important;
    max-width: 100% !important;
    overflow: visible !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 10px !important;
    background: var(--color-surface) !important;
    background-image: none !important;
    box-sizing: border-box !important;
  }

  .step {
    flex: 0 1 auto !important;
    max-width: none !important;
    min-width: 0 !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .step::before {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
    font-size: 10px !important;
  }

  .step-separator {
    flex: 0 0 auto !important;
    font-size: 11px !important;
    line-height: 20px !important;
    align-self: center !important;
  }

  .rental-odometer-panel {
    max-width: 100%;
    overflow: hidden;
  }

  .rental-odometer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .rental-odometer-photo {
    width: 100%;
    max-width: 100%;
    padding: 10px !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  .rental-photo-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: center;
  }

  .rental-photo-actions .btn {
    min-width: 0;
    width: 100%;
  }

  .rental-photo-actions .chip {
    min-width: 0;
    width: fit-content;
    white-space: normal;
  }

  .rental-end-ocr-actions {
    grid-template-columns: 1fr !important;
  }

  .rental-odometer-preview {
    display: block;
    width: 100% !important;
    max-width: 100%;
    max-height: 150px !important;
  }

  .odometer-ocr-panel {
    padding: 10px;
  }

  .odometer-ocr-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .odometer-ocr-panel-head .btn {
    width: 100%;
  }

  .odometer-ocr-raw pre {
    max-height: 160px;
    font-size: 10px;
  }

  .rental-dev-photo-button {
    width: 100%;
    justify-self: stretch;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .ocr-modal {
    width: 100%;
    padding: 14px;
  }

  .ocr-modal-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .ocr-modal-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .ocr-modal-actions .btn {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
    font-size: 12px;
  }

  .ocr-photo-panel {
    gap: 8px;
  }

  .ocr-photo-panel img {
    max-height: 220px !important;
  }

  .ocr-result-card {
    padding: 10px;
  }

  .ocr-result-raw pre {
    max-height: 150px;
    font-size: 11px;
  }

  .rental-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .rental-info-grid .metric {
    min-width: 0;
    padding: 8px !important;
    border-radius: 6px;
  }

  .rental-info-grid .metric-label {
    font-size: 9px !important;
    line-height: 1.2;
  }

  .rental-info-grid .metric-value {
    font-size: 13px !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .rental-detail-layout {
    gap: 10px;
    margin-top: 12px;
  }

  .rental-detail-main,
  .rental-payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .rental-detail-layout .metric {
    min-height: auto;
    padding: 10px !important;
    border-radius: 8px;
  }

  .rental-detail-layout .metric-label {
    font-size: 10px !important;
    line-height: 1.2;
  }

  .rental-detail-layout .metric-value {
    font-size: 14px !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .rental-trip-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .rental-trip-point {
    min-height: 68px;
    padding: 10px;
    border-radius: 8px;
  }

  .rental-trip-point strong {
    font-size: 14px;
  }

  .rental-photo-review-section {
    margin-top: 14px;
  }

  .rental-photo-review-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .rental-photo-review-card {
    grid-template-columns: minmax(94px, 36%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px;
  }

  .rental-photo-review-frame {
    aspect-ratio: 1;
    padding: 5px;
  }

  .rental-photo-review-meta {
    display: grid;
    gap: 3px;
    align-content: center;
    font-size: 12px;
  }

  .rental-photo-review-meta strong {
    font-size: 14px;
    line-height: 1.15;
  }
}

/* ============================================================
   Мобильный полишинг: правки для узких экранов ≤640px
   ============================================================ */
@media (max-width: 640px) {
  /* Заголовки панелей: длинный подзаголовок в <span> уходит на новую
     строку, а не сжимается рядом (диспетчер: «Активные аренды» +
     «страница обновляется…»). */
  .panel-title {
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 17px;
    line-height: 1.25;
  }
  .panel-title > span:not(.chip):not(.nav-badge):not(.notification-badge) {
    flex-basis: 100%;
    margin-left: 0 !important;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
  }

  /* Строки типа "название — номер" внутри диспетчерских панелей
     (свободные машины, зависшие аренды) написаны inline-style'ами
     display:flex;justify-content:space-between без gap. На узком экране
     без промежутка тексты сливаются («FastTrack SmokeBikeFAST-TRACK-SMOKE»).
     Даём безопасный минимальный отступ и разрешаем перенос. */
  .panel a[style*="space-between"],
  .panel a[style*="justify-content:space-between"],
  .panel a[style*="justify-content: space-between"] {
    gap: 10px !important;
    flex-wrap: wrap !important;
  }
  .panel a[style*="space-between"] > span:last-child,
  .panel a[style*="justify-content:space-between"] > span:last-child,
  .panel a[style*="justify-content: space-between"] > span:last-child {
    text-align: right;
    overflow-wrap: anywhere;
  }

  .client-sidebar-footer {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding-top: 8px;
    margin-top: 8px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-divider);
    box-shadow: none;
  }
  .client-nav {
    padding-bottom: 6px;
  }

  /* Кнопки в actions по-умолчанию тянутся на всю ширину — но
     .btn-small НЕ должна становиться full-width, иначе мелкие
     "Закрыть/Удалить" неаккуратно вырастают. */
  .actions .btn-sm,
  .actions .btn-small {
    width: auto !important;
  }

  /* Инлайновые ссылки-строки со .btn внутри info/split пусть
     полностью помещаются, без сжатых горизонтальных кнопок. */
  .info-row .btn,
  .split-row .btn,
  .object-row .btn {
    width: auto;
    min-width: 0;
  }
}

/* Общий фикс: .btn { min-width: max-content } спасает от сжатия
   на десктопе, но на узких экранах даёт кнопке уехать за край
   контейнера. Разрешаем сжимать и переносить текст, начиная с 640px. */
@media (max-width: 640px) {
  .btn {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
}
