/* Универсальный виджет уведомлений/метрик */
.universal-notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #7c3aed;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.sidebar-unread-badge {
  background: #dc2626;
}
.topbar-unread-badge {
  background: #2563eb;
}
.dashboard-unread-badge {
  background: #0f766e;
}
.client-card-unread-badge {
  background: #f59e42;
  margin-left: 4px;
  font-size: 12px;
  min-width: 18px;
  height: 18px;
}
:root {
  --brand-yellow: #ffd400;
  --brand-yellow-deep: #f1c500;
  --brand-black: #111111;
  --brand-gray: #636363;
  --brand-gray-soft: #d7d4cc;
  --brand-gray-deep: #2b2b2b;
  --surface: rgba(242, 245, 252, 0.92);
  --surface-strong: rgba(234, 239, 248, 0.96);
  --line: rgba(17, 17, 17, 0.12);
  --line-strong: rgba(17, 17, 17, 0.2);
  --shadow: 0 24px 60px rgba(17, 17, 17, 0.24);
  --shadow-soft: 0 14px 30px rgba(17, 17, 17, 0.16);
  --success: #1f9d55;
  --danger: #d93025;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --chrome-width: min(420px, calc(100vw - 24px));
  --status-width: min(640px, calc(100vw - 24px));
  --top-row-gap: 10px;
  --client-collapsed-height: 132px;
  --client-bottom-offset: 12px;
  --stack-gap: 8px;
  --rentals-top-limit: 108px;
  --rentals-client-offset: calc(min(44vh, 380px) + 24px);
}

html,
body,
#map {
  height: 100%;
  margin: 0;
  padding: 0;
}

html {
  background: #1a2235;
  touch-action: manipulation;
}

body {
  font-family: "Rubik", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--brand-black);
  overflow: hidden;
  touch-action: manipulation;
  background:
    radial-gradient(circle at top, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0) 40%),
    linear-gradient(180deg, #1e293b 0%, #0f172a 55%, #0a0f1e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.28)),
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.10), transparent 36%);
  pointer-events: none;
  z-index: 2;
}

#map {
  position: fixed;
  inset: 0;
  z-index: 1;
  touch-action: pinch-zoom pan-x pan-y;
}

.leaflet-container {
  background: #c4c1b8;
  font: inherit;
  touch-action: pinch-zoom pan-x pan-y;
}

.leaflet-control-attribution {
  display: none !important;
}

.app-chrome {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
}

.orientation-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.orientation-lock-overlay__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 15, 15, 0.42), rgba(15, 15, 15, 0.62)),
    radial-gradient(circle at 20% 15%, rgba(255, 212, 0, 0.28), transparent 34%),
    radial-gradient(circle at 80% 82%, rgba(52, 211, 153, 0.18), transparent 28%);
  backdrop-filter: blur(16px) saturate(0.9);
}

.orientation-lock-overlay__panel {
  position: relative;
  width: min(calc(100vw - 56px), 360px);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.8), rgba(18, 18, 18, 0.88));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  text-align: center;
  color: #fff8d6;
}

.orientation-lock-overlay__eyebrow {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 212, 0, 0.18);
  border: 1px solid rgba(255, 212, 0, 0.22);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orientation-lock-overlay__panel h2 {
  margin: 0;
  font-size: clamp(21px, 3.4vw, 26px);
  line-height: 1.1;
  color: #ffffff;
}

.orientation-lock-overlay__panel p {
  margin: 0;
  max-width: 24ch;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 248, 214, 0.88);
}

.orientation-lock-illustration {
  position: relative;
  width: 152px;
  height: 122px;
  margin-bottom: 2px;
}

.orientation-lock-illustration__glow {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 106px;
  height: 106px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 0, 0.22), rgba(255, 212, 0, 0.03) 58%, transparent 74%);
  filter: blur(1px);
}

.orientation-lock-illustration__phone-shell {
  position: absolute;
  width: 58px;
  height: 96px;
  right: 18px;
  top: 12px;
  border-radius: 18px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  box-sizing: border-box;
}

.orientation-lock-illustration__phone {
  position: absolute;
  display: block;
  width: 58px;
  height: 96px;
  left: 20px;
  top: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.98), rgba(40, 40, 40, 0.94));
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
  transform-origin: 50% 50%;
  box-sizing: border-box;
}

.orientation-lock-illustration__phone--rotating {
  animation: orientation-lock-phone-rotate 2.9s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.orientation-lock-illustration__speaker,
.orientation-lock-illustration__screen,
.orientation-lock-illustration__home {
  position: absolute;
  display: block;
}

.orientation-lock-illustration__speaker {
  left: 50%;
  top: 7px;
  width: 18px;
  height: 3px;
  margin-left: -9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.orientation-lock-illustration__screen {
  inset: 15px 7px 15px;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 212, 0, 0.98), rgba(241, 197, 0, 0.86)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.orientation-lock-illustration__screen::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 9px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, rgba(17, 17, 17, 0.06), transparent 48%);
}

.orientation-lock-illustration__home {
  left: 50%;
  bottom: 7px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.52);
}

.orientation-lock-illustration__arc {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 86px;
  height: 86px;
  margin-left: -43px;
  border-top: 3px solid rgba(255, 212, 0, 0.88);
  border-right: 3px solid rgba(255, 212, 0, 0.88);
  border-radius: 0 100% 0 0;
  transform: rotate(10deg);
  animation: orientation-lock-arc-pulse 2.8s ease-in-out infinite;
}

.orientation-lock-illustration__arc::after {
  content: "";
  position: absolute;
  right: -6px;
  top: -1px;
  width: 0;
  height: 0;
  border-left: 10px solid rgba(255, 212, 0, 0.92);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transform: rotate(18deg);
}

body.phone-landscape {
  overflow: hidden;
}

body.phone-landscape .orientation-lock-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.phone-landscape .app-chrome,
body.phone-landscape #appTopBanner {
  filter: blur(8px) saturate(0.85);
}

@keyframes orientation-lock-phone-rotate {
  0%,
  16% {
    transform: rotate(90deg) translateY(8px) scale(0.98);
    opacity: 0.98;
  }
  38%,
  68% {
    transform: rotate(0deg) translateX(42px) scale(1);
    opacity: 1;
  }
  84%,
  100% {
    transform: rotate(0deg) translateX(42px) scale(1);
    opacity: 0.94;
  }
}

@keyframes orientation-lock-arc-pulse {
  0%,
  18% {
    opacity: 0.26;
    transform: rotate(10deg) scale(0.94);
  }
  34%,
  62% {
    opacity: 1;
    transform: rotate(10deg) scale(1.04);
  }
  78%,
  100% {
    opacity: 0.44;
    transform: rotate(10deg) scale(1);
  }
}

#brandPanel,
#dashboardStack > * {
  pointer-events: auto;
}

#dashboardStack {
  pointer-events: none;
}

#brandPanel {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  max-width: calc(100vw - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(17, 17, 17, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 212, 0, 0.98), rgba(241, 197, 0, 0.92));
  box-shadow: var(--shadow);
}

#brandBadge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  width: fit-content;
  max-width: 100%;
}

#brandBadge img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18);
  background: var(--brand-yellow);
}

#brandBadge span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: max-content;
  max-width: 100%;
}

#brandBadge strong {
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.02em;
}

#brandBadge small {
  font-size: 12px;
  line-height: 1.1;
  color: rgba(17, 17, 17, 0.78);
  white-space: nowrap;
}

#dashboardStack {
  position: fixed;
  inset: 0;
  width: 100%;
  max-height: none;
  display: block;
  overflow: visible;
}

#statusBar,
#rentalsTopControl,
#deviceListWrapper,
#analyticsWrapper,
#clientListWrapper {
  display: flex;
  flex-direction: column;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: var(--chrome-width) !important;
  max-width: var(--chrome-width) !important;
  margin: 0 !important;
  border-radius: var(--radius-xl) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-soft) !important;
  background: linear-gradient(180deg, var(--surface), var(--surface-strong)) !important;
  overflow: hidden !important;
  backdrop-filter: blur(16px);
  transition: max-height 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

#statusBar {
  position: fixed !important;
  top: 102px !important;
  z-index: 1600 !important;
  display: flex;
  justify-content: center;
  width: fit-content !important;
  max-width: calc(100vw - 32px) !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  backdrop-filter: none;
}

#status {
  padding: 14px 18px !important;
  border-radius: var(--radius-lg) !important;
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.96), rgba(43, 43, 43, 0.96)) !important;
  color: var(--brand-yellow) !important;
    border-radius: 26px !important;
  font-weight: 600 !important;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 212, 0, 0.12);
}

.auth-session-badge {
  --auth-badge-peek-width: 56px;
  --auth-badge-collapse-shift: 0px;
  position: fixed;
  top: 18px;
  right: 12px;
  z-index: 99999;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: stretch;
  column-gap: 12px;
  min-width: 224px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px 10px 8px 8px;
  border-radius: 20px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: linear-gradient(180deg, rgba(244, 241, 233, 0.96), rgba(236, 232, 223, 0.98));
  box-shadow: var(--shadow-soft);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
  pointer-events: none;
}

.auth-session-badge * {
  pointer-events: none;
}

.auth-session-badge button,
.auth-session-badge button * {
  pointer-events: auto;
}

/* Position start-rental badge lower on the screen */
#startRentalBadge {
  top: auto;
  bottom: 120px;
  right: 12px;
}

/* Make start-rental badge buttons green */
#startRentalBadge .auth-session-badge__content button,
#startRentalBadge #startRentalBtn {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

#startRentalBadge .auth-session-badge__content button:hover {
  opacity: 0.95;
}

/* Small square scan button (icon-only) inside start rental badge */
#startRentalBadge .start-rental-scan-btn {
  width: 48px;
  height: 48px;
  padding: 6px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #16a34a;
  border: none;
  margin: 8px auto 0;
  cursor: pointer;
  align-self: center;
}

#startRentalBadge .start-rental-scan-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.auth-session-badge:not(.is-collapsed) {
  z-index: 100000;
}

.auth-session-badge.is-collapsed {
  transform: translateX(var(--auth-badge-collapse-shift));
}

.device-list-search-row {
  padding: 8px 14px 12px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(244, 241, 233, 0.98), rgba(244, 241, 233, 0.94));
}

.device-fleet-search-input {
  width: 100%;
  box-sizing: border-box;
}

.auth-session-badge__handle {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 100%;
  min-height: 84px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.98), rgba(16, 163, 74, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.auth-session-badge__handle::before,
.auth-session-badge__handle::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  transform-origin: center;
}

/* Keep auth/logout handle yellow for #authSessionBadge specifically */
#authSessionBadge .auth-session-badge__handle {
  background: linear-gradient(180deg, rgba(255, 212, 0, 0.98), rgba(241, 197, 0, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
#authSessionBadge .auth-session-badge__handle::before,
#authSessionBadge .auth-session-badge__handle::after {
  background: rgba(17, 17, 17, 0.72);
}

.auth-session-badge__handle::before {
  top: calc(50% - 4px);
  transform: translateX(-50%) rotate(45deg);
}

.auth-session-badge__handle::after {
  top: calc(50% + 2px);
  transform: translateX(-50%) rotate(-45deg);
}

.auth-session-badge.is-collapsed .auth-session-badge__handle::before {
  transform: translateX(-50%) rotate(-45deg);
}

.auth-session-badge.is-collapsed .auth-session-badge__handle::after {
  transform: translateX(-50%) rotate(45deg);
}

.auth-session-badge__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 4px 4px 0;
}

.auth-session-badge__fio {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-black);
  line-height: 1.2;
  word-break: break-word;
}

.auth-session-badge__pin {
  font-size: 12px;
  color: var(--brand-gray);
  line-height: 1.2;
}

.auth-session-badge #authLogoutBtn {
  margin-top: 8px;
  width: 100%;
}

.auth-session-badge #branchLogoutBtn {
  margin-top: 8px;
  width: 100%;
}

body.auth-locked #map,
body.auth-locked .app-chrome,
body.auth-locked #modalBackdrop,
body.auth-locked .app-modal {
  filter: blur(10px);
  pointer-events: none !important;
  user-select: none;
}

body.auth-locked #authSessionBadge,
body.auth-locked #desktopSidebarUser,
body.auth-locked #deviceCountBadge,
body.auth-locked #rentalsCountBadge,
body.auth-locked #clientCountBadge,
body.auth-locked #rentalsTopPreview,
body.auth-locked #clientList,
body.auth-locked #employeeAuditContent,
body.auth-locked #employeeAuditActions {
  visibility: hidden;
}

body.session-restoring #authGate,
body.session-restoring #pinGate,
body.session-restoring #authSessionBadge {
  display: none !important;
  visibility: hidden !important;
}

/* Auth-shield: непрозрачная заслонка над дашбордом (z-index выше всей рабочей
   зоны 1500..7000, но ниже окна входа 9000). Закрывает дашборд, пока:
   — восстанавливается сессия (gate ещё скрыт, дашборд иначе виден без блюра), или
   — показан экран входа (резерв на случай задержки backdrop / pk-ready).
   Скрыта только когда авторизация завершена на 100% и дашборд можно показать. */
#authShield {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0E1525;
  opacity: 0;
  visibility: hidden;
  /* плавно гасим заслонку при показе дашборда; visibility отложена до конца fade */
  transition: opacity .25s ease, visibility 0s linear .25s;
}

body.auth-locked #authShield,
body.session-restoring #authShield {
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease;
}

.auth-shield__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.auth-shield__brand img {
  width: 60px;
  height: 60px;
  border-radius: 16px;
}

.auth-shield__spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: authShieldSpin .8s linear infinite;
}

@keyframes authShieldSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shield__spinner { animation-duration: 1.6s; }
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-gate.is-visible {
  display: flex;
}

.auth-gate__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.28);
}

.auth-gate__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  background: linear-gradient(180deg, rgba(247, 244, 236, 0.98), rgba(229, 225, 215, 0.98));
  box-shadow: 0 32px 80px rgba(17, 17, 17, 0.34);
}

.auth-gate__title-group {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.auth-gate__title {
  font-size: 24px;
  font-weight: 800;
}

.auth-gate__subtitle {
  font-size: 14px;
  line-height: 1.45;
  color: var(--brand-gray);
}

.auth-gate__hint {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(255, 212, 0, 0.18);
  border: 1px solid rgba(255, 212, 0, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
}

.auth-gate__secondary {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.7);
  color: #0f172a;
}

.auth-gate__form {
  display: grid;
  gap: 12px;
}

.auth-gate__form label {
  font-weight: 700;
}

.auth-gate__form input {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 28px;
  font-weight: 700;
}

#authGateBranchFields,
#authGatePinFields {
  display: grid;
  gap: 12px;
}

#authGateEmailInput,
#authGatePasswordInput,
#pinGatePinInput {
  text-align: left;
  letter-spacing: normal;
  font-size: 16px;
  font-weight: 600;
}

#pinGatePinInput {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 28px;
  font-weight: 700;
}

.auth-gate__error {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(198, 40, 40, 0.12);
  color: #9f1d1d;
  font-size: 14px;
  font-weight: 600;
}

.network-admin-screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 2px;
  min-height: max-content;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.network-admin-auth-card,
.network-admin-panel {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  padding: 22px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.network-admin-auth-card__title,
.network-admin-panel__title {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}

.network-admin-auth-card__subtitle,
.network-admin-panel__subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #5f6c7d;
  line-height: 1.45;
}

.network-admin-auth-card__meta {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.network-admin-auth-card__meta-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.network-admin-auth-card__meta-value {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}

.network-admin-auth-card__form,
.network-admin-form,
.network-admin-form__actions {
  display: grid;
  gap: 12px;
}

.network-admin-form--credentials {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

/* Thematic group headings inside the branch settings form.
   The form is a 2-column grid, so headings, hints and per-block save rows
   must span both columns (grid-column: 1 / -1) to stay aligned. */
.network-admin-form__group-title {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1d4ed8;
}
.network-admin-form__group-title--first {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.network-admin-form__hint {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: #64748b;
}
.network-admin-form__hint--sub {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}
/* Checkbox row inside network-admin forms (horizontal, not stacked) */
.network-admin-form__checkbox {
  grid-column: 1 / -1;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.network-admin-form__checkbox input[type="checkbox"] {
  width: auto !important;
  min-height: 0 !important;
  margin: 0;
  flex: 0 0 auto;
}

/* Per-block save row (full width, button right-aligned) */
.network-admin-form__block-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}
.network-admin-form__block-save {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #1d4ed8;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.network-admin-form__block-save:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}
.network-admin-form__block-save:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Smaller inputs scoped to the branch credentials form */
.network-admin-form--credentials label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  gap: 4px;
}
.network-admin-form--credentials input,
.network-admin-form--credentials select {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}
.network-admin-form--credentials .network-admin-form__actions button {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 36px;
}

/* Generate-password button */
.network-admin-form__gen-btn {
  flex-shrink: 0;
  padding: 0 11px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #374151;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.network-admin-form__gen-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* Живой QR-превью кода точки рядом с полем */
.network-admin-form__qr-img {
  width: 84px;
  height: 84px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 4px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.network-admin-form__qr-img:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* Модалка предпросмотра карточки QR (название + QR + код на одной картинке) */
.point-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 16px;
}
.point-qr-modal__card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 380px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  text-align: center;
}
.point-qr-modal__head {
  font-weight: 700;
  font-size: 15px;
  color: #111827;
  margin-bottom: 12px;
}
.point-qr-modal__body img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border: 1px solid #eef2f7;
  border-radius: 10px;
}
.point-qr-modal__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}
.point-qr-modal__actions a.network-admin-form__gen-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.network-admin-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}


.network-admin-auth-card__form input,
.network-admin-form input,
.network-admin-form select {
  min-height: 36px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 0 10px;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}

.network-admin-form input[readonly] {
  background: rgba(241, 245, 249, 0.95);
  color: #334155;
}

.network-admin-form select {
  appearance: none;
}

.network-admin-status,
.network-admin-result {
  min-height: 22px;
  font-size: 14px;
  color: #475569;
  white-space: pre-wrap;
}

.network-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.network-admin-grid > * {
  min-width: 0;
}

.network-admin-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.network-admin-panel--create {
  max-height: 480px;
  overflow-y: auto;
}

.network-admin-panel--list {
  height: 480px;
  overflow-y: auto;
}

.network-admin-panel--detail {
  grid-column: 1 / -1;
}

.network-admin-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.network-admin-section-nav__btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(241, 245, 249, 0.78);
  color: #334155;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.network-admin-section-nav__btn:hover,
.network-admin-section-nav__btn.is-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(255, 212, 0, 0.2));
  border-color: rgba(16, 185, 129, 0.28);
  color: #0f172a;
  transform: translateY(-1px);
}

.network-admin-section-note {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 248, 196, 0.72), rgba(240, 249, 255, 0.9));
  border: 1px solid rgba(250, 204, 21, 0.24);
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.network-admin-form--create-branch {
  grid-template-columns: 1fr;
  align-content: start;
  grid-auto-rows: min-content;
}

.network-admin-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}

.network-admin-detail-grid.network-admin-detail-grid--single-column {
  grid-template-columns: minmax(0, 1fr);
}

.network-admin-detail-column {
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}

.network-admin-detail-column.network-admin-detail-column--full-width {
  grid-column: 1 / -1;
}

.network-admin-modal--branch .network-admin-panel--create,
.network-admin-modal--branch .network-admin-panel--list {
  display: none !important;
}

.network-admin-modal--branch .network-admin-grid {
  grid-template-columns: minmax(0, 1fr);
}

.network-admin-modal--branch .network-admin-panel--detail {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
}

.network-admin-modal--branch .network-admin-panel--detail,
.network-admin-modal--branch .network-admin-detail-grid,
.network-admin-modal--branch .network-admin-detail-column,
.network-admin-modal--branch .network-admin-subpanel {
  width: 100%;
  min-width: 0;
}

.network-admin-modal--branch .network-admin-detail-grid {
  grid-template-columns: minmax(0, 1fr);
}

.network-admin-modal--branch .network-admin-detail-column--full-width,
.network-admin-modal--branch .network-admin-detail-column--full-width .network-admin-subpanel,
.network-admin-modal--branch .network-admin-subpanel--pricing,
.network-admin-modal--branch .network-admin-subpanel--credentials {
  width: 100%;
  max-width: none;
}

.network-admin-modal--branch .network-branch-access-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
}

/* branch modal toolbar inherits flex layout */

.network-admin-subpanel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  box-sizing: border-box;
  max-width: 100%;
}

.network-admin-subpanel--starline {
  align-self: start;
}

.network-admin-subpanel--credentials {
  min-width: 0;
}

.network-admin-form--pricing {
  gap: 10px;
}
/* Compact inputs for all elements inside the pricing form */
.network-admin-form--pricing label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  gap: 3px;
}
.network-admin-form--pricing input,
.network-admin-form--pricing select {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
}

/* Toolbar: single flex row — labels + buttons side by side */
.network-rental-config-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.network-rental-config-toolbar > label { flex-shrink: 0; }
.network-rental-config-toolbar > label input { width: 78px; }
.network-rental-config-toolbar > .network-admin-form__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.network-admin-form__actions--pricing-toolbar {
  justify-content: flex-end;
}
.network-admin-form__actions--pricing-toolbar button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}
.network-branch-access-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
}
.network-admin-subcard {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 252, 0.96) 100%);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
  min-width: 0;
  box-sizing: border-box;
  max-width: 100%;
}
.network-admin-form--credentials {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  min-width: 0;
}
.network-admin-form__actions--credentials {
  grid-column: 1 / -1;
  justify-content: flex-start;
}
/* Tariff list — single column */
.network-rental-tariffs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.network-rental-tariffs-empty {
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: #64748b;
  font-size: 12px;
}

/* Compact tariff card with color-coded left border */
.network-rental-tariff-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #cbd5e1;
  background: #fff;
  min-width: 0;
  box-sizing: border-box;
}
.network-rental-tariff-card:nth-child(1) { border-left-color: #0ea5e9; }
.network-rental-tariff-card:nth-child(2) { border-left-color: #8b5cf6; }
.network-rental-tariff-card:nth-child(3) { border-left-color: #10b981; }
.network-rental-tariff-card:nth-child(4) { border-left-color: #f59e0b; }
.network-rental-tariff-card:nth-child(n+5) { border-left-color: #6366f1; }

.network-rental-tariff-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #f1f5f9;
}
.network-rental-tariff-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.network-rental-tariff-card__title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.network-rental-tariff-card__footer {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-top: 7px;
  border-top: 1px solid #f1f5f9;
  margin-top: 2px;
}

.network-rental-branch-picker {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: #f8fafc;
}
.network-rental-branch-picker[open] { border-style: solid; }
.network-rental-branch-picker__summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  list-style: none;
}
.network-rental-branch-picker__summary::-webkit-details-marker { display: none; }
.network-rental-branch-picker__list {
  display: grid;
  gap: 5px;
  max-height: 160px;
  overflow: auto;
  padding-right: 4px;
}
.network-rental-branch-picker__option {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 12px;
  color: #334155;
}
.network-rental-branch-picker__option input { margin-top: 2px; }
.network-rental-branch-picker__meta { color: #64748b; font-size: 11px; }

.network-rental-tariff-card__remove-btn,
.network-rental-tariff-card__save-btn {
  white-space: nowrap;
  min-height: 28px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
}
.network-rental-tariff-card__remove-btn {
  margin-left: auto;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.network-rental-tariff-card__remove-btn:hover { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.network-rental-tariff-card__save-btn {
  background: #7c3aed;
  color: #fff;
  font-weight: 700;
}
.network-rental-tariff-card__save-btn:hover { background: #6d28d9; }
.network-rental-battery-row__remove-btn {
  white-space: nowrap;
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 6px;
  align-self: flex-end;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s;
  font-weight: 600;
}
.network-rental-battery-row__remove-btn:hover { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.network-rental-battery-add-btn {
  white-space: nowrap;
  min-height: 26px;
  padding: 0 10px;
  font-size: 11px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s;
  font-weight: 600;
}
.network-rental-battery-add-btn:hover { background: #e2e8f0; }

.network-branch-card__selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.network-branch-card__selector input {
  width: 16px;
  height: 16px;
}

.network-admin-modal--branch .network-admin-panel--detail {
  grid-column: 1 / -1;
}

/* Tariff fields row */
.network-rental-tariff-grid {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}
.network-rental-tariff-grid > label:nth-child(1) { flex: 1 1 130px; min-width: 100px; }
.network-rental-tariff-grid > label:nth-child(2) { width: 88px; flex-shrink: 0; }
.network-rental-tariff-grid > label:nth-child(3) { width: 150px; flex-shrink: 0; }
.network-rental-tariff-grid > label:nth-child(4) { width: 132px; flex-shrink: 0; }

.network-rental-buyout-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.network-rental-buyout-toggle input {
  width: 14px;
  height: 14px;
  min-height: 14px;
}

.network-rental-buyout-fields {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}
/* Поля выкупа (подсказка + циклы + примечание) видны только при включённом выкупе.
   Без этого правила display:flex перебивает атрибут [hidden]. */
.network-rental-buyout-fields[hidden] { display: none !important; }
/* nth-of-type — чтобы добавленная подсказка <p> не сбивала ширины полей-меток. */
.network-rental-buyout-fields > label:nth-of-type(1) { width: 115px; flex-shrink: 0; }
.network-rental-buyout-fields > label:nth-of-type(2) { flex: 1; min-width: 120px; }

.network-rental-battery-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
/* Compact battery row */
.network-rental-battery-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f0f4f8;
  min-width: 0;
}
.network-rental-battery-row > label:nth-child(1) { width: 52px; flex-shrink: 0; }
.network-rental-battery-row > label:nth-child(2) { flex: 1; min-width: 60px; }
.network-rental-battery-row > label:nth-child(3) { flex: 1; min-width: 60px; }

.network-admin-form__actions--pricing {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  min-width: 0;
}

.network-admin-subpanel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.network-admin-panel__title--sm {
  font-size: 17px;
}

.network-admin-form--staff {
  grid-template-columns: minmax(0, 1fr) 110px 150px;
  align-items: end;
  gap: 10px 8px;
}

.network-admin-form--staff label,
.network-staff-edit-grid label {
  min-width: 0;
}

.network-admin-form__actions--staff {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(120px, max-content));
  align-items: stretch;
  justify-content: start;
}

.network-admin-field--fio {
  min-width: 0;
}

.network-admin-field--pin {
  width: 110px;
}

.network-admin-field--role {
  width: 150px;
}

.network-admin-field--pin input {
  width: 100%;
  max-width: 110px;
  min-width: 0;
  text-align: center;
  letter-spacing: 0.28em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.network-admin-field--pin input::placeholder {
  letter-spacing: 0.24em;
  font-size: 11px;
  text-align: center;
}

.network-admin-field--role select {
  min-width: 150px;
}

/* Compact inputs for staff form */
.network-admin-form--staff label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  gap: 4px;
}
.network-admin-form--staff input,
.network-admin-form--staff select {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.network-admin-form__actions--staff button {
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.network-staff-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Compact staff card */
.network-staff-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
}
.nsc-main {
  min-width: 0;
  flex: 1;
}
.nsc-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.nsc-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
  align-items: center;
}
.nsc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}
.nsc-badge--admin { background: rgba(219, 234, 254, 0.9); color: #1d4ed8; }
.nsc-badge--king { background: rgba(251, 191, 36, 0.22); color: #b45309; border: 1px solid rgba(217, 119, 6, 0.25); }
.nsc-badge--staff { background: rgba(220, 252, 231, 0.9); color: #166534; }
.nsc-badge--pin { background: #f8fafc; color: #64748b; font-family: ui-monospace, monospace; }
.nsc-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.network-staff-card__btn {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.network-staff-edit-form {
  gap: 14px;
  max-width: 100%;
}

.network-staff-edit-grid {
  grid-template-columns: minmax(0, 1fr) 168px;
  align-items: start;
  gap: 12px 10px;
}

.network-staff-edit-grid .network-admin-field--fio {
  grid-column: 1 / -1;
}

.network-staff-edit-grid .network-admin-field--pin {
  grid-column: 1;
}

.network-staff-edit-grid .network-admin-field--role {
  grid-column: 2;
}

.network-staff-edit-actions {
  justify-content: flex-end;
}

#networkBranchStaffEditModal .modal-header {
  padding-bottom: 10px;
}

#networkBranchStaffEditModal .modal-title {
  font-size: 19px;
}

#networkBranchStaffEditModal .modal-subtitle {
  max-width: 320px;
  font-size: 12px;
  line-height: 1.4;
}

.modal-body--mini {
  padding-top: 12px;
}

.network-staff-card__btn--danger {
  border-color: rgba(217, 48, 37, 0.24);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.96);
}

.network-admin-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.network-branch-list {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
}

/* Branch stats dashboard */
.branch-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.branch-dashboard__card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: none;
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
  border-radius: 10px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Subtle colorful gradients per tile to add brand styling without changing layout */
.branch-dashboard__card:nth-child(1) { background: linear-gradient(135deg,#fff7ed,#fff1cc); }
.branch-dashboard__card:nth-child(2) { background: linear-gradient(135deg,#ecfdf5,#bbf7d0); }
.branch-dashboard__card:nth-child(3) { background: linear-gradient(135deg,#f3e8ff,#e9d5ff); }
.branch-dashboard__card:nth-child(4) { background: linear-gradient(135deg,#e0f2fe,#bae6fd); }
.branch-dashboard__card:nth-child(5) { background: linear-gradient(135deg,#eff6ff,#dbeafe); }
.branch-dashboard__card:nth-child(6) { background: linear-gradient(135deg,#eef2ff,#e9d5ff); }
.branch-dashboard__label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.branch-dashboard__value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}
.branch-dashboard__value--green { color: #16a34a; }
.branch-dashboard__value--accent { color: #7c3aed; }
.branch-dashboard__value--revenue { font-size: 16px; color: #0284c7; }
.branch-dashboard__loading {
  grid-column: 1 / -1;
  padding: 10px 14px;
  color: #94a3b8;
  font-size: 13px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}


.network-branch-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.network-branch-card:hover:not(.is-active) {
  border-color: rgba(100, 116, 139, 0.4);
}

/* Compact card element classes */
.nbc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
}
.nbc-header__main { min-width: 0; flex: 1; }
.nbc-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  word-break: break-word;
}
.nbc-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
  word-break: break-all;
  line-height: 1.3;
}
.nbc-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.nbc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
}
.nbc-badge--active { background: rgba(220, 252, 231, 0.9); color: #166534; }
.nbc-badge--paused { background: rgba(254, 226, 226, 0.9); color: #b91c1c; }
.nbc-badge--deleted { background: #f1f5f9; color: #94a3b8; }
.nbc-badge--starline-connected { background: rgba(219, 234, 254, 0.9); color: #1d4ed8; }
.nbc-badge--starline-missing { background: rgba(255, 237, 213, 0.9); color: #c2410c; }
.nbc-badge--code { background: #f8fafc; color: #64748b; font-family: ui-monospace, monospace; font-size: 10px; }
.nbc-info {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1px 5px;
  font-size: 11px;
  line-height: 1.4;
}
.nbc-info-label { color: #94a3b8; font-weight: 600; }
.nbc-info-val { color: #334155; font-weight: 500; word-break: break-word; }
.nbc-password {
  font-size: 11px;
  color: #7c3aed;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 3px 7px;
  background: rgba(237, 233, 254, 0.35);
  border-radius: 6px;
  word-break: break-all;
}

.network-branch-card__actions {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 4px;
  flex-shrink: 0;
}

.network-admin-panel__limit {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #7f1d1d;
}

.network-admin-panel__limit-value {
  color: #dc2626;
  font-size: 16px;
}

.network-branch-card__btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.network-branch-card__btn--pause {
  border-color: rgba(185, 28, 28, 0.18);
  background: rgba(254, 242, 242, 0.96);
  color: #b91c1c;
}

.network-branch-card__btn--resume {
  border-color: rgba(21, 128, 61, 0.18);
  background: rgba(240, 253, 244, 0.96);
  color: #15803d;
}

.network-branch-card__delete-btn {
  min-height: 32px;
  justify-content: center;
}

.network-branch-card__icon-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  gap: 0;
  justify-content: center;
}

.network-branch-card__icon-action span {
  display: none;
}

.network-branch-card__restore-btn {
  border-color: rgba(15, 118, 110, 0.22);
}

.network-branch-card.is-active {
  border-color: #0f766e;
  border-width: 2px;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: none;
  position: relative;
}

.network-branch-card.is-active::before {
  content: 'Выбран';
  position: absolute;
  bottom: 8px;
  right: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.network-branch-card.is-deleted {
  opacity: 0.62;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.96), rgba(255, 255, 255, 0.9));
  border-color: rgba(148, 163, 184, 0.36);
}

.network-branch-card.is-disabled:not(.is-deleted) {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.92));
}

.network-branch-card__title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.network-branch-card__meta {
  margin-top: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.3;
}

.network-branch-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.network-admin-panel--list .network-branch-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

.network-branch-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(226, 232, 240, 0.9);
  color: #0f172a;
}

.network-branch-chip--active {
  background: rgba(220, 252, 231, 0.95);
  color: #166534;
}

.network-branch-chip--paused {
  background: rgba(254, 226, 226, 0.95);
  color: #b91c1c;
}

.network-branch-chip--deleted {
  background: rgba(226, 232, 240, 0.98);
  color: #475569;
}

.network-branch-chip--starline-connected {
  background: rgba(219, 234, 254, 0.98);
  color: #1d4ed8;
}

.network-branch-chip--starline-missing {
  background: rgba(255, 237, 213, 0.98);
  color: #c2410c;
}

.network-branch-scope-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 0;
}

.network-branch-scope-field__label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
}

.network-branch-scope-field select {
  min-width: 160px;
}

.branch-scope-meta-line {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}

.network-admin-empty {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  color: #64748b;
}

.network-admin-form--starline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.network-admin-form__actions--starline {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.network-admin-field--starline-user {
  min-width: 0;
}

.network-admin-form__inline-btn {
  min-height: 46px;
  width: 100%;
  align-self: end;
}

.network-admin-form__actions--starline button {
  width: 100%;
  min-height: 48px;
}

@media (max-width: 1260px) {
  .network-admin-grid {
    grid-template-columns: 1fr;
  }

  .network-admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .network-admin-detail-column {
    gap: 16px;
  }

  .network-admin-form--staff {
    grid-template-columns: 1fr 1fr;
  }

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

  .network-staff-list,
  .network-staff-edit-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .network-admin-grid {
    grid-template-columns: 1fr;
  }

  .network-admin-section-nav {
    gap: 8px;
  }

  .network-admin-section-nav__btn {
    width: 100%;
  }

  .network-admin-auth-card {
    grid-template-columns: 1fr;
  }

  .network-admin-auth-card,
  .network-admin-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .network-admin-form--staff,
  .network-admin-form__actions--staff,
  .network-admin-form__actions--pricing,
  .network-staff-card,
  .network-staff-list,
  .network-staff-edit-grid,
  .network-rental-tariff-grid,
  .network-rental-buyout-fields,
  .network-rental-battery-row {
    grid-template-columns: 1fr;
  }

  .network-admin-form--starline,
  .network-admin-form__actions--starline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .network-staff-card__actions {
    justify-content: flex-start;
  }
}

#rentalsTopControl {
  position: fixed !important;
  bottom: var(--rentals-dynamic-bottom, calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap))) !important;
  z-index: 1630 !important;
  display: none;
  max-height: 68px;
}

#rentalsTopControl.lifted-by-client {
  bottom: var(--rentals-client-offset) !important;
}

#rentalsTopControl.lifted-by-client.panel-open {
  max-height: calc(100dvh - var(--rentals-top-limit) - var(--rentals-client-offset)) !important;
}

#rentalsMapHeader,
#deviceListHeader,
#analyticsHeader,
#clientListHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, rgba(255, 212, 0, 0.18), rgba(255, 212, 0, 0.05));
  cursor: pointer;
  box-sizing: border-box;
}

#deviceListWrapper,
#analyticsWrapper,
#rentalsTopControl,
#clientListWrapper {
  box-shadow: 0 14px 30px rgba(17, 17, 17, 0.18) !important;
}

#deviceListWrapper.panel-open,
#analyticsWrapper.panel-open,
#rentalsTopControl.panel-open,
#clientListWrapper.panel-open {
  box-shadow: var(--shadow) !important;
}

.panel-heading-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.panel-heading-group--shrink {
  flex: 1 1 auto;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.panel-badge {
  color: var(--brand-gray);
  font-size: 13px;
  font-weight: 600;
}

#deviceCountBadge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 4ch;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: right;
}

.panel-toggle {
  color: var(--brand-gray);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

/* small header action button for panels */
#rentalsMapHeader .panel-open-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

#rentalsMapHeader .panel-open-btn:hover { opacity: 0.95; }

#mapControls {
  position: fixed !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 1550 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: auto;
}

button {
  appearance: none;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.96), rgba(43, 43, 43, 0.98));
  color: var(--brand-yellow);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(17, 17, 17, 0.14);
}

button:disabled {
  opacity: 0.66;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Фирменная кнопка «Сохранить» (жёлтая заливка бренда, без тёмного заполнения) */
.bwo-save-btn {
  background: linear-gradient(180deg, var(--brand-yellow), var(--brand-yellow-deep));
  color: #111;
  border: 1px solid var(--brand-yellow-deep);
  font-weight: 700;
}
.bwo-save-btn:hover { box-shadow: 0 12px 20px rgba(241, 197, 0, 0.28); }

#mapControls button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  background: linear-gradient(180deg, rgba(23, 37, 61, 0.96), rgba(15, 23, 42, 0.98));
  color: #f0f9ff;
  font-size: 15px;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

#mapControls .map-control-qr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#mapControls .map-control-qr-btn svg {
  width: 18px;
  height: 18px;
}

.device-qr-floating-button {
  position: fixed;
  right: 12px;
  bottom: calc(var(--rentals-dynamic-bottom, calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap))) + 84px);
  z-index: 1640;
  width: 58px;
  min-width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 212, 0, 0.98), rgba(241, 197, 0, 0.98));
  color: var(--brand-black);
  border: 1px solid rgba(17, 17, 17, 0.2);
  box-shadow: 0 14px 28px rgba(17, 17, 17, 0.22);
}

.device-qr-floating-button svg {
  width: 28px;
  height: 28px;
}

/* ── QR Scanner: новая шапка ── */
.qrs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.qrs-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
}

.qrs-header__text {
  flex: 1;
  min-width: 0;
}

.qrs-header__title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.qrs-header__subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.qrs-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  color: #64748b !important;
  font-size: 14px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;
  box-shadow: none !important;
  transition: background 0.15s ease !important;
}

.qrs-close-btn:hover {
  background: rgba(15, 23, 42, 0.09) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Кнопка "Запустить камеру" */
.qrs-start-btn {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
  color: #fbbf24 !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22) !important;
  transition: opacity 0.15s ease !important;
}

.qrs-start-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: none !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28) !important;
}

/* Кнопка "Открыть устройство" */
.qrs-submit-btn {
  background: linear-gradient(135deg, #0f766e 0%, #059669 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.26) !important;
  transition: opacity 0.15s ease !important;
}

.qrs-submit-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: none !important;
}

.device-qr-scanner-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.device-qr-scanner-status {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 212, 0, 0.16);
  color: var(--brand-black);
  font-weight: 600;
}

.device-qr-scanner-status.is-error {
  background: rgba(198, 40, 40, 0.14);
  color: #9f1d1d;
}

.device-qr-scanner-status.is-success {
  background: rgba(46, 125, 50, 0.14);
  color: #1f5f25;
}

.device-qr-scanner-preview {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border-radius: 24px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  background:
    radial-gradient(circle at top, rgba(255, 212, 0, 0.28), transparent 52%),
    linear-gradient(180deg, rgba(17, 17, 17, 0.94), rgba(32, 32, 32, 0.98));
}

.device-qr-scanner-preview::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  top: -18%;
  height: 34%;
  background: linear-gradient(180deg, rgba(255, 212, 0, 0), rgba(255, 212, 0, 0.3), rgba(255, 212, 0, 0));
  filter: blur(8px);
  opacity: 0;
  pointer-events: none;
}

.device-qr-scanner-preview.is-scanning::before {
  opacity: 1;
  animation: device-qr-scan-sweep 2s linear infinite;
}

.device-qr-scanner-preview.is-resolving video {
  filter: saturate(0.78) brightness(0.72) blur(1px);
  transform: scale(1.02);
}

.device-qr-scanner-preview video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  background: transparent;
  transition: filter 0.22s ease, transform 0.22s ease;
}

.device-qr-scanner-frame {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(58vw, 220px);
  height: min(58vw, 220px);
  max-width: calc(100% - 56px);
  max-height: calc(100% - 56px);
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 212, 0, 0.95);
  border-radius: 24px;
  box-shadow: 0 0 0 999px rgba(17, 17, 17, 0.28);
  pointer-events: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.device-qr-scanner-preview.is-scanning .device-qr-scanner-frame {
  animation: device-qr-frame-pulse 1.6s ease-in-out infinite;
}

.device-qr-scanner-preview.is-resolving .device-qr-scanner-frame {
  border-color: rgba(34, 197, 94, 0.98);
  box-shadow: 0 0 0 999px rgba(17, 17, 17, 0.42), 0 0 0 10px rgba(34, 197, 94, 0.16);
  transform: translate(-50%, -50%) scale(1.03);
}

.device-qr-scanner-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at center, rgba(17, 17, 17, 0.18), rgba(17, 17, 17, 0.62));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.device-qr-scanner-preview.is-resolving .device-qr-scanner-loading-overlay {
  opacity: 1;
}

.device-qr-scanner-loading-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.86);
  color: #fff8d6;
  font-weight: 700;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.device-qr-scanner-loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffd400;
  animation: device-qr-spinner 0.85s linear infinite;
}

@keyframes device-qr-scan-sweep {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(320%);
  }
}

/* Скрывать ручку метрик и мобильную навигацию только на десктопе (>=1180px).
   Диапазон 769–1179px (планшеты, обе ориентации) теперь использует бургер+дровер —
   позиционирование дровера для этого диапазона в parkos-responsive.css. */
@media (min-width: 1180px) {
  .mobile-metrics-handle,
  .mobile-nav-handle,
  .mobile-nav-overlay,
  .mobile-nav-drawer {
    display: none !important;
  }
}

@keyframes device-qr-frame-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 999px rgba(17, 17, 17, 0.28), 0 0 0 0 rgba(255, 212, 0, 0.16);
  }
  50% {
    box-shadow: 0 0 0 999px rgba(17, 17, 17, 0.28), 0 0 0 8px rgba(255, 212, 0, 0.1);
  }
}

@keyframes device-qr-spinner {
  100% {
    transform: rotate(360deg);
  }
}

.device-qr-scanner-actions {
  display: flex;
  justify-content: flex-start;
}

.device-qr-scanner-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-qr-scanner-form label {
  font-weight: 600;
}

.device-qr-scanner-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.device-qr-scanner-matches {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.device-qr-scanner-match-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(250, 248, 243, 0.96);
  color: var(--brand-black);
  text-align: left;
  box-shadow: none;
}

.device-qr-scanner-match-item:hover {
  box-shadow: 0 10px 20px rgba(17, 17, 17, 0.08);
}

.device-qr-scanner-match-title {
  font-weight: 700;
}

.device-qr-scanner-match-meta {
  font-size: 13px;
  color: var(--brand-gray);
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 14px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: rgba(250, 248, 243, 0.94);
  color: var(--brand-black);
  font: inherit;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(17, 17, 17, 0.34);
  box-shadow: 0 0 0 4px rgba(255, 212, 0, 0.2);
}

#deviceListContent,
#analyticsContent,
#clientListContent,
#rentalsMapContent {
  flex: 1 1 auto;
  padding: 14px 16px !important;
  overflow: auto !important;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  touch-action: pan-y;
  pointer-events: auto;
}

/* #rentalsMapContent is its own scroll container (no inner #...Content wrapper
   like devices/clients). app.js sets an inline height:100% on it; against the
   panel's max-height-only (indefinite) height WebKit/Safari resolves that to
   auto, so the list overflows the overflow:hidden panel and never scrolls.
   Neutralise the inline height and size via flex, exactly like the working
   #deviceListContent/#clientListContent, so it scrolls in every browser. */
#rentalsMapContent {
  height: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

#deviceListContent,
#analyticsContent,
#rentalsMapContent,
#clientListContent {
  display: none;
}

#deviceList,
#clientList,
#paymentMethodsList {
  display: flex;
  flex-direction: column;
  gap: 10px !important;
}

#deviceListWrapper {
  position: fixed !important;
  top: 162px !important;
  z-index: 1620 !important;
  max-height: 68px !important;
  left: var(--device-panel-left, 50%) !important;
  width: fit-content !important;
  max-width: calc(var(--chrome-width) - 120px) !important;
  transform: var(--device-panel-transform, translateX(calc(-100% - (var(--top-row-gap) / 2)))) !important;
}

#analyticsWrapper {
  position: fixed !important;
  top: 162px !important;
  z-index: 1610 !important;
  max-height: 68px !important;
  left: var(--analytics-panel-left, 50%) !important;
  width: fit-content !important;
  max-width: calc(var(--chrome-width) - 120px) !important;
  transform: var(--analytics-panel-transform, translateX(calc(var(--top-row-gap) / 2))) !important;
}

#deviceListWrapper:not(.panel-open),
#analyticsWrapper:not(.panel-open) {
  border-radius: 24px !important;
}

body:not(.top-panels-ready) #deviceListWrapper:not(.panel-open),
body:not(.top-panels-ready) #analyticsWrapper:not(.panel-open) {
  opacity: 0 !important;
  visibility: hidden !important;
}

#clientListWrapper {
  position: fixed !important;
  bottom: var(--client-bottom-offset) !important;
  z-index: 1625 !important;
  min-height: 0;
  max-height: var(--client-collapsed-height) !important;
}

#deviceListWrapper.panel-open {
  left: 50% !important;
  width: var(--chrome-width) !important;
  max-width: var(--chrome-width) !important;
  transform: translateX(-50%) !important;
  max-height: 50dvh !important;
  z-index: 1624 !important;
  border-radius: 24px !important;
}

#analyticsWrapper.panel-open {
  left: 50% !important;
  width: var(--chrome-width) !important;
  max-width: var(--chrome-width) !important;
  transform: translateX(-50%) !important;
  max-height: 50dvh !important;
  z-index: 1624 !important;
  border-radius: 24px !important;
}

/* Ensure analytics list inside opened panel is scrollable and fits available space */
#analyticsWrapper.panel-open #analyticsInner {
  max-height: calc(50dvh - 64px) !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

#rentalsTopControl.panel-open {
  max-height: min(50dvh, calc(100dvh - var(--rentals-top-limit) - var(--rentals-dynamic-bottom, calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap))))) !important;
}

#clientListWrapper.panel-open {
  max-height: min(44vh, 380px) !important;
}

#deviceListWrapper.panel-open #deviceListContent,
#analyticsWrapper.panel-open #analyticsContent,
#rentalsTopControl.panel-open #rentalsMapContent,
#clientListWrapper.panel-open #clientListContent {
  display: block;
}

/* Safari/WebKit can misrender scrollable content inside these fixed frosted panels:
   headers and badges stay visible, but list bodies collapse or stop painting.
   Use a narrower Safari-only fallback that removes the fragile geometry/blur combo. */
@supports (-webkit-touch-callout: none) {
  #deviceListWrapper,
  #analyticsWrapper,
  #rentalsTopControl,
  #clientListWrapper,
  #employeeAuditWrapper {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #deviceListWrapper,
  #analyticsWrapper {
    width: min(var(--chrome-width), calc(100vw - 120px)) !important;
    max-width: min(var(--chrome-width), calc(100vw - 120px)) !important;
  }

  #deviceListWrapper.panel-open,
  #analyticsWrapper.panel-open {
    width: min(var(--chrome-width), calc(100vw - 120px)) !important;
    max-width: min(var(--chrome-width), calc(100vw - 120px)) !important;
    max-height: 50vh !important;
  }

  #rentalsTopControl.panel-open,
  #clientListWrapper.panel-open {
    max-height: 50vh !important;
  }

  #deviceListContent,
  #analyticsContent,
  #rentalsMapContent,
  #clientListContent,
  #employeeAuditContent {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: auto !important;
    transform: translateZ(0);
    will-change: auto;
  }

  #deviceList,
  #clientList,
  #employeeAuditSummary,
  .employee-audit-summary,
  .employee-audit-summary-grid,
  .employee-audit-summary-column {
    display: block !important;
  }

  #deviceList > div,
  #clientList > div,
  .employee-audit-summary-card {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
  }

  #clientList.client-list-grid {
    display: block !important;
  }

  #clientList.client-list-grid > div {
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 12px;
  }
}

#deviceListWrapper:not(.panel-open) #deviceListHeader,
#analyticsWrapper:not(.panel-open) #analyticsHeader,
#rentalsTopControl:not(.panel-open) #rentalsMapHeader {
  border-bottom: none !important;
  padding-right: 16px !important;
}

#deviceListHeader,
#analyticsHeader {
  white-space: nowrap;
}

#deviceListHeader .panel-heading-group,
#analyticsHeader .panel-heading-group {
  min-width: max-content;
}

/* Floating toggle for switching between Panel and Map when in desktop map mode */
.map-mode-toggle {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1601;
  display: none !important; /* hidden by default; shown only in desktop-map-mode */
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}
.map-mode-toggle__btn {
  background: linear-gradient(180deg, rgba(244,241,233,0.98), rgba(236,232,223,0.98));
  border: 1px solid var(--line-strong);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--brand-black);
  cursor: pointer;
  min-width: 84px;
  box-shadow: var(--shadow-soft);
}
.map-mode-toggle__btn.is-active {
  background: linear-gradient(180deg, var(--brand-yellow), var(--brand-yellow-deep));
  color: #111;
}

/* show floating toggle only when map mode is active on desktop */
/* Floating toggle removed — duplicate and unnecessary. */
.map-mode-toggle { display: none !important; }

#deviceListWrapper.panel-open #deviceListHeader,

#deviceListHeader {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-heading-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.device-fleet-filter-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(18,28,45,0.06);
  background: #fff;
  font-weight: 700;
}
#analyticsWrapper.panel-open #analyticsHeader {
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, rgba(255, 212, 0, 0.22), rgba(255, 212, 0, 0.08));
}

#clientHeaderActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: 100%;
}

#clientPhoneFilterWrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#clientPhoneFilter {
  width: 100%;
  min-width: 0;
}

#clientPhoneFilterClear {
  display: none;
  padding: 12px 14px;
  border-radius: 14px;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(99, 99, 99, 0.98), rgba(62, 62, 62, 0.98));
  color: #fff;
}

#clientPhoneFilterClear.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#clientListHeader {
  align-items: flex-start;
  flex-wrap: wrap;
}

#clientListHeader .panel-heading-group {
  width: 100%;
}

#btnNewClient,
#paymentMethodsAddBtn,
#newClientSave {
  background: linear-gradient(180deg, rgba(255, 212, 0, 0.98), rgba(241, 197, 0, 0.98)) !important;
  color: var(--brand-black) !important;
  border-color: rgba(17, 17, 17, 0.24) !important;
}

#newClientCancel,
#rentalsClose,
#paymentMethodsClose,
#newClientClose,
#clientDataClose,
#infoModalClose {
  background: linear-gradient(180deg, rgba(99, 99, 99, 0.98), rgba(62, 62, 62, 0.98));
  color: #fff;
}

#deviceList > div,
#clientList > div,
#rentalsMapContent > div,
#analyticsContent > div,
#infoModalContent > div,
#rentalsList > div,
.payment-method-card {
  border-radius: 18px !important;
  border: 1px solid rgba(17, 17, 17, 0.1) !important;
  background: rgba(255, 251, 240, 0.92) !important;
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.08);
  overflow: hidden;
}

#deviceList > div,
#clientList > div {
  padding: 12px !important;
}

#clientList.client-list-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  align-items: stretch; /* ensure items in a row share the same height */
}

#clientList.client-list-grid > div {
  width: auto !important;
  max-width: min(100%, 420px);
  flex: 0 0 auto;
  box-sizing: border-box;
}

.client-list-card {
  display: flex;
  align-items: stretch; /* allow children to stretch to full card height */
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.client-list-card > :first-child {
  min-width: 0;
}

.client-list-card__info {
  flex: 1 1 auto;
  min-width: 0;
}

.client-list-card__title,
.client-list-card__status,
.client-list-card__meta {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.client-list-card__title {
  line-height: 1.3;
}

.client-list-card__title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.client-list-card--has-unread {
  border-color: rgba(180, 83, 9, 0.28) !important;
  box-shadow: 0 10px 28px rgba(180, 83, 9, 0.08);
}

.client-list-card__meta {
  margin-top: 4px;
  line-height: 1.35;
}

.client-list-card__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  align-self: center;
}

.client-list-card__open-btn {
  min-width: 84px;
  white-space: nowrap;
}

.telegram-unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(127, 29, 29, 0.22);
}

.telegram-unread-badge--inline {
  margin-top: 1px;
}

.telegram-unread-badge--button {
  position: absolute;
  top: -8px;
  right: -8px;
}

.telegram-unread-badge--nav {
  margin-left: auto;
}

.messenger-unread-badge {
  background: #dc2626;
}

.messenger-summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.device-card__messenger-badge {
  flex: 0 0 auto;
}

.client-table-title {
  display: inline-flex;
  max-width: 100%;
  margin-right: 8px;
  vertical-align: middle;
}

.device-list-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-height: 58px;
}

.device-list-card__info {
  flex: 1 1 auto;
  min-width: 0;
}

.device-list-card__title {
  min-width: 0;
}

.device-list-card__title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.device-list-card__title-text {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.device-list-card__meta,
.device-list-card__submeta {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.device-list-card__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  align-self: center;
}

.device-list-card__open-btn {
  min-width: 76px;
  white-space: nowrap;
}

.device-list-card__open-btn {
  background: #2563eb;
  color: #fff;
  border-radius: 4px;
  padding: 6px 8px;
  border: none;
}

.device-list-card__status-inline {
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

#rentalsMapContent > div,
#rentalsList > div,
#infoModalContent > div {
  padding: 14px !important;
}

.analytics-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 17, 0.09);
  background: #fff;
  box-shadow: 0 4px 20px rgba(17, 17, 17, 0.07);
  overflow: hidden;
}

/* ── KPI top bar ─────────────────────────────────────────────────────────── */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(17, 17, 17, 0.07);
  border-bottom: 1px solid rgba(17, 17, 17, 0.07);
}

.analytics-kpi-cell {
  background: #fafaf8;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.analytics-kpi-cell__value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: #111;
  letter-spacing: -0.5px;
}

.analytics-kpi-cell__label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-kpi-cell--active .analytics-kpi-cell__value { color: #16a34a; }
.analytics-kpi-cell--money  .analytics-kpi-cell__value { color: #2563eb; }
.analytics-kpi-cell--clients .analytics-kpi-cell__value { color: #7c3aed; }

/* ── Sections ────────────────────────────────────────────────────────────── */
.analytics-section {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

.analytics-section:last-child {
  border-bottom: none;
}

.analytics-section__header {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 7px;
}

.analytics-section__header::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.analytics-section--rentals .analytics-section__header::before { background: #16a34a; }
.analytics-section--fleet   .analytics-section__header::before { background: #f59e0b; }
.analytics-section--clients .analytics-section__header::before { background: #7c3aed; }
.analytics-section--finance .analytics-section__header::before { background: #2563eb; }
.analytics-section--leads   .analytics-section__header::before { background: #0891b2; }
.analytics-section--bonus   .analytics-section__header::before { background: #f97316; }

.analytics-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.04);
}

.analytics-row:last-child {
  border-bottom: none;
  margin-bottom: 6px;
}

.analytics-row__label {
  color: #4b5563;
  font-size: 13px;
}

.analytics-row__value {
  font-weight: 700;
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
  color: #111;
}

#deviceListContent::-webkit-scrollbar,
#analyticsContent::-webkit-scrollbar,
#clientListContent::-webkit-scrollbar,
#rentalsMapContent::-webkit-scrollbar,
#infoModalContent::-webkit-scrollbar,
#rentalsList::-webkit-scrollbar,
#paymentMethodsContent::-webkit-scrollbar,
.client-card-completed-list::-webkit-scrollbar {
  width: 8px;
}

#deviceListContent::-webkit-scrollbar-thumb,
#analyticsContent::-webkit-scrollbar-thumb,
#clientListContent::-webkit-scrollbar-thumb,
#rentalsMapContent::-webkit-scrollbar-thumb,
#infoModalContent::-webkit-scrollbar-thumb,
#rentalsList::-webkit-scrollbar-thumb,
#paymentMethodsContent::-webkit-scrollbar-thumb,
.client-card-completed-list::-webkit-scrollbar-thumb {
  background: rgba(99, 99, 99, 0.38);
  border-radius: 999px;
}

#modalBackdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(17, 17, 17, 0.48);
  backdrop-filter: blur(6px);
}

.app-modal {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: none;
  flex-direction: column;
  width: min(1180px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px);
  height: min(92dvh, 980px);
  max-height: calc(100dvh - 32px) !important;
  overflow: hidden !important;
  border-radius: 26px !important;
  border: 1px solid rgba(17, 17, 17, 0.16);
  box-shadow: 0 32px 80px rgba(17, 17, 17, 0.34) !important;
  background: linear-gradient(180deg, rgba(247, 244, 236, 0.98), rgba(229, 225, 215, 0.98)) !important;
  overscroll-behavior: contain;
}

.app-modal--wide {
  width: min(1260px, calc(100vw - 32px)) !important;
}

.app-modal--mini {
  width: min(460px, calc(100vw - 32px)) !important;
  max-width: min(460px, calc(100vw - 32px)) !important;
  height: auto !important;
  max-height: min(80dvh, 620px) !important;
}

.app-modal--fullscreen {
  width: min(1480px, calc(100vw - 20px)) !important;
  max-width: calc(100vw - 20px) !important;
  height: min(95dvh, 1100px) !important;
  max-height: calc(100dvh - 20px) !important;
}

.app-modal.blurred-behind {
  filter: blur(6px);
  pointer-events: none;
  opacity: 0.95;
  transition: filter 0.18s ease;
}

#rentalsModal {
  z-index: 5000 !important;
}

/* Когда rentalsModal используется как форма создания аренды — сужаем его */
#rentalsModal:has(.rental-create-form) {
  width: min(560px, calc(100vw - 32px)) !important;
  max-width: min(560px, calc(100vw - 32px)) !important;
  height: auto !important;
  max-height: min(90dvh, 800px) !important;
}

#rentalsModal:has(.rental-create-form) .device-card__header {
  display: none !important;
}

#paymentMethodsModal {
  z-index: 7000 !important;
}

.device-alias-marker {
  position: relative;
  z-index: 1;
}

.device-alias-marker--overdue-active {
  z-index: 3;
  border-color: rgba(185, 28, 28, 0.98) !important;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    0 0 0 2px rgba(248, 113, 113, 0.82),
    0 0 22px rgba(220, 38, 38, 0.48),
    inset 0 0 0 999px rgba(127, 29, 29, 0.14) !important;
  animation: overdue-active-marker-pulse 1.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.device-alias-marker--overdue-active::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.42) 0%, rgba(239, 68, 68, 0.18) 42%, rgba(239, 68, 68, 0) 72%);
  opacity: 0.95;
  pointer-events: none;
  animation: overdue-active-marker-glow 1.2s ease-out infinite;
}

.device-alias-marker--overdue-active::after {
  content: '';
  position: absolute;
  inset: -9px;
  border: 3px solid rgba(239, 68, 68, 0.98);
  border-radius: inherit;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.38);
  opacity: 0.95;
  pointer-events: none;
  animation: overdue-active-marker-ring 1.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.device-alias-marker--focus-highlighted {
  border-color: rgba(202, 138, 4, 0.92) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(250, 204, 21, 0.34) !important;
}

.device-alias-marker--temporary-focus {
  background: #facc15 !important;
  color: #1f2937 !important;
  border-color: rgba(202, 138, 4, 0.98) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), 0 0 0 5px rgba(250, 204, 21, 0.42), 0 0 26px rgba(250, 204, 21, 0.44) !important;
  filter: saturate(1.08);
  animation: marker-temporary-focus-pulse 0.9s ease-out 4;
}

.device-alias-marker--temporary-focus::before,
.device-alias-marker--temporary-focus::after {
  animation-play-state: paused !important;
}

@keyframes marker-temporary-focus-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), 0 0 0 0 rgba(250, 204, 21, 0.45), 0 0 18px rgba(250, 204, 21, 0.28);
  }
  45% {
    transform: scale(1.05);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26), 0 0 0 8px rgba(250, 204, 21, 0.2), 0 0 26px rgba(250, 204, 21, 0.42);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), 0 0 0 0 rgba(250, 204, 21, 0), 0 0 18px rgba(250, 204, 21, 0.2);
  }
}

@keyframes overdue-active-marker-pulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.22),
      0 0 0 2px rgba(248, 113, 113, 0.82),
      0 0 18px rgba(220, 38, 38, 0.5),
      inset 0 0 0 999px rgba(127, 29, 29, 0.14);
  }
  45% {
    transform: scale(1.04);
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.26),
      0 0 0 6px rgba(248, 113, 113, 0.72),
      0 0 28px rgba(220, 38, 38, 0.62),
      inset 0 0 0 999px rgba(127, 29, 29, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.22),
      0 0 0 2px rgba(248, 113, 113, 0.82),
      0 0 18px rgba(220, 38, 38, 0.5),
      inset 0 0 0 999px rgba(127, 29, 29, 0.14);
  }
}

@keyframes overdue-active-marker-glow {
  0% {
    transform: scale(0.94);
    opacity: 0.85;
  }
  55% {
    transform: scale(1.18);
    opacity: 0.38;
  }
  100% {
    transform: scale(1.28);
    opacity: 0;
  }
}

@keyframes overdue-active-marker-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.95;
  }
  55% {
    transform: scale(1.44);
    opacity: 0;
  }
  100% {
    transform: scale(1.58);
    opacity: 0;
  }
}

.modal-header,
#infoModalHeader,
#paymentMethodsModalHeader {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(255, 212, 0, 0.98), rgba(241, 197, 0, 0.92));
  border-bottom: 1px solid rgba(17, 17, 17, 0.16);
}

.modal-title-group {
  display: grid;
  gap: 4px;
}

.modal-header-actions {
  margin-left: 12px;
  display: flex;
  align-items: center;
}

.rentals-filter-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(17,17,17,0.08);
  background: #fff;
  font-weight: 700;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.modal-subtitle {
  font-size: 13px;
  color: rgba(17, 17, 17, 0.72);
}

.panel-title--action {
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
}

.panel-title--action:hover,
.panel-title--action:focus-visible {
  color: #0f766e;
  transform: translateY(-1px);
  outline: none;
}

.dashboard-screen {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 4px;
}

.dashboard-screen__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 212, 0, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245, 242, 234, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.dashboard-screen__toolbar--analytics {
  align-items: flex-end;
}

.dashboard-screen__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dashboard-screen__toolbar--fleet,
.dashboard-screen__toolbar--rentals {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-screen__controls--rentals {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.dashboard-screen__controls--rentals .dashboard-screen__search {
  width: 100%;
  min-width: 0;
}

.dashboard-screen__controls--fleet {
  flex: 1 1 420px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-screen__stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dashboard-screen__stack--fleet-filters .dashboard-screen__select,
.dashboard-screen__stack--fleet-filters .network-branch-scope-field {
  width: 100%;
}

.dashboard-screen__search--fleet {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.dashboard-screen__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

.dashboard-screen__aside--fleet {
  flex: 0 1 520px;
  width: min(100%, 520px);
}
.dashboard-screen__aside--rentals {
  flex: 0 0 auto;
  min-width: min(280px, 100%);
}

.dashboard-screen__aside--fleet #fleetFullscreenBranchScopeWrap {
  justify-content: flex-start;
}

.dashboard-screen__controls--analytics {
  margin-left: auto;
}

.dashboard-screen__select,
.dashboard-screen__search,
.dashboard-screen__date-field input {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 14px;
  font: inherit;
  color: #111827;
}

.dashboard-screen__search {
  min-width: min(420px, 70vw);
}

.dashboard-screen__meta {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.74);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.fleet-fullscreen-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  overflow-x: auto;
}

.fleet-fullscreen-meta__tiles {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.fleet-fullscreen-meta__item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.10);
  min-width: 0;
  flex-shrink: 0;
  align-items: flex-start;
  cursor: pointer;
  transition: transform 0.1s;
}
.fleet-fullscreen-meta__item:hover { transform: translateY(-1px); }

.fleet-fullscreen-meta__item strong {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.fleet-fullscreen-meta__item span {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.fleet-fullscreen-meta__item--emerald {
  background: rgba(16, 185, 129, 0.1);
}

.fleet-fullscreen-meta__item--blue {
  background: rgba(37, 99, 235, 0.1);
}

.fleet-fullscreen-meta__item--violet {
  background: rgba(124, 58, 237, 0.12);
}

.fleet-fullscreen-meta__item--amber {
  background: rgba(245, 158, 11, 0.12);
}

.fleet-fullscreen-meta__item--rose {
  background: rgba(244, 63, 94, 0.1);
}

.fleet-fullscreen-meta__item--slate {
  background: rgba(148, 163, 184, 0.12);
}

.fleet-fullscreen-meta__item--active {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.12);
}

.fleet-fullscreen-reset-btn {
  background: transparent;
  border: 1px solid rgba(148,163,184,0.12);
  color: #0f172a;
  padding: 6px 8px;
  border-radius: 10px;
  font-weight:700;
  font-size:12px;
}

/* ensure 'Показано' stays compact on the left */
.fleet-fullscreen-meta__item--slate strong { font-weight: 800; }

.rentals-fullscreen-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(148,163,184,0.08);
  min-width: min(260px, 100%);
  width: auto;
  max-width: 100%;
}

.rentals-fullscreen-meta__meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rentals-fullscreen-meta__tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.rentals-fullscreen-meta__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.10);
  background: rgba(255,255,255,0.6);
  min-width: 0;
  align-items: flex-start;
}

.rentals-fullscreen-meta__item strong {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}

.rentals-fullscreen-meta__item span {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rentals-fullscreen-meta__item--emerald {
  background: rgba(16, 185, 129, 0.1);
}

.rentals-fullscreen-meta__item--amber {
  background: rgba(245, 158, 11, 0.14);
}

.rentals-fullscreen-meta__item--slate {
  background: rgba(148, 163, 184, 0.12);
}

.rentals-fullscreen-meta__item--blue {
  background: rgba(37, 99, 235, 0.1);
}

.rentals-fullscreen-meta__item--rose {
  background: rgba(244, 63, 94, 0.1);
}

.rentals-fullscreen-meta__item--active {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.12);
}

.rentals-fullscreen-reset-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid rgba(148,163,184,0.25);
  color: #475569;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.rentals-fullscreen-reset-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.rentals-fullscreen-meta__count {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  padding: 0 2px;
}

/* Mobile: compact tiles */
@media (max-width: 900px) {
  .rentals-fullscreen-meta__tiles {
    grid-template-columns: repeat(3, minmax(60px, 1fr));
    gap: 4px;
  }
  .rentals-fullscreen-meta__item {
    padding: 6px 8px;
  }
}

.dashboard-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  align-content: start;
}

/* ── Список транзакций (группировка по дням, строки) ───────────────────── */
.txn-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.txn-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.txn-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.txn-day__date {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}
.txn-day__total {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.txn-group {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  overflow: hidden;
}
.txn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.txn-row--last {
  border-bottom: none;
}
/* Управление удалением операций — видно только админу (кнопки рендерятся под правами) */
/* Размер чекбоксов задаём явно: глобальное `input, select, textarea { width: 100% }`
   иначе растягивает их на всю строку (подпись «Выбрать все показанные» уезжала в три
   строки и наезжала на счётчик). */
.txn-select {
  flex: none;
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #b91c1c;
}
.txn-bulk-bar__all input[type="checkbox"] {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: #b91c1c;
}
.txn-delete-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(185, 28, 28, 0.35);
  border-radius: 7px;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  /* На узких экранах строка и так плотная — держим кнопку неброской до наведения */
  opacity: 0.55;
  transition: opacity 0.12s ease, background 0.12s ease;
}
.txn-delete-btn:hover {
  opacity: 1;
  background: rgba(185, 28, 28, 0.08);
}
.txn-delete-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.txn-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: 10px;
  background: rgba(185, 28, 28, 0.05);
}
.txn-bulk-bar__all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
  /* Подпись — в одну строку: перенос превращал её в узкий столбик рядом со счётчиком */
  white-space: nowrap;
  flex: none;
}
.txn-bulk-bar__count {
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  margin-right: auto;
}
.txn-bulk-bar__delete {
  background: #b91c1c;
  color: #fff;
  border-color: #b91c1c;
}
.txn-row__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.txn-row__main {
  flex: 1;
  min-width: 0;
}
.txn-row__title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-row__meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.txn-row__meta .txn-row__client {
  color: #334155;
  font-weight: 600;
}
.txn-row__amount {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.txn-row__amount--income { color: #16a34a; }
.txn-row__amount--expense { color: #dc2626; }
.txn-row__amount--info { color: #94a3b8; }

/* Крестик закрытия (иконка вместо тёмной пилюли «Закрыть») */
.modal-close-x {
  appearance: none !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
  background: rgba(15, 23, 42, 0.06) !important;
  color: #334155 !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: background .15s, color .15s, border-color .15s !important;
}
.modal-close-x:hover {
  background: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}
.modal-close-x svg { display: block; }

@media (max-width: 1179px) {
  .txn-row { padding: 11px 13px; gap: 10px; }
  .txn-row__icon { width: 34px; height: 34px; }
  .txn-row__title { font-size: 13px; }
  .txn-row__amount { font-size: 14px; }
}

.leads-modal {
  background:
    radial-gradient(circle at top left, rgba(255, 212, 0, 0.22), transparent 20%),
    linear-gradient(180deg, rgba(247, 244, 236, 0.99), rgba(233, 229, 220, 0.98)) !important;
}

.leads-modal__header {
  align-items: center;
}

.leads-modal__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 18px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.leads-modal__sidebar {
  min-width: 0;
}

.leads-create-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 244, 236, 0.94));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08);
}

.leads-create-card__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #92400e;
  background: rgba(251, 191, 36, 0.2);
}

.leads-create-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}

.leads-create-card p {
  margin: 0;
  color: #5b6474;
  font-size: 14px;
  line-height: 1.45;
}

.leads-create-form {
  display: grid;
  gap: 12px;
}

.leads-create-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.leads-create-form input,
.leads-create-form textarea,
.leads-create-form select {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 14px;
  font: inherit;
  color: #0f172a;
  box-sizing: border-box;
}

.leads-create-form textarea {
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
}

.leads-create-form__actions {
  display: flex;
  justify-content: flex-start;
}

/* ── Новая заявка: шапка модала ── */
.lcm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.lcm-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e 0%, #059669 100%);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.32);
}

.lcm-header__text {
  flex: 1;
  min-width: 0;
}

.lcm-header__title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.lcm-header__subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.lcm-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  color: #64748b !important;
  font-size: 14px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;
  box-shadow: none !important;
  transition: background 0.15s ease !important;
}

.lcm-close-btn:hover {
  background: rgba(15, 23, 42, 0.09) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Submit кнопка */
.lcm-submit-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #0f766e 0%, #059669 100%) !important;
  color: #fff !important;
  border: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3) !important;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
}

.lcm-submit-btn:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.38) !important;
}

.lcm-submit-btn:disabled {
  opacity: 0.6;
  box-shadow: none !important;
}

.leads-modal__board-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.leads-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 16px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.leads-workspace.is-detail-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.leads-detail-toggle-btn {
  white-space: nowrap;
}

.leads-modal__toolbar {
  margin: 0;
}

.leads-board-top-scroll {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  margin: -4px 0 2px;
  padding-bottom: 4px;
  scrollbar-gutter: stable both-edges;
  opacity: 0.98;
}

.leads-board-top-scroll::-webkit-scrollbar {
  height: 14px;
}

.leads-board-top-scroll::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
}

.leads-board-top-scroll::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.52);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
}

.leads-board-top-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(51, 65, 85, 0.72);
}

.leads-board-top-scroll.is-visible {
  opacity: 0.98;
}

.leads-board-top-scroll__inner {
  height: 18px;
}

.leads-modal__controls {
  flex: 1 1 auto;
}

.leads-toolbar__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
}

.leads-toolbar__archive-btn {
  white-space: nowrap;
}

.leads-archive-modal {
  max-width: min(1100px, calc(100vw - 32px));
}

.leads-archive-modal__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.leads-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  grid-template-columns: none;
  grid-auto-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 6px;
  padding-bottom: 6px;
  will-change: scroll-position;
  -webkit-overflow-scrolling: touch;
}

.leads-board__column-dot--overdue {
  background: #ea580c;
}

.leads-board__column-dot--completed {
  background: #0f766e;
}

.lead-detail-panel {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  overflow: auto;
}

.leads-workspace.is-detail-hidden .lead-detail-panel {
  display: none;
}

.lead-detail-panel__empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

.lead-detail-panel__content {
  display: grid;
  gap: 16px;
}

.lead-detail-panel__section {
  display: grid;
  gap: 10px;
}

.lead-detail-panel__section--fields label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.lead-detail-panel__section--fields select,
.lead-detail-panel__section--fields textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.96);
  padding: 10px 12px;
  font: inherit;
  color: #0f172a;
  box-sizing: border-box;
}

.lead-detail-panel__section--fields textarea {
  min-height: 120px;
  resize: vertical;
}

.lead-detail-panel__eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #92400e;
  background: rgba(251, 191, 36, 0.2);
}


.lead-detail-panel__section-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.lead-detail-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lead-detail-panel__header-main {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.lead-detail-panel__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.lead-detail-panel__title {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
  word-break: break-word;
  min-width: 0;
  flex: 1 1 auto;
}
.lead-detail-panel__title[style*="cursor: pointer"]:hover {
  color: #7c3aed;
  text-decoration: underline;
}

.lead-detail-panel__meta-line {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  line-height: 1.35;
}

.lead-detail-panel__stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
}

.lead-detail-panel__stage-badge[data-stage="incoming"] {
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
}

.lead-detail-panel__stage-badge[data-stage="in_rent"] {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.lead-detail-panel__stage-badge[data-stage="rejected"],
.lead-detail-panel__stage-badge[data-stage="cancelled"] {
  background: rgba(244, 63, 94, 0.16);
  color: #be123c;
}

.lead-detail-panel__stage-badge[data-stage="completed"] {
  background: rgba(15, 118, 110, 0.16);
  color: #0f766e;
}

.lead-detail-panel__stage-badge[data-stage="overdue"] {
  background: rgba(234, 88, 12, 0.16);
  color: #c2410c;
}

.lead-detail-panel__close {
  display: none;
}

.lead-detail-panel__close:hover {
  background: rgba(15, 23, 42, 0.14);
}

.lead-detail-panel__inline-actions {
  display: flex;
  justify-content: flex-start;
}

.lead-detail-panel__inline-actions button,
.lead-detail-panel__quick-actions button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lead-detail-panel__inline-actions button {
  background: #0f766e;
  color: #fff;
}

.lead-detail-panel__quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-detail-panel__quick-actions button {
  background: #e2e8f0;
  color: #0f172a;
}

.lead-detail-panel__quick-actions button:nth-child(2) {
  background: #0f766e;
  color: #fff;
}

.lead-detail-panel__quick-actions button.is-active {
  background: #0f766e;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.2);
}

.lead-detail-panel__quick-actions button.is-active[data-stage="incoming"] {
  background: rgba(251, 191, 36, 0.24);
  color: #92400e;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.18);
}

.lead-detail-panel__quick-actions button.is-active[data-stage="in_rent"] {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.18);
}

.lead-detail-panel__quick-actions button.is-active[data-stage="rejected"],
.lead-detail-panel__quick-actions button.is-active[data-stage="cancelled"] {
  background: rgba(244, 63, 94, 0.16);
  color: #be123c;
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.16);
}

.lead-detail-panel__quick-actions button.is-danger,
.lead-card__actions button.is-danger {
  background: #dc2626;
  color: #fff;
}

.lead-detail-panel__quick-actions button.is-restore,
.lead-card__actions button.is-restore,
.leads-archive-list__restore {
  background: #0f766e;
  color: #fff;
}

.lead-detail-panel__history {
  display: grid;
  gap: 10px;
}

.lead-detail-panel__history-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.lead-detail-panel__history-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.lead-detail-panel__history-meta,
.lead-detail-panel__history-text {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.leads-board__column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.leads-board__column.is-drop-target {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(255, 251, 235, 0.92);
  box-shadow: inset 0 0 0 2px rgba(217, 119, 6, 0.18), 0 18px 30px rgba(217, 119, 6, 0.14);
  transform: translateY(-2px) scale(1.01);
}

.leads-board__column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leads-board__column-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.leads-board__column-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.leads-board__column-dot--incoming {
  background: #f59e0b;
}

.leads-board__column-dot--in_rent {
  background: #10b981;
}

.leads-board__column-dot--rejected {
  background: #f43f5e;
}

.leads-board__column-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.leads-board__column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-weight: 800;
  color: #334155;
}

.leads-board__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.leads-board__empty {
  margin-top: auto;
  margin-bottom: auto;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.36);
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.lead-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
  cursor: grab;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  position: relative;
}

.lead-card.is-selected {
  border-color: rgba(15, 118, 110, 0.46);
  box-shadow: 0 18px 30px rgba(15, 118, 110, 0.16);
}

.lead-card.is-busy {
  opacity: 0.66;
  cursor: progress;
}

.lead-card.is-dragging {
  opacity: 0.38;
  transform: scale(0.98);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.lead-card:active {
  cursor: grabbing;
}

.lead-card--drag-preview {
  opacity: 0.98;
  transform: rotate(1.5deg);
  border-color: rgba(15, 118, 110, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(240, 253, 250, 0.98));
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.2);
  cursor: grabbing;
}

.lead-card__top,
.lead-card__meta,
.lead-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lead-card__title {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  min-width: 0;
  flex: 1 1 auto;
}

.lead-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.lead-card__info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.lead-card__field {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}

.lead-card__field-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.lead-card__field-value {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  text-align: right;
  min-width: 0;
}

.lead-card__status--complete {
  color: #15803d;
}

.lead-card__status--partial {
  color: #c2410c;
}

.lead-card__phone,
.lead-card__note,
.lead-card__subline,
.lead-card__branch {
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
}

.lead-card__branch {
  font-weight: 700;
  color: #334155;
}

.lead-card__note {
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lead-card__badge--manual {
  background: rgba(251, 191, 36, 0.18);
  color: #92400e;
}

.lead-card__badge--integration {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.lead-card__badge--complete {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.lead-card__badge--partial {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
}

.lead-card__actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lead-card__actions {
  gap: 6px;
}

.lead-card__actions button:first-child {
  background: #e2e8f0;
  color: #0f172a;
}

.lead-card__actions button:nth-child(2) {
  background: #dbeafe;
  color: #1d4ed8;
}

.lead-card__actions button:nth-child(3) {
  background: #0f766e;
  color: #fff;
}

.lead-card__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.lead-delete-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.lead-delete-icon-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.lead-delete-icon-btn:hover {
  background: rgba(239, 68, 68, 0.18);
}

.lead-delete-icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.lead-delete-icon-btn--inline {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 7px;
  align-self: center;
}

.lead-delete-icon-btn--header {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 8px;
  flex: 0 0 auto;
  align-self: flex-start;
}

.lead-detail-panel__quick-actions .lead-delete-icon-btn--inline {
  min-height: 24px;
  padding: 0;
  justify-self: start;
}

.lead-card__delete-btn {
  position: static;
  flex: 0 0 auto;
  align-self: flex-start;
}

.leads-archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.leads-archive-list__empty {
  padding: 22px;
  border-radius: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.78);
  color: #64748b;
  font-weight: 600;
  text-align: center;
}

.leads-archive-detail-modal {
  max-width: min(760px, calc(100vw - 32px));
}

.leads-archive-detail-modal__body {
  padding: 18px 20px !important;
}

.lead-detail-panel--modal {
  border-radius: 24px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.network-admin-subpanel--lead-sources textarea {
  min-height: 132px;
}

.network-lead-sources-editor {
  display: grid;
  gap: 12px;
}

.network-lead-sources-editor__label {
  display: grid;
  gap: 8px;
}

.network-lead-sources-editor__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
}

.network-lead-sources-editor__row input {
  min-width: 0;
}

.network-lead-sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 52px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.32);
  background: rgba(248, 250, 252, 0.84);
}

.network-lead-sources-list:empty::before {
  content: 'Список пока пуст. Добавьте источник и сохраните.';
  color: #64748b;
  font-size: 13px;
}

.network-lead-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.network-lead-source-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 1180px) {
  .leads-modal__body {
    display: flex;
    flex-direction: column;
    overflow: auto;
    height: auto;
  }

  .leads-modal__sidebar,
  .leads-modal__board-wrap {
    width: 100%;
  }

  .leads-modal__board-wrap {
    min-height: fit-content;
    overflow: visible;
  }

  .leads-workspace {
    grid-template-columns: 1fr;
    flex: none;
    height: auto;
    overflow: visible;
  }

  .leads-board {
    grid-auto-columns: minmax(280px, 86vw);
    height: auto;
    overflow-x: auto;
    overflow-y: visible;
    padding-right: 0;
  }

  .leads-board-top-scroll {
    display: block !important;
  }

  .leads-board__column {
    height: min(68vh, 760px);
    max-height: min(68vh, 760px);
  }
}

.fleet-fullscreen-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.fleet-fullscreen-section {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.fleet-fullscreen-section__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px;
}

.fleet-fullscreen-section__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.fleet-fullscreen-section__title--emerald {
  color: #047857;
}

.fleet-fullscreen-section__title--blue {
  color: #1d4ed8;
}

.fleet-fullscreen-section__title--violet {
  color: #6d28d9;
}

.fleet-fullscreen-section__title--rose {
  color: #be123c;
}

.fleet-fullscreen-section__title--amber {
  color: #b45309;
}

.fleet-fullscreen-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.fleet-fullscreen-section__count--emerald {
  background: rgba(16, 185, 129, 0.14);
}

.fleet-fullscreen-section__count--blue {
  background: rgba(37, 99, 235, 0.14);
}

.fleet-fullscreen-section__count--violet {
  background: rgba(124, 58, 237, 0.14);
}

.fleet-fullscreen-section__count--rose {
  background: rgba(244, 63, 94, 0.14);
}

.fleet-fullscreen-section__count--amber {
  background: rgba(245, 158, 11, 0.16);
}

.fleet-fullscreen-section__subtitle {
  font-size: 12px;
  color: #64748b;
}

.fleet-fullscreen-section__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  align-items: stretch;
}

.fleet-fullscreen-section__grid .dashboard-empty {
  grid-column: 1 / -1;
}

.dashboard-list-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top right, rgba(255, 212, 0, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244, 241, 233, 0.95));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09);
}

.fleet-fullscreen-card {
  height: auto;
  min-height: 0;
  gap: 10px;
  padding: 16px;
}

.fleet-fullscreen-card__client-line {
  min-height: 34px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fleet-fullscreen-card__client-line button {
  align-self: flex-start;
}

.rentals-fullscreen-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

.view-mode-toggle {
  display: flex;
  gap: 3px;
  margin-right: 8px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.view-mode-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.view-mode-toggle__btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}
.view-mode-toggle__btn.is-active {
  background: rgba(255, 255, 255, 0.75);
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.modal-header-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-black);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.15s, transform 0.1s, background 0.15s;
  margin-right: 8px;
}
.modal-header-add-btn:hover {
  background: #2d2d2d;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.modal-header-add-btn__icon {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.9;
}

.rentals-fullscreen-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.rentals-fullscreen-section__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px;
}

.rentals-fullscreen-section__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.rentals-fullscreen-section__title--rose {
  color: #b91c1c;
}

.rentals-fullscreen-section__title--emerald {
  color: #047857;
}

.rentals-fullscreen-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 13px;
  font-weight: 900;
  color: inherit;
}

.rentals-fullscreen-section__subtitle {
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.rentals-fullscreen-section__grid {
  align-content: start;
}

.rentals-fullscreen-card {
  min-width: 0;
}

.rentals-fullscreen-card__client-line,
.rentals-fullscreen-card__term-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rentals-fullscreen-card__client-line button {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.rentals-fullscreen-card__due-value {
  font-weight: 800;
}

.rentals-fullscreen-card__remaining-line strong {
  font-weight: 900;
}

.rentals-fullscreen-card__overdue {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #c2410c;
}

/* ---- Виджет «дней до завершения аренды» (Экран аренд: карточки + таблица) ---- */
/* 5+ дней — зелёный, 3–4 — оранжевый, 2/1 — красный, просрочка — «-N» пульсирует красным. */
.rental-days-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  margin-left: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}
.dashboard-list-card .rental-days-badge { margin-left: 0; margin-top: 4px; width: fit-content; }
.rental-days-badge--green  { color: #166534; background: rgba(34, 197, 94, 0.14);  border-color: rgba(34, 197, 94, 0.30); }
.rental-days-badge--orange { color: #b45309; background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.34); }
.rental-days-badge--red    { color: #b91c1c; background: rgba(239, 68, 68, 0.14);  border-color: rgba(239, 68, 68, 0.32); }
.rental-days-badge--overdue {
  color: #fff;
  background: #ef4444;
  border-color: transparent;
  animation: rentalDaysPulse 1.15s ease-in-out infinite;
}
@keyframes rentalDaysPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); transform: scale(1); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);   transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .rental-days-badge--overdue { animation: none; }
}

.dashboard-list-card__title {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
}

.dashboard-list-card__meta,
.dashboard-list-card__line {
  font-size: 13px;
  color: #475569;
}

.dashboard-list-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  width: fit-content;
}

.dashboard-list-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.dashboard-list-card__actions button {
  min-height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-empty {
  padding: 34px;
  border-radius: 24px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: #64748b;
  background: rgba(255,255,255,0.7);
}

.dashboard-period-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.06);
}

.dashboard-period-switch__btn {
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-period-switch__btn.is-active {
  background: #0f766e;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

.dashboard-screen__date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.dashboard-screen__date-field input {
  min-width: 170px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.dashboard-analytics-screen {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── 3-D Analytics Globe ──────────────────────────────────────────────────── */
.analytics-3d-section {
  border-radius: 24px;
  background: linear-gradient(160deg, #0c1627 0%, #030b1a 100%);
  border: 1px solid rgba(99, 130, 170, 0.14);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.analytics-3d-header {
  padding: 20px 22px 10px;
}

.analytics-3d-title {
  font-size: 17px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.analytics-3d-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.65);
}

.analytics-3d-canvas-wrap {
  width: 100%;
  line-height: 0;
}

.analytics-3d-canvas {
  display: block;
  width: 100%;
  touch-action: none;
}

.analytics-3d-controls {
  padding: 0 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-3d-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.analytics-3d-toggle {
  padding: 5px 13px;
  border-radius: 30px;
  border: 1.5px solid rgba(100, 116, 139, 0.3);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s, background 0.18s;
  opacity: 0.38;
  color: rgba(100, 116, 139, 0.5);
  line-height: 1.3;
}

.analytics-3d-toggle--active {
  opacity: 1;
}

.analytics-3d-modes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.analytics-3d-mode-btn {
  padding: 5px 15px;
  border-radius: 9px;
  border: 1px solid rgba(99, 130, 170, 0.22);
  background: rgba(99, 130, 170, 0.08);
  color: rgba(148, 163, 184, 0.55);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  line-height: 1.3;
}

.analytics-3d-mode-btn--active {
  background: rgba(99, 130, 170, 0.22);
  color: #f1f5f9;
  border-color: rgba(99, 130, 170, 0.42);
}

.analytics-3d-reset-btn {
  padding: 5px 14px;
  border-radius: 9px;
  border: 1px solid rgba(99, 130, 170, 0.35);
  background: rgba(99, 130, 170, 0.12);
  color: rgba(148, 163, 184, 0.65);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  line-height: 1.3;
  margin-left: 6px;
}

.analytics-3d-reset-btn:hover {
  background: rgba(99, 130, 170, 0.26);
  color: #f1f5f9;
  border-color: rgba(99, 130, 170, 0.6);
}
/* ──────────────────────────────────────────────────────────────────────────── */

.dashboard-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.dashboard-section-heading__title {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}

.dashboard-section-heading__subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.dashboard-kpi-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
  color: #fff;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255,255,255,0.08);
}

.dashboard-kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.35);
}

.dashboard-kpi-card--emerald {
  background: linear-gradient(180deg, rgba(6, 95, 70, 0.98), rgba(15, 118, 110, 0.94));
}

.dashboard-kpi-card--amber {
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.98), rgba(217, 119, 6, 0.94));
}

.dashboard-kpi-card--blue {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.98), rgba(37, 99, 235, 0.94));
}

.dashboard-kpi-card--rose {
  background: linear-gradient(180deg, rgba(159, 18, 57, 0.98), rgba(225, 29, 72, 0.94));
}

.dashboard-kpi-card--violet {
  background: linear-gradient(180deg, rgba(91, 33, 182, 0.98), rgba(124, 58, 237, 0.94));
}

.dashboard-kpi-card--teal {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.98), rgba(8, 145, 178, 0.94));
}

.dashboard-kpi-card--indigo {
  background: linear-gradient(180deg, rgba(55, 48, 163, 0.98), rgba(79, 70, 229, 0.94));
}

.dashboard-kpi-card--slate {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(51, 65, 85, 0.94));
}

.dashboard-kpi-card__label {
  font-size: 12px;
  color: rgba(255,255,255,0.68);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-kpi-card__value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.dashboard-kpi-card__hint {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.74);
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-chart-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 24%),
    rgba(255,255,255,0.94);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.dashboard-chart-card__title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.dashboard-chart-card__subtitle {
  font-size: 12px;
  color: #64748b;
}

.dashboard-chart-card__svg {
  width: 100%;
  height: auto;
  display: block;
}

.dashboard-chart-card__scroller {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  margin-bottom: -4px;
}

.dashboard-chart-card__scroller .dashboard-chart-card__svg {
  max-width: none;
  min-width: 100%;
}

.dashboard-chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 124px;
  max-width: 180px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.dashboard-chart-tooltip strong,
.dashboard-chart-tooltip span,
.dashboard-chart-tooltip b {
  display: block;
}

.dashboard-chart-tooltip strong {
  font-size: 12px;
  font-weight: 800;
}

.dashboard-chart-tooltip span {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.76);
}

.dashboard-chart-tooltip b {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
}

.dashboard-chart-point {
  cursor: pointer;
  transition: r 0.16s ease, transform 0.16s ease, stroke 0.16s ease, stroke-width 0.16s ease;
}

.dashboard-chart-point.is-active {
  r: 6;
  stroke: rgba(255,255,255,0.95);
  stroke-width: 3;
}

.dashboard-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #475569;
}

.dashboard-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dashboard-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-bars__row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.dashboard-bars__label,
.dashboard-bars__value {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.dashboard-bars__track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.dashboard-bars__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.dashboard-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.dashboard-insight-card {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(245, 242, 234, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.dashboard-insight-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.dashboard-insight-card strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  color: #0f172a;
}

.modal-body,
#infoModalContent,
#rentalsList,
#paymentMethodsContent,
#clientDataContent {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px !important;
  overflow: auto !important;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#deviceListContent,
#analyticsContent,
#clientListContent,
#rentalsMapContent,
.client-card-completed-list,
.details-popup .content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.modal-form {
  display: grid;
  gap: 16px;
}

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

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

.modal-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

/* ── Unified Chat Modal ──────────────────────────────────────── */
.app-modal--chat {
  width: min(720px, calc(100vw - 32px)) !important;
  height: min(88dvh, 820px) !important;
}

.chat-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(17,17,17,0.1);
}
.chat-modal-header--tg {
  background: linear-gradient(135deg, #2aabee 0%, #1b8ecf 100%);
}
.chat-modal-header--max {
  background: linear-gradient(135deg, #7b2fd4 0%, #5a18a8 100%);
}

.chat-modal-header__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  color: #fff;
}

.chat-modal-header__info {
  flex: 1;
  min-width: 0;
}
.chat-modal-header__name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-modal-header__meta {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-modal-header__actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.chat-modal-hbtn {
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.chat-modal-hbtn:hover { background: rgba(255,255,255,0.32); }

.chat-modal-status-bar {
  padding: 7px 18px;
  background: rgba(255,255,255,0.65);
  border-bottom: 1px solid rgba(17,17,17,0.07);
  font-size: 12px;
  color: rgba(17,17,17,0.6);
  text-align: center;
  flex-shrink: 0;
}

.chat-modal-messages {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(246,244,239,0.95);
}

.chat-modal-date-sep {
  text-align: center;
  font-size: 11.5px;
  color: rgba(17,17,17,0.5);
  background: rgba(17,17,17,0.08);
  border-radius: 10px;
  padding: 3px 11px;
  align-self: center;
  margin: 10px 0 8px;
}

.chat-modal-msg {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 84%;
  margin-bottom: 4px;
}
.chat-modal-msg--in  { align-self: flex-start; }
.chat-modal-msg--out { align-self: flex-end; flex-direction: row-reverse; }

.chat-modal-msg__bubble {
  padding: 9px 13px 7px;
  border-radius: 18px;
  word-break: break-word;
  position: relative;
  min-width: 56px;
}
.chat-modal-msg--in .chat-modal-msg__bubble {
  background: #fff;
  border: 1px solid rgba(17,17,17,0.07);
  box-shadow: 0 1px 3px rgba(17,17,17,0.06);
  border-bottom-left-radius: 4px;
}
.chat-modal-msg--out .chat-modal-msg__bubble {
  border-bottom-right-radius: 4px;
}
.chat-modal-msg--tg.chat-modal-msg--out .chat-modal-msg__bubble {
  background: linear-gradient(135deg, #2aabee, #1a8dc8);
  color: #fff;
}
.chat-modal-msg--max.chat-modal-msg--out .chat-modal-msg__bubble {
  background: linear-gradient(135deg, #7b2fd4, #5a18a8);
  color: #fff;
}

.chat-modal-msg__text {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.chat-modal-msg__time {
  font-size: 11px;
  margin-top: 3px;
  text-align: right;
  opacity: 0.6;
}
.chat-modal-msg--in .chat-modal-msg__time {
  text-align: left;
  color: rgba(17,17,17,0.48);
}

.chat-modal-msg__del {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(17,17,17,0.28);
  font-size: 13px;
  padding: 4px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
}
.chat-modal-msg:hover .chat-modal-msg__del { opacity: 1; }
.chat-modal-msg__del:hover { color: #e53e3e; }

.chat-modal-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(17,17,17,0.42);
  font-size: 14px;
  gap: 10px;
  padding: 40px 0;
}
.chat-modal-empty__icon {
  font-size: 38px;
  opacity: 0.35;
}

.chat-modal-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 16px;
  background: rgba(255,255,255,0.92);
  border-top: 1px solid rgba(17,17,17,0.09);
  flex-shrink: 0;
}
.chat-modal-composer__input {
  flex: 1;
  border: 1px solid rgba(17,17,17,0.14);
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 14px;
  resize: none;
  min-height: 40px;
  max-height: 110px;
  background: #fff;
  box-sizing: border-box;
  line-height: 1.45;
  font-family: inherit;
  transition: border-color 0.15s;
  overflow-y: auto;
}
.chat-modal-composer__input:focus {
  outline: none;
  border-color: rgba(17,17,17,0.32);
}
.chat-modal-composer__input:disabled {
  background: rgba(17,17,17,0.04);
  color: rgba(17,17,17,0.4);
}
.chat-modal-composer__send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
  color: #fff;
}
.chat-modal-composer__send:hover:not(:disabled) {
  opacity: 0.85;
  transform: scale(1.06);
}
.chat-modal-composer__send:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}
.chat-modal-composer--tg .chat-modal-composer__send { background: #2aabee; }
.chat-modal-composer--max .chat-modal-composer__send { background: #7b2fd4; }

/* ── Reminder Modal ── */
.reminder-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(17,17,17,0.2);
}
.reminder-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #1a3a5c 0%, #2c5282 100%);
  flex-shrink: 0;
}
.reminder-modal-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reminder-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reminder-modal-channels {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.reminder-channel-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.5;
}
.reminder-channel-chip--tg {
  background: rgba(42,171,238,0.3);
  color: #b8e8ff;
}
.reminder-channel-chip--max {
  background: rgba(123,47,212,0.35);
  color: #d8b8ff;
}
.reminder-modal-close {
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.reminder-modal-close:hover { background: rgba(255,255,255,0.32); }
.reminder-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.reminder-modal-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(17,17,17,0.42);
  margin-bottom: 8px;
}
.reminder-modal-presets {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.reminder-preset-btn {
  text-align: left;
  background: rgba(17,17,17,0.04);
  border: 1.5px solid rgba(17,17,17,0.09);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  color: rgba(17,17,17,0.8);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1.35;
  font-family: inherit;
  width: 100%;
}
.reminder-preset-btn:hover {
  background: rgba(44,82,130,0.07);
  border-color: rgba(44,82,130,0.22);
  color: #1a3a5c;
}
.reminder-preset-btn--active {
  background: rgba(44,82,130,0.13);
  border-color: #2c5282;
  color: #1a3a5c;
  font-weight: 600;
}
.reminder-modal-textarea {
  width: 100%;
  border: 1.5px solid rgba(17,17,17,0.13);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 88px;
  max-height: 180px;
  box-sizing: border-box;
  line-height: 1.45;
  transition: border-color 0.15s;
  background: #fafafa;
}
.reminder-modal-textarea:focus {
  outline: none;
  border-color: #2c5282;
  background: #fff;
}
.reminder-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid rgba(17,17,17,0.08);
  background: rgba(255,255,255,0.96);
  flex-shrink: 0;
}

.new-client-date-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.new-client-date-input__native {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.new-client-files-upload {
  display: grid;
  gap: 10px;
}

.new-client-files-upload__label {
  display: grid;
  gap: 6px;
}

.new-client-files-upload.has-files .new-client-files-upload__label {
  display: none;
}

.new-client-files-hint {
  font-size: 12px;
  color: rgba(17, 17, 17, 0.62);
}

.new-client-files-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.new-client-file-card {
  width: 132px;
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.9);
}

.new-client-file-card img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
}

.new-client-file-card__icon {
  width: 100%;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(17, 17, 17, 0.06);
  font-size: 28px;
}

.new-client-file-card__name {
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
}

.new-client-file-card__remove {
  padding: 6px 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(99, 99, 99, 0.98), rgba(62, 62, 62, 0.98));
  color: #fff;
}

.new-client-file-card--add {
  align-content: center;
  justify-items: center;
  min-height: 132px;
  cursor: pointer;
  background: rgba(255, 212, 0, 0.16);
}

.new-client-file-card--add:hover {
  background: rgba(255, 212, 0, 0.24);
}

.new-client-file-card__plus {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  font-size: 34px;
  line-height: 1;
}

.modal-fieldset {
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 252, 245, 0.76);
}

.modal-fieldset legend {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
}

#infoModalContent.client-modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden !important;
  height: 100%;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(17, 17, 17, 0.12);
}

.info-key {
  width: 42%;
  font-weight: 700;
  color: rgba(17, 17, 17, 0.74);
}

.info-val {
  width: 58%;
  word-break: break-word;
}

.info-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.status-dot.online {
  background: var(--success);
}

.status-dot.offline {
  background: var(--danger);
}

.client-card-fixed {
  flex: 0 0 auto;
  padding: 14px;
}

.client-card-completed {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
  padding: 14px 0 0;
}

.client-card-completed-title {
  flex: 0 0 auto;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0 14px;
}

.client-card-completed-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
  box-sizing: border-box;
}

.client-rental-card {
  border-radius: 12px;
  box-sizing: border-box;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.client-rental-card-active {
  border: 1.5px solid rgba(46, 125, 50, 0.28);
  background: linear-gradient(160deg, rgba(236, 253, 240, 0.95) 0%, rgba(255, 255, 255, 0.99) 100%);
  box-shadow: 0 2px 12px rgba(46, 125, 50, 0.09);
  border-left: 4px solid #22c55e;
}

.client-rental-card-completed {
  border: 1px solid #e2e8f0;
  background: #fafbfc;
  border-left: 4px solid #94a3b8;
}

.client-rental-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.client-rental-card__device-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-rental-card__status-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.client-rental-card__status-badge--active {
  background: #dcfce7;
  color: #166534;
}
.client-rental-card__status-badge--overdue {
  background: #ffedd5;
  color: #9a3412;
}
.client-rental-card__status-badge--done {
  background: #f1f5f9;
  color: #475569;
}
.client-rental-card__body {
  color: #374151;
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 10px;
}
.client-rental-card__meta-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}
.client-rental-card__meta-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 60px;
  flex-shrink: 0;
}
.client-rental-card__meta-value {
  font-size: 13px;
  color: #1e293b;
  font-weight: 500;
}

.client-rental-date-label {
  display: inline-block;
  width: 96px;
}

/* ── Create Rental Form – brand redesign ── */
.rental-create-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  margin-bottom: 4px;
}

.rental-create-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.rental-create-header__title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.rental-create-header__sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.rental-create-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.rental-create-meta {
  padding: 16px;
  border: 1.5px solid rgba(124, 58, 237, 0.15);
  border-radius: 16px;
  background: rgba(124, 58, 237, 0.03);
  line-height: 1.45;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rental-create-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.rental-create-field.date-field {
  width: calc(50% - 6px);
}

.rental-create-field-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Unified input/select/textarea styling inside rental form ── */
.rental-create-form select,
.rental-create-form input[type="text"],
.rental-create-form input[type="number"],
.rental-create-form input[type="datetime-local"],
.rental-create-form textarea {
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  color: #0f172a;
  box-sizing: border-box;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.rental-create-form select:focus,
.rental-create-form input[type="text"]:focus,
.rental-create-form input[type="number"]:focus,
.rental-create-form input[type="datetime-local"]:focus,
.rental-create-form textarea:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.rental-create-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.rental-create-form textarea {
  padding: 10px 14px;
  min-height: 72px;
  resize: vertical;
}

.rental-create-form input:disabled,
.rental-create-form select:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* pricing/hint text inside form */
.rental-create-form > div:not([class]),
.rental-create-form > div[style*="font-size: 12px"] {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  padding: 2px 0;
}

.rental-create-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.rental-create-actions button {
  flex: 1 1 0;
}

/* ── Rental action buttons ── */
.rental-action-btn {
  flex: 1 1 0;
  min-height: 44px;
  border-radius: 14px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border: none !important;
  transition: opacity 0.15s ease !important;
  padding: 10px 14px !important;
}

.rental-action-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: none !important;
  box-shadow: none !important;
}

.rental-action-btn--start {
  background: linear-gradient(135deg, #059669 0%, #0f766e 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28) !important;
}

.rental-action-btn--preview {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.22) !important;
}

.rental-action-btn--cancel {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #475569 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: none !important;
}

.rental-action-btn--cancel:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.09) !important;
}

.rental-action-btn--confirm {
  background: linear-gradient(135deg, #059669 0%, #0f766e 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.22) !important;
}

/* Поиск и вторичные кнопки в форме аренды */
.rental-search-btn,
.rental-secondary-btn {
  min-height: 44px;
  border-radius: 14px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  color: #334155 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 8px 14px !important;
  white-space: nowrap;
  box-shadow: none !important;
  transition: background 0.15s ease !important;
}

.rental-search-btn:hover:not(:disabled),
.rental-secondary-btn:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.10) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Поле суммы: выключенное vs активное */
.rental-amount-input--disabled {
  background: rgba(15, 23, 42, 0.04) !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
}

.rental-amount-input--active {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0f172a !important;
}

/* Bank help block */
.rental-bank-help {
  margin-top: 8px;
  padding: 14px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
}

.rental-bank-help__title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #0f172a;
}

#paymentMethodsStatus {
  min-height: 20px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--brand-gray);
}

#paymentMethodsActions {
  margin-top: 14px;
}

.payment-method-card {
  padding: 14px;
}

.payment-method-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.payment-method-card-title {
  font-weight: 700;
}

.payment-method-card-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--brand-gray);
}

.payment-method-delete {
  background: rgba(217, 48, 37, 0.08);
  color: var(--danger);
  border-color: rgba(217, 48, 37, 0.24);
}

.danger-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(217, 48, 37, 0.22);
  background: rgba(217, 48, 37, 0.08);
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger-icon-button:hover:not(:disabled) {
  background: rgba(217, 48, 37, 0.14);
  border-color: rgba(217, 48, 37, 0.34);
}

.danger-icon-button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.danger-icon-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.employee-audit-entry__main {
  grid-area: main;
  min-width: 0;
}

.employee-audit-entry__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  align-self: end;
  gap: 8px;
}

.employee-audit-entry__action {
  margin-left: 0 !important;
}

.employee-audit-entry__action--delete {
  padding: 4px 8px;
}

.employee-audit-entry__action--delete svg {
  display: none;
}

.employee-audit-entry__action--compact {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  justify-content: center;
}

.employee-audit-entry__action--compact span {
  display: none;
}

.employee-audit-entry__action--compact svg {
  display: block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.restore-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.restore-action-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.restore-action-button:hover:not(:disabled) {
  background: rgba(15, 118, 110, 0.14);
  border-color: rgba(15, 118, 110, 0.34);
}

.restore-action-button:disabled {
  opacity: 0.7;
  cursor: progress;
}

#detailsPopupBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  display: none;
  z-index: 6480;
}

.details-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6500;
  width: min(760px, 92vw);
  max-height: 80vh;
  overflow: auto;
  background: linear-gradient(180deg, rgba(247, 244, 236, 0.98), rgba(229, 225, 215, 0.98));
  border-radius: 24px;
  box-shadow: 0 22px 64px rgba(17, 17, 17, 0.3);
  padding: 14px;
  display: none;
}

.details-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.details-popup .close,
.details-toggle,
.history-toggle {
  padding: 8px 10px;
  border-radius: 12px;
}

.tracker-controls-status {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(247, 244, 236, 0.9);
}

.tracker-control-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tracker-control-button {
  min-width: 132px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.12);
}

.details-popup .content {
  max-height: calc(80vh - 56px);
  overflow: auto;
}

#clientDataModal img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  margin-bottom: 8px;
}

#clientDataModal .photo-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#clientDataModal .photo-card {
  width: 120px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.9);
}

#photoViewerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#photoViewerOverlay img {
  max-width: 95%;
  max-height: 90%;
  border-radius: 12px;
}

#photoViewerOverlay button {
  position: absolute;
  top: 18px;
  right: 18px;
}

#desktopSidebar,
#desktopTopbar,
#desktopMetrics,
#desktopSpotlight {
  display: none;
}

#employeeAuditWrapper[hidden] {
  display: none !important;
}

.employee-audit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.employee-audit-scope-mount {
  display: contents;
}

.employee-audit-filter-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(18, 28, 45, 0.08);
}

.employee-audit-filter-field span {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}

.employee-audit-filter-field input {
  border: none;
  background: transparent;
  font: inherit;
  color: #111827;
  min-width: 134px;
  outline: none;
}

.employee-audit-filter-field select {
  border: none;
  background: transparent;
  font: inherit;
  color: #111827;
  min-width: 170px;
  outline: none;
}

#employeeAuditActions button {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(18, 28, 45, 0.08);
  background: #fff;
  color: #111827;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#employeeAuditActions button.is-active,
.employee-audit-actions--modal button.is-active {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

#employeeAuditActions button.is-active:hover,
.employee-audit-actions--modal button.is-active:hover {
  background: #0f172a;
  border-color: #0f172a;
}

#employeeAuditApplyBtn {
  background: linear-gradient(135deg, #10b981, #0f9d79);
  color: #fff;
  border-color: transparent;
}

#employeeAuditOpenAllBtn {
  background: linear-gradient(135deg, #ffffff, #f2efe8);
}

.employee-audit-meta {
  padding: 14px 0 8px;
  color: #5b6472;
  font-size: 13px;
}

.employee-audit-summary {
  display: grid;
  gap: 12px;
}

.employee-audit-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.employee-audit-summary-column {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.employee-audit-summary-card {
  display: block;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(18, 28, 45, 0.08);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.05);
  align-self: start;
}

.employee-audit-summary-card__name {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.employee-audit-summary-card__pin {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.employee-audit-summary-card__branch {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}

.employee-audit-summary-card__count {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.employee-audit-summary-card__hint {
  margin-top: 8px;
  font-size: 12px;
  color: #5b6472;
}

.employee-audit-summary-card__actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.employee-audit-summary-card__toggle {
  margin-top: 14px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(18, 28, 45, 0.08);
  background: rgba(15, 23, 42, 0.04);
  color: #111827;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.employee-audit-summary-card__history {
  margin-top: 12px;
  display: none;
  gap: 10px;
}

.employee-audit-summary-card--network {
  border-color: rgba(180, 83, 9, 0.22);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.92));
  box-shadow: 0 16px 32px rgba(180, 83, 9, 0.08);
}

.employee-audit-summary-card.is-expanded .employee-audit-summary-card__history {
  display: grid;
}

.employee-audit-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.employee-audit-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.employee-audit-modal-controls {
  display: grid;
  gap: 12px;
}

.employee-audit-actions--modal {
  justify-content: flex-start;
}

.employee-audit-actions--modal-quick,
.employee-audit-actions--modal-period {
  width: 100%;
}

.employee-audit-modal-rollback {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.employee-audit-filter-field--datetime input {
  min-width: 196px;
}

#employeeAuditRollbackToBtn {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 83, 9, 0.18);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.employee-audit-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'main time'
    'main actions';
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(18, 28, 45, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.employee-audit-entry--network {
  border-color: rgba(180, 83, 9, 0.24);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: 0 14px 28px rgba(180, 83, 9, 0.08);
}

.employee-audit-entry--network .employee-audit-entry__title {
  color: #9a3412;
}

.employee-audit-entry--network .employee-audit-entry__branch {
  background: rgba(194, 65, 12, 0.1);
  color: #9a3412;
}

.employee-audit-entry--compact {
  padding: 14px;
  background: rgba(248, 250, 252, 0.96);
}

.employee-audit-entry__title {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.employee-audit-entry__actor {
  margin-top: 5px;
  font-size: 12px;
  color: #6b7280;
}

.employee-audit-entry__branch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.employee-audit-entry__details {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #374151;
}

.employee-audit-entry__time {
  grid-area: time;
  justify-self: end;
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.employee-audit-empty {
  padding: 22px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(18, 28, 45, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #6b7280;
  text-align: center;
}

/* ── Employee Audit Modal — fleet redesign ───────────────────────────────── */
#employeeAuditModal {
  background: #f8fafc !important;
}
#employeeAuditModal .modal-header {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 16px 22px !important;
  align-items: center;
  flex-shrink: 0;
}
#employeeAuditModal .modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.01em;
}
#employeeAuditModal .modal-subtitle {
  color: #6b7280;
  font-size: 13px;
}
#employeeAuditModalClose {
  background: transparent !important;
  border: 1px solid #d1d5db !important;
  color: #6b7280 !important;
  font-weight: 400 !important;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
#employeeAuditModalClose:hover {
  background: #f1f5f9 !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
}
#employeeAuditModalBody {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #f8fafc;
}
#employeeAuditModalControls {
  padding: 12px 20px !important;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
#employeeAuditModalList {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: grid;
  gap: 8px;
  align-content: start;
  margin-top: 0;
}
/* Quick-filter buttons (День / Месяц / Всё время) */
#employeeAuditModal .employee-audit-actions--modal button {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #374151 !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
#employeeAuditModal .employee-audit-actions--modal button:hover {
  background: #e2e8f0 !important;
}
#employeeAuditModal .employee-audit-actions--modal button.is-active {
  background: #111827 !important;
  color: #f9fafb !important;
  border-color: #111827 !important;
}
/* Period-apply button */
#employeeAuditModalApplyBtn {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #374151 !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
#employeeAuditModalApplyBtn:hover {
  background: #e2e8f0 !important;
}
/* Filter fields */
#employeeAuditModal .employee-audit-filter-field {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
}
#employeeAuditModal .employee-audit-filter-field span {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}
/* Rollback strip */
#employeeAuditModal .employee-audit-modal-rollback {
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
}
/* Entries in modal list */
#employeeAuditModalList .employee-audit-entry {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: none;
  padding: 14px 16px;
}
#employeeAuditModalList .employee-audit-entry--network {
  border-color: rgba(180, 83, 9, 0.18);
  background: #fffbf5;
  box-shadow: none;
}
/* ─────────────────────────────────────────────────────────────────────────── */

.desktop-surface {
  border-radius: 28px;
  border: 1px solid rgba(18, 28, 45, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 238, 0.94));
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
}

.desktop-surface__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
}

@media (min-width: 1180px) {
  :root {
    --desktop-sidebar-width: 228px;
    --desktop-gap: 18px;
  }

  html {
    background: #dde3ef;
  }

  body {
    background:
      radial-gradient(circle at top right, rgba(16, 185, 129, 0.10), rgba(16, 185, 129, 0) 32%),
      linear-gradient(180deg, #e8edf8 0%, #dde3ef 100%);
  }

  body::before {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(17, 17, 17, 0.08)),
      radial-gradient(circle at 82% 12%, rgba(16, 185, 129, 0.12), transparent 28%);
  }

  #map {
    inset: 22px 22px 22px calc(var(--desktop-sidebar-width) + 40px);
    border-radius: 34px;
    opacity: 0.22;
    box-shadow: inset 0 0 0 1px rgba(18, 28, 45, 0.08), 0 24px 60px rgba(15, 23, 42, 0.08);
    overflow: hidden;
  }

  #brandPanel,
  #mapControls,
  .device-qr-floating-button {
    display: none !important;
  }

  .app-chrome {
    inset: 0;
    overflow: hidden;
  }

  #dashboardStack {
    position: relative;
    inset: auto;
    height: 100vh;
    overflow: auto;
    padding: 22px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: var(--desktop-sidebar-width) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto auto;
    grid-template-areas:
      "sidebar topbar topbar"
      "sidebar filter filter"
      "sidebar metrics metrics"
      "sidebar fleet analytics"
      "sidebar devices rentals"
      "sidebar clients clients"
      "sidebar team team";
    gap: var(--desktop-gap);
    align-content: start;
    pointer-events: none;
  }

  #dashboardStack > * {
    pointer-events: auto;
  }

  #desktopSidebar,
  #desktopTopbar,
  #desktopMetrics,
  #desktopSpotlight {
    display: block;
  }

  #desktopSidebar {
    grid-area: sidebar;
    position: sticky;
    top: 0;
    align-self: start;
    min-height: calc(100vh - 44px);
    padding: 18px 16px;
    box-sizing: border-box;
    border-radius: 30px;
    border: 1px solid rgba(18, 28, 45, 0.08);
    background: linear-gradient(180deg, rgba(23, 37, 61, 0.96), rgba(31, 41, 55, 0.98));
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  #desktopSidebarBrand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.06);
  }

  #desktopSidebarBrand img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffd400;
    flex: 0 0 auto;
  }

  #desktopSidebarBrand strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 800;
  }

  #desktopSidebarBrand small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.2;
    color: rgba(248, 250, 252, 0.68);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #desktopSidebarNav {
    display: grid;
    gap: 8px;
  }

  .desktop-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  }

  .desktop-sidebar__link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff7ed;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.22);
    flex-shrink: 0;
  }

  .desktop-sidebar__link:hover,
  .desktop-sidebar__link.is-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(255, 212, 0, 0.16));
    border-color: rgba(16, 185, 129, 0.34);
    transform: translateX(2px);
  }

  .desktop-sidebar__mode-btn {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 212, 0, 0.26);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 212, 0, 0.18), rgba(16, 185, 129, 0.2));
    color: #f8fafc;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  #desktopSidebarFoot {
    margin-top: auto;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.12);
  }

  .desktop-sidebar__foot-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(248, 250, 252, 0.68);
  }

  .desktop-sidebar__foot-value {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #f8fafc;
  }

  .desktop-sidebar__user {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.04);
  }

  .desktop-sidebar__user-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    /* Allow full fio display with line wrapping at word boundaries */
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    overflow: visible;
  }

  .desktop-sidebar__user-pin {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(248,250,252,0.7);
  }

  #desktopTopbar {
    grid-area: topbar;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    min-height: 136px;
    padding: 30px 36px;
    margin-top: 54px;
    box-sizing: border-box;
    border-radius: 32px;
    border: 1px solid rgba(18, 28, 45, 0.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 245, 238, 0.88));
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  }

  .desktop-topbar__intro {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 8px;
  }

  .desktop-topbar__intro h1 {
    margin: 6px 0 8px;
    font-size: 30px;
    line-height: 1.05;
  }

  .desktop-topbar__intro p {
    margin: 0;
    max-width: 520px;
    color: #5b6472;
    line-height: 1.5;
  }

  .desktop-topbar__eyebrow {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #0f9d79;
  }

  .desktop-topbar__actions {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
      "switch new-client"
      ". focus-map";
    gap: 10px 12px;
    justify-content: flex-end;
    align-items: start;
    flex: 0 0 auto;
    max-width: 100%;
  }

  #desktopViewSwitch {
    grid-area: switch;
    align-self: center;
  }

  #desktopTopbarNewClient {
    grid-area: new-client;
  }

  #desktopTopbarFocusMap {
    grid-area: focus-map;
  }

  .desktop-metrics-filter__scope {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 2px;
  }

  .desktop-metrics-filter__scope-label {
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
  }

  .desktop-metrics-filter__scope select {
    min-height: 36px;
    min-width: 220px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    font: inherit;
    font-weight: 700;
    padding: 0 12px;
  }

  .desktop-view-switch {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.06);
    border: 1px solid rgba(18, 28, 45, 0.08);
  }

  .desktop-view-switch__btn {
    padding: 10px 14px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
  }

  .desktop-view-switch__btn.is-active {
    background: linear-gradient(135deg, #10b981, #0f9d79);
    color: #fff;
    box-shadow: 0 10px 22px rgba(16, 185, 129, 0.22);
  }

  .desktop-topbar__actions button,
  .desktop-hero-card__actions button,
  #desktopMapSummaryFocus {
    padding: 12px 16px;
    border: none;
    border-radius: 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  }

  #desktopTopbarNewClient {
    background: linear-gradient(135deg, #10b981, #0f9d79);
    color: #fff;
  }

  #desktopTopbarFocusMap,
  #desktopMapSummaryFocus {
    background: linear-gradient(135deg, #ffffff, #f2efe8);
    color: #1f2937;
    border: 1px solid rgba(18, 28, 45, 0.08);
  }

  #desktopMetrics {
    grid-area: metrics;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

/* Ensure on wide screens the four metric cards stay in a single row */
@media (min-width: 1000px) {
  #desktopMetrics {
    grid-template-columns: repeat(4, 1fr) !important;
    align-items: start;
  }
  .desktop-metric-card {
    min-width: 0;
  }
}

.desktop-metrics-filter {
  grid-area: filter;
  margin-bottom: 8px;
}
.desktop-metrics-filter__group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.desktop-metrics-filter__allreceipts {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  align-self: center;
}

#networkDashboardScopeWrap {
  display: inline-flex !important;
  align-items: center !important;
  align-self: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: 0;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(18, 28, 45, 0.06);
  background: #fff;
}

#networkDashboardScopeWrap .desktop-metrics-filter__scope-label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  white-space: nowrap;
}

#networkDashboardScopeSelect {
  min-width: 170px;
  max-width: 220px;
  align-self: center;
}

body.branch-session-active #networkDashboardScopeWrap,
body.branch-session-active #analyticsBranchScopeWrap,
body.branch-session-active #fleetFullscreenBranchScopeWrap,
body.branch-session-active #rentalsFullscreenBranchScopeWrap,
body.branch-session-active #clientsFullscreenBranchScopeWrap,
body.branch-session-active #analyticsFullscreenBranchScopeWrap,
body.branch-session-active #newClientBranchSelectWrap,
body.branch-session-active .employee-audit-filter-field--branch,
body.branch-session-active #employeeAuditScopeMount {
  display: none !important;
}

.network-dashboard-scope--compact {
  margin-left: 0;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(18, 28, 45, 0.08);
  background: rgba(15, 23, 42, 0.04);
}
.desktop-metrics-filter__label {
  font-weight: 700;
  color: #374151;
}
.revenue-filter-button {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(18,28,45,0.06);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.revenue-filter-button.is-active {
  background: linear-gradient(135deg, #10b981, #0f9d79);
  color: #fff;
  box-shadow: 0 8px 18px rgba(16,185,129,0.16);
}

/* Mobile mini filters placed above the metrics panel when opened */
.mobile-metrics-mini-filters {
  /* hidden by default on desktop so it doesn't affect grid layout */
  display: none;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  transition: opacity 160ms ease, transform 160ms ease;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.mobile-metrics-mini-filters .revenue-filter-button {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.mobile-metrics-mini-filters .revenue-filter-button.is-active {
  box-shadow: 0 6px 14px rgba(16,185,129,0.12);
}
/* show mini filters when mobile metrics panel open; keep inside white panel */
body.mobile-metrics-open #desktopMetrics .mobile-metrics-mini-filters {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* style for 'Все приходы' label to look like pill button */
.desktop-metrics-filter__allreceipts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(18,28,45,0.06);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  color: #374151;
}
.desktop-metrics-filter__allreceipts input { /* visually hide native checkbox but keep accessible */
  width: 1px; height: 1px; margin: 0; padding: 0; border: 0; clip: rect(0 0 0 0); position: absolute; overflow: hidden;
}
.desktop-metrics-filter__allreceipts span {
  display: inline-block; vertical-align: middle;
}
.desktop-metrics-filter__allreceipts input:checked + span {
  background: linear-gradient(135deg, #10b981, #0f9d79);
  color: #fff; padding: 6px 10px; border-radius: 8px;
}

  .desktop-metric-card {
    position: relative;
    padding: 20px 22px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(18, 28, 45, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 238, 0.94));
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.07);
  }

  .desktop-metric-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 5px;
    border-radius: 999px;
  }

  .desktop-metric-card--revenue::before { background: #10b981; }
  .desktop-metric-card--active::before { background: #f97316; }
  .desktop-metric-card--clients::before { background: #3b82f6; }
  .desktop-metric-card--devices::before { background: #7c3aed; }

  .desktop-metric-card__label {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
  }

  .desktop-metric-card__value {
    margin-top: 10px;
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    color: #111827;
  }

  .desktop-metric-card__hint {
    margin-top: 10px;
    font-size: 13px;
    color: #5b6472;
  }

  #desktopSpotlight {
    display: contents;
  }

  #desktopMapSummaryCard {
    grid-area: fleet;
    min-height: 360px;
    height: 100%;
  }

  #desktopMapSummaryCard {
    padding: 24px;
    box-sizing: border-box;
  }

  #desktopMapSummaryCard h2 {
    margin: 8px 0 10px;
    font-size: 26px;
    line-height: 1.1;
  }

  .desktop-map-summary__grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .desktop-map-summary__grid div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.03);
    border: 1px solid rgba(18, 28, 45, 0.06);
  }

  .desktop-map-summary__grid span {
    display: block;
    font-size: 12px;
    color: #6b7280;
  }

  .desktop-map-summary__grid strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    line-height: 1;
    color: #111827;
  }

  /* Emphasize available devices (blue, larger) and active rentals (green) */
  #desktopMapOnlineValue {
    font-size: 36px;
    color: #1e40af; /* blue */
    font-weight: 800;
    line-height: 1;
  }

  #desktopMapInRentValue {
    color: var(--success);
    font-weight: 700;
  }

  #desktopMapSummaryFocus {
    margin-top: 16px;
  }

  #statusBar {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    grid-area: topbar;
    justify-self: start;
    align-self: start;
    margin: 0;
    z-index: 5 !important;
  }

  #status {
    padding: 12px 14px !important;
    border-radius: 16px !important;
    font-size: 12px !important;
  }

  #analyticsWrapper,
  #deviceListWrapper,
  #rentalsTopControl,
  #clientListWrapper,
  #employeeAuditWrapper {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0;
    border-radius: 26px !important;
    border: 1px solid rgba(18, 28, 45, 0.08) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 238, 0.94)) !important;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(10px);
  }

  #analyticsWrapper {
    grid-area: analytics;
    min-height: 360px;
    height: 100%;
    align-self: stretch;
  }

  #deviceListWrapper {
    grid-area: devices;
    min-height: 460px;
    height: 100%;
    align-self: stretch;
  }

  #rentalsTopControl {
    grid-area: rentals;
    min-height: 460px;
    height: 100%;
    align-self: stretch;
  }

  #clientListWrapper {
    grid-area: clients;
    min-height: 0;
    height: min(52vh, 520px);
    max-height: min(52vh, 520px) !important;
    align-self: start;
  }

  #employeeAuditWrapper {
    grid-area: team;
    min-height: 420px;
    margin-top: 0;
    align-self: start;
  }

  .employee-audit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  #deviceListContent,
  #analyticsContent,
  #rentalsMapContent,
  #clientListContent,
  #employeeAuditContent {
    display: block !important;
    min-height: 0;
  }

  #deviceListWrapper .panel-toggle,
  #analyticsWrapper .panel-toggle,
  #rentalsTopControl .panel-toggle,
  #clientListWrapper .panel-toggle,
  #employeeAuditWrapper .panel-toggle {
    display: none !important;
  }

  #deviceListHeader,
  #analyticsHeader,
  #rentalsMapHeader,
  #clientListHeader,
  #employeeAuditHeader {
    padding: 20px 22px !important;
    border-bottom: 1px solid rgba(18, 28, 45, 0.06) !important;
    background: transparent !important;
    cursor: default;
  }

  #deviceListContent,
  #analyticsContent,
  #rentalsMapContent,
  #clientListContent,
  #employeeAuditContent {
    padding: 0 18px 18px;
    box-sizing: border-box;
  }

  #clientListContent {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  #deviceList,
  #clientList,
  #rentalsMapContent,
  #analyticsInner {
    max-height: none;
    overflow: visible;
  }

  #deviceList,
  #analyticsInner,
  #rentalsMapContent,
  #clientList,
  #employeeAuditContent {
    padding-top: 8px;
  }

/* Ensure panels use a single scroll container: the panel content element (#deviceListContent / #analyticsContent)
   should provide scrolling for the whole panel. Inner lists must not have their own scrollbars. */
#deviceList, #analyticsInner, #clientList {
  overflow: visible !important;
  max-height: none !important;
}

/* Override any panel-open inner scroll rules so panel content element is the single scroll container */
#analyticsWrapper.panel-open #analyticsInner,
#deviceListWrapper.panel-open #deviceList {
  max-height: none !important;
  overflow: visible !important;
}

  #clientListHeader {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(680px, 1.4fr);
    align-items: center;
    gap: 18px 22px;
  }

  #clientListHeader .panel-heading-group {
    width: auto;
    min-width: 0;
  }

  #clientHeaderActions {
    width: 100%;
    max-width: none;
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 12px;
  }

  #clientPhoneFilterWrap {
    min-width: 0;
    align-items: stretch;
  }

  #clientPhoneFilter,
  #btnNewClient {
    min-height: 48px;
    height: 48px;
    box-sizing: border-box;
  }

  #btnNewClient {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
  }

  #clientPhoneFilter {
    min-width: 340px;
  }

  #clientList.client-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(0, auto);
    align-content: start;
    gap: 14px;
    align-items: start;
  }

  #clientList.client-list-grid > div {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    flex: 1 1 auto !important;
    align-self: start;
  }

  .client-list-card {
    width: 100%;
    min-height: 96px;
    justify-content: space-between;
    align-self: start;
  }

  .client-list-card > :first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  #employeeAuditActions {
    max-width: none;
    margin-left: auto;
  }

  .panel-title {
    font-size: 18px;
  }

  body.desktop-map-mode #map {
    inset: 18px 18px 18px calc(var(--desktop-sidebar-width) + 26px);
    opacity: 1;
    border-radius: 38px;
    box-shadow: inset 0 0 0 1px rgba(18, 28, 45, 0.08), 0 28px 80px rgba(15, 23, 42, 0.18);
  }

  /* Keep map visually behind chrome panels, but interactive where possible */
  body.desktop-map-mode #map {
    z-index: 1 !important;
    pointer-events: auto !important;
  }

  body.desktop-map-mode #map .leaflet-container,
  body.desktop-map-mode #map .leaflet-pane,
  body.desktop-map-mode #map .leaflet-interactive,
  body.desktop-map-mode #map .leaflet-control-container {
    pointer-events: auto !important;
    cursor: grab !important;
  }

  /* Allow clicks to pass through the dashboard stack to the map, but keep controls usable */
  body.desktop-map-mode #dashboardStack {
    pointer-events: none !important;
  }
  /* Re-enable pointer events for interactive controls inside dashboard */
  body.desktop-map-mode #dashboardStack button,
  body.desktop-map-mode #dashboardStack a,
  body.desktop-map-mode #dashboardStack input,
  body.desktop-map-mode #dashboardStack select,
  body.desktop-map-mode #dashboardStack textarea,
  body.desktop-map-mode #desktopTopbar,
  body.desktop-map-mode #desktopTopbar *,
  body.desktop-map-mode #mapControls,
  body.desktop-map-mode #mapControls * {
    pointer-events: auto !important;
  }

  body.desktop-dashboard-active:not(.desktop-map-mode) #map,
  body.desktop-dashboard-active:not(.desktop-map-mode) #map .leaflet-container,
  body.desktop-dashboard-active:not(.desktop-map-mode) #map .leaflet-pane,
  body.desktop-dashboard-active:not(.desktop-map-mode) #map .leaflet-control-container,
  body.desktop-dashboard-active:not(.desktop-map-mode) #map .leaflet-interactive {
    pointer-events: none !important;
    cursor: default !important;
  }

  body.desktop-dashboard-active:not(.desktop-map-mode) #dashboardStack {
    pointer-events: auto;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }

  body.desktop-map-mode #dashboardStack {
    grid-template-columns: var(--desktop-sidebar-width) 1fr;
    grid-template-rows: auto;
    grid-template-areas: "sidebar topbar";
    align-content: start;
  }

  body.desktop-map-mode #desktopMetrics,
  body.desktop-map-mode #desktopSpotlight,
  body.desktop-map-mode #analyticsWrapper,
  body.desktop-map-mode #deviceListWrapper,
  body.desktop-map-mode #rentalsTopControl,
  body.desktop-map-mode #clientListWrapper,
  body.desktop-map-mode #employeeAuditWrapper {
    display: none !important;
  }

  body.desktop-map-mode #desktopTopbar {
    align-self: start;
    justify-self: end;
    width: min(720px, calc((100vw - var(--desktop-sidebar-width) - 96px) * 0.54));
    max-width: calc(100vw - var(--desktop-sidebar-width) - 92px);
    min-height: 0;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    /* place topbar at right edge of the viewport in map mode */
    position: fixed;
    top: 22px;
    right: 18px;
    left: auto;
    transform: none;
    z-index: 1650;
  }

  body.desktop-map-mode #statusBar {
    display: block !important;
    grid-area: topbar;
    justify-self: end;
    align-self: start;
    margin: 0;
    width: min(720px, calc((100vw - var(--desktop-sidebar-width) - 96px) * 0.54)) !important;
    max-width: calc(100vw - var(--desktop-sidebar-width) - 92px) !important;
    display: flex !important;
    justify-content: flex-start;
    z-index: 1665 !important;
    /* place status bar above the desktop topbar and align right edges */
    position: fixed !important;
    top: 22px !important;
    right: 18px !important;
    left: auto !important;
  }

  body.desktop-map-mode #status {
    background: linear-gradient(135deg, rgba(17, 17, 17, 0.96), rgba(43, 43, 43, 0.96)) !important;
    color: var(--brand-yellow) !important;
    backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255, 212, 0, 0.12);
  }

  body.desktop-map-mode #mapControls {
    display: flex !important;
    right: 24px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    gap: 10px;
    padding: 10px;
    border-radius: 20px;
    background: rgba(17, 17, 17, 0.78);
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(16px);
  }

  body.desktop-map-mode #mapControls .map-control-btn {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 14px;
    font-size: 19px;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(23, 37, 61, 0.96), rgba(15, 23, 42, 0.98));
    color: #f0f9ff;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
  }

  body.desktop-map-mode #mapControls .map-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(17, 17, 17, 0.2);
  }

  body.desktop-map-mode .desktop-topbar__actions {
    width: fit-content;
    justify-self: end;
    grid-template-columns: auto;
    grid-template-areas:
      "switch"
      "new-client"
      "focus-map";
    justify-content: end;
  }

  body.desktop-map-mode #desktopViewSwitch,
  body.desktop-map-mode #desktopTopbarNewClient,
  body.desktop-map-mode #desktopTopbarFocusMap {
    width: auto;
    min-width: 230px;
    justify-self: end;
  }

  body.desktop-map-mode .desktop-view-switch {
    justify-content: center;
  }

  body.desktop-map-mode .desktop-view-switch__btn {
    flex: 1 1 50%;
  }

  body.desktop-map-mode .desktop-topbar__intro h1 {
    font-size: 24px;
  }

  body.desktop-map-mode .desktop-topbar__intro p {
    max-width: 360px;
  }

  body.desktop-map-mode #desktopSidebar {
    min-height: calc(100vh - 36px);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.76));
    backdrop-filter: blur(18px);
  }
  /* Ensure dashboard stack (sidebar) is interactive when in map mode */
  body.desktop-map-mode #dashboardStack {
    pointer-events: auto;
  }
}

/* Hide revenue filter when in desktop map mode (redundant on map) */
body.desktop-map-mode #desktopMetricsFilter {
  display: none !important;
}

/* Компактная раскладка (плавающие панели над картой) распространена на планшеты:
   диапазон 0–1179px = не-десктоп (десктоп-грид включается JS-ом с 1180px). */
@media (max-width: 1179px) {
  :root {
    --chrome-width: calc(100vw - 24px);
    --status-width: calc(100vw - 24px);
    --client-collapsed-height: 136px;
    --client-bottom-offset: 10px;
    --rentals-top-limit: 92px;
    --rentals-client-offset: calc(50dvh + 18px);
  }

  .app-chrome {
    padding: 0;
  }

  #brandPanel {
    top: 14px;
    width: fit-content;
    max-width: calc(100vw - 64px);
    padding: 8px 12px;
    border-radius: 24px;
  }

  #brandBadge {
    gap: 10px;
  }

  #brandBadge img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  #brandBadge strong {
    font-size: 21px;
  }

  #brandBadge small {
    font-size: 10.5px;
  }

  #dashboardStack {
    max-height: none;
  }

  #status,
  #rentalsTopControl,
  #deviceListWrapper,
  #analyticsWrapper,
  #clientListWrapper,
  #employeeAuditWrapper {
    border-radius: 22px !important;
  }

  #employeeAuditWrapper {
    margin-top: 92px;
  }

  #employeeAuditHeader {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .employee-audit-actions {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  .employee-audit-filter-field {
    width: auto;
    box-sizing: border-box;
    min-width: 0;
    padding: 6px 8px;
  }

  .employee-audit-filter-field input {
    min-width: 0;
    width: 118px;
  }

  #employeeAuditActions button {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 12px;
  }

  .employee-audit-entry {
    grid-template-columns: 1fr;
    grid-template-areas:
      'main'
      'time'
      'actions';
  }

  .employee-audit-entry__time {
    white-space: normal;
    justify-self: start;
  }

  .employee-audit-entry__actions {
    justify-content: flex-end;
    width: 100%;
  }

  #mapControls button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 14px;
  }

  .device-qr-floating-button {
    right: 12px;
    bottom: calc(var(--rentals-dynamic-bottom, calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap))) + 76px);
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
    border-radius: 16px;
  }

  .device-qr-floating-button svg {
    width: 26px;
    height: 26px;
  }

  .device-qr-scanner-preview,
  .device-qr-scanner-preview video {
    min-height: 220px;
  }

  .device-qr-scanner-form-row {
    grid-template-columns: 1fr;
  }

  #statusBar {
    top: 94px !important;
  }
  
  /* Компактная раскладка панелей/метрик/навигации — на телефонах И планшетах (<=1179px). */
  @media (max-width: 1179px) {
    :root {
      --stack-gap: 14px;
    }

    .device-qr-floating-button {
      display: none !important;
    }

    /* Скрыть блок "Действия сотрудников" на мобильных экранах */
    #employeeAuditWrapper {
      display: none !important;
    }
    
    /* Скрыть блок фильтра выручки (день/месяц) на мобильных экранах */
    #desktopMetricsFilter {
      display: none !important;
    }

    /* Укоротить фильтр в заголовке, когда панель Флот свернута */
    #deviceListWrapper:not(.panel-open) #deviceFleetFilterSelect {
      width: 80px !important;
      min-width: 0 !important;
      box-sizing: border-box;
    }

    #deviceListWrapper .device-list-search-row {
      padding: 2px 14px 10px;
      position: sticky;
      top: 0;
      z-index: 3;
    }

    #deviceListWrapper .device-fleet-search-input {
      width: 100% !important;
      min-width: 0 !important;
    }

    /* Мобильная выдвижная панель с метриками (2x2) — расширенная до правого края */
    #desktopMetrics {
      position: fixed !important;
      left: 8px;
      right: 8px;
      top: 110px;
      width: calc(100vw - 16px);
      max-width: 100%;
      height: auto;
      transform: translateX(calc(-100% - 18px));
      transition: transform 260ms ease;
      z-index: 1700;
      padding: 18px 14px 20px 14px;
      box-sizing: border-box;
      background: rgba(255,255,255,0.92);
      border-radius: 14px;
      box-shadow: 0 18px 44px rgba(15,23,42,0.12);
      backdrop-filter: blur(6px);
    }

    /* Когда панель открыта */
    body.mobile-metrics-open #desktopMetrics {
      transform: translateX(0);
    }

    /* Ручка слева для открытия панели */
    .mobile-metrics-handle {
      position: fixed;
      left: -28px; /* заходящий за левый край экрана */
      bottom: auto; /* будет устанавливаться скриптом */
      width: 84px; /* увеличенная ширина, заходящая влево */
      height: 56px;
      z-index: 1720;
      border: none;
      background: rgba(255,255,255,0.92); /* совпадает с подложкой */
      border-radius: 0 12px 12px 0;
      box-shadow: 0 8px 20px rgba(15,23,42,0.12);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: flex-end; /* иконка прижата к правому краю ручки */
      padding-right: 14px;
      color: #111;
      border-left: 1px solid rgba(0,0,0,0.04);
      overflow: visible;
      transition: transform 260ms ease, bottom 200ms ease;
    }

    /* Скрывать ручку если панель открыта */
    body.mobile-metrics-open .mobile-metrics-handle {
      display: none;
    }

    .mobile-nav-handle {
      position: fixed;
      left: -28px;
      top: 17px;
      width: 84px;
      height: 56px;
      z-index: 1735;
      border: none;
      background: rgba(255,255,255,0.92);
      border-radius: 0 12px 12px 0;
      box-shadow: 0 8px 20px rgba(15,23,42,0.12);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding-right: 14px;
      color: #111;
      border-left: 1px solid rgba(0,0,0,0.04);
      transition: transform 260ms ease, opacity 200ms ease;
    }

    body.mobile-nav-open .mobile-nav-handle {
      opacity: 0;
      pointer-events: none;
    }

    .mobile-nav-overlay {
      position: fixed;
      inset: 0;
      z-index: 1730;
      background: rgba(15, 23, 42, 0.26);
      opacity: 0;
      pointer-events: none;
      transition: opacity 220ms ease;
    }

    body.mobile-nav-open .mobile-nav-overlay {
      opacity: 1;
      pointer-events: auto;
    }

    .mobile-nav-drawer {
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      width: min(320px, calc(100vw - 44px));
      z-index: 1732;
      display: flex;
      flex-direction: column;
      gap: 16px;
      padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
      background: linear-gradient(180deg, rgba(18, 24, 38, 0.98), rgba(15, 23, 42, 0.96));
      box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
      transform: translateX(calc(-100% - 16px));
      transition: transform 260ms ease;
      overflow-y: auto;
    }

    body.mobile-nav-open .mobile-nav-drawer {
      transform: translateX(0);
    }

    .mobile-nav-drawer__brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
      padding: 4px 2px 10px;
    }

    .mobile-nav-drawer__brand span {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .mobile-nav-drawer__brand strong {
      color: #f8fafc;
      font-size: 18px;
      font-weight: 800;
      line-height: 1.1;
    }

    .mobile-nav-drawer__brand small {
      margin-top: 3px;
      color: rgba(248, 250, 252, 0.66);
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .mobile-nav-drawer__nav {
      display: grid;
      gap: 10px;
      flex: 1 1 auto;
      align-content: stretch;
      grid-auto-rows: minmax(0, 1fr);
    }

    .mobile-nav-drawer__foot {
      margin-top: auto;
      padding: 14px;
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(148, 163, 184, 0.12);
    }

    .mobile-nav-drawer__foot .desktop-sidebar__foot-label,
    .mobile-nav-drawer__foot .desktop-sidebar__user-name,
    .mobile-nav-drawer__foot .desktop-sidebar__user-pin {
      color: rgba(248, 250, 252, 0.88);
    }

    .mobile-nav-session-actions {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 14px;
    }

    .mobile-nav-drawer .desktop-sidebar__link {
      background: rgba(255, 255, 255, 0.04);
      color: #e5e7eb;
      min-height: 52px;
      justify-content: flex-start;
      padding: 14px 16px;
      border-radius: 20px;
      font-size: 15px;
    }

    .mobile-nav-drawer__nav > .desktop-sidebar__link {
      min-height: 0;
    }

    .mobile-nav-drawer .desktop-sidebar__link:hover,
    .mobile-nav-drawer .desktop-sidebar__link.is-active {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(255, 212, 0, 0.16));
      border-color: rgba(16, 185, 129, 0.34);
      transform: translateX(2px);
    }

    /* Сетка 2x2 для метрик */
    #desktopMetrics {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      align-items: start;
    }

      /* Ensure mobile mini filters occupy full row above the metric cards and stay within white panel */
      #desktopMetrics .mobile-metrics-mini-filters {
        grid-column: 1 / -1;
        display: flex;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(18,28,45,0.04);
        margin-bottom: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      /* Make mobile revenue buttons match desktop style */
      #desktopMetrics .mobile-metrics-mini-filters .revenue-filter-button {
        flex: 0 0 auto;
        padding: 8px 12px;
        border-radius: 12px;
        border: 1px solid rgba(18,28,45,0.06);
        background: #fff;
        font-weight: 700;
        cursor: pointer;
      }
      #desktopMetrics .mobile-metrics-mini-filters .revenue-filter-button:hover {
        filter: brightness(0.98);
      }
      #desktopMetrics .mobile-metrics-mini-filters .revenue-filter-button.is-active {
        background: linear-gradient(135deg, #10b981, #0f9d79);
        color: #fff;
        box-shadow: 0 8px 18px rgba(16,185,129,0.16);
      }
      #desktopMetrics .mobile-metrics-mini-filters .desktop-metrics-filter__allreceipts {
        flex: 0 0 auto;
        margin-left: 6px;
        padding: 0; /* padding applied to inner span */
        border-radius: 12px;
        border: 1px solid rgba(18,28,45,0.06);
        background: #fff;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
      }
      #desktopMetrics .mobile-metrics-mini-filters .desktop-metrics-filter__allreceipts span {
        display: inline-block;
        padding: 8px 12px;
        border-radius: 10px;
        color: #374151;
        font-weight: 700;
      }
      #desktopMetrics .mobile-metrics-mini-filters .desktop-metrics-filter__allreceipts input { /* visually hidden but present */
        position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0);
      }
      #desktopMetrics .mobile-metrics-mini-filters .desktop-metrics-filter__allreceipts input:checked + span {
        background: linear-gradient(135deg, #10b981, #0f9d79);
        color: #fff;
        box-shadow: 0 8px 18px rgba(16,185,129,0.16);
      }

/* mobile 'Показать весь флот' positioned under collapsed Analytics (right) */
.mobile-show-fleet-container { display: none; }
#analyticsWrapper { position: relative; }
/* mobile fleet button removed */

/* top app banner colors and layout */
#appTopBanner {
  background: #fef3c7;
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
}
#appTopBanner.is-error {
  background: #fff1f2; /* softer red */
  color: #7f1d1d;
}
#appTopBanner.is-success {
  background: #ecfdf5;
  color: #065f46;
}

/* close button inside banner */
.app-top-banner__close {
  margin-left: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: #111827; /* neutral dark */
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(17,17,17,0.12);
}
.app-top-banner__close:focus { outline: 2px solid rgba(17,24,39,0.12); }
.app-top-banner__close:hover { filter: brightness(1.06); }

    /* Использовать те же стили карточек, что и на десктопе */
    .desktop-metric-card {
      padding: 16px;
      border-radius: 12px;
      background: var(--surface, #fff);
      box-shadow: 0 6px 18px rgba(17,17,17,0.12);
      min-height: 72px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .desktop-metric-card__label {
      font-size: 12px;
      color: var(--muted, #6b7280);
      margin-bottom: 6px;
    }

    .desktop-metric-card__value {
      font-size: 20px;
      font-weight: 700;
      color: var(--brand-black, #111);
    }

    /* Правый цветной уголок у карточек метрик на мобильном */
    .desktop-metric-card {
      position: relative;
      overflow: visible;
    }

    .desktop-metric-card::after {
      content: "";
      position: absolute;
      top: 0;
      right: 0;
      width: 36px;
      height: 36px;
      border-bottom-left-radius: 10px;
      z-index: 2;
    }

    .desktop-metric-card--revenue::after { background: #10b981; }
    .desktop-metric-card--active::after { background: #ef4444; }
    .desktop-metric-card--clients::after { background: #3b82f6; }
    .desktop-metric-card--devices::after { background: #7c3aed; }
    /* Уменьшенные подсказки для мобильного вида */
    .desktop-metric-card__hint {
      font-size: 11px !important;
      margin-top: 6px !important;
      color: #5b6472 !important;
    }
  }

  .auth-session-badge {
    top: 14px;
    right: 12px;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 10px;
    min-width: 204px;
    padding: 8px;
    border-radius: 18px;
  }

  #startRentalBadge {
    --auth-badge-peek-width: 56px;
  }

  .auth-session-badge__handle {
    width: 38px;
    min-width: 38px;
    min-height: 76px;
    border-radius: 14px;
  }

  .auth-session-badge__content {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .auth-gate {
    padding: 16px;
  }

  .auth-gate__dialog {
    padding: 20px;
    border-radius: 24px;
  }

  .auth-gate__title {
    font-size: 21px;
  }

  .auth-gate__form input {
    font-size: 24px;
  }

  #deviceListWrapper {
    top: 150px !important;
    max-height: 64px !important;
  }

  #analyticsWrapper {
    top: 150px !important;
    max-height: 64px !important;
  }

  #rentalsTopControl {
    bottom: var(--rentals-dynamic-bottom, calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap))) !important;
    max-height: 64px !important;
  }

  #rentalsTopControl.lifted-by-client {
    bottom: var(--rentals-client-offset) !important;
  }

  #clientListWrapper {
    bottom: var(--client-bottom-offset) !important;
    max-height: var(--client-collapsed-height) !important;
  }

  #deviceListWrapper.panel-open,
  #analyticsWrapper.panel-open {
    max-height: 50dvh !important;
  }

  #rentalsTopControl.panel-open {
    max-height: min(50dvh, calc(100dvh - var(--rentals-top-limit) - var(--rentals-dynamic-bottom, calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap))))) !important;
  }

  #clientListWrapper.panel-open {
    max-height: 50dvh !important;
  }

  #deviceListHeader,
  #analyticsHeader,
  #clientListHeader,
  #rentalsMapHeader {
    padding: 14px !important;
  }

  #analyticsWrapper:not(.panel-open) #analyticsHeader .panel-heading-actions,
  #analyticsWrapper:not(.panel-open) #analyticsBranchScopeWrap {
    display: none !important;
  }

  #deviceListHeader,
  #analyticsHeader {
    gap: 10px;
  }

  #clientListHeader {
    align-items: flex-start;
  }

  #clientHeaderActions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #clientPhoneFilter {
    width: 100%;
  }

  #deviceListWrapper,
  #analyticsWrapper {
    width: fit-content !important;
    max-width: calc(var(--chrome-width) - 96px) !important;
  }

  .app-modal,
  .app-modal--wide {
    width: calc(100vw - 8px) !important;
    max-width: calc(100vw - 8px) !important;
    height: calc(100dvh - 8px) !important;
    max-height: calc(100dvh - 8px) !important;
    border-radius: 20px !important;
  }

  .app-modal--mini {
    width: min(460px, calc(100vw - 32px)) !important;
    max-width: min(460px, calc(100vw - 32px)) !important;
    height: auto;
    max-height: min(72dvh, 520px) !important;
  }

  .app-modal--fullscreen {
    width: calc(100vw - 8px) !important;
    max-width: calc(100vw - 8px) !important;
    height: calc(100dvh - 8px) !important;
    max-height: calc(100dvh - 8px) !important;
    min-width: 0;
  }

  .app-modal--fullscreen .modal-body.dashboard-screen {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
  }

  .app-modal--fullscreen .dashboard-screen__toolbar,
  .app-modal--fullscreen .dashboard-screen__toolbar--analytics,
  .app-modal--fullscreen .dashboard-screen__toolbar--fleet,
  .app-modal--fullscreen .dashboard-screen__toolbar--rentals {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
  }

  .app-modal--fullscreen .dashboard-screen__controls,
  .app-modal--fullscreen .dashboard-screen__controls--analytics,
  .app-modal--fullscreen .dashboard-screen__controls--fleet,
  .app-modal--fullscreen .dashboard-screen__aside,
  .app-modal--fullscreen .dashboard-screen__aside--fleet,
  .app-modal--fullscreen .dashboard-screen__aside--rentals {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    align-items: stretch;
    justify-content: flex-start;
  }

  .app-modal--fullscreen .dashboard-screen__aside--fleet,
  .app-modal--fullscreen .dashboard-screen__aside--rentals {
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
  }

  .app-modal--fullscreen .dashboard-screen__controls--fleet {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .app-modal--fullscreen .dashboard-screen__search,
  .app-modal--fullscreen .dashboard-screen__select,
  .app-modal--fullscreen .dashboard-screen__date-field input {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
  }

  .app-modal--fullscreen .dashboard-period-switch,
  .app-modal--fullscreen .employee-audit-actions,
  .app-modal--fullscreen .employee-audit-actions--modal,
  .app-modal--fullscreen .employee-audit-modal-rollback {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .app-modal--fullscreen .dashboard-screen__meta,
  .app-modal--fullscreen .fleet-fullscreen-meta,
  .app-modal--fullscreen .rentals-fullscreen-meta,
  .app-modal--fullscreen .rentals-fullscreen-meta__meta {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    align-items: center;
  }

  .app-modal--fullscreen #clientsFullscreenMeta {
    width: fit-content;
    max-width: fit-content;
    padding: 6px 10px;
    min-height: 0;
    align-self: flex-start;
  }

  .app-modal--fullscreen .fleet-fullscreen-meta,
  .app-modal--fullscreen .rentals-fullscreen-meta__top,
  .app-modal--fullscreen .rentals-fullscreen-meta__bottom,
  .app-modal--fullscreen .rentals-fullscreen-meta__tiles-top,
  .app-modal--fullscreen .rentals-fullscreen-meta__meta {
    gap: 6px;
    flex-wrap: wrap;
  }

  .app-modal--fullscreen .fleet-fullscreen-meta {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    display: inline-flex;
    flex-wrap: wrap;
    padding: 6px;
    border-radius: 14px;
  }

  .app-modal--fullscreen .fleet-fullscreen-meta__tiles {
    grid-template-columns: repeat(3, minmax(82px, 1fr));
    max-width: 420px;
  }

  .app-modal--fullscreen .rentals-fullscreen-meta {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: flex-start;
  }

  .app-modal--fullscreen .rentals-fullscreen-meta__top,
  .app-modal--fullscreen .rentals-fullscreen-meta__bottom,
  .app-modal--fullscreen .rentals-fullscreen-meta__tiles-top,
  .app-modal--fullscreen .rentals-fullscreen-meta__meta {
    width: fit-content;
    max-width: 100%;
    justify-content: flex-start;
    margin-right: 0;
  }

  .app-modal--fullscreen .employee-audit-actions--modal-period {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .app-modal--fullscreen .employee-audit-actions--modal-period .employee-audit-filter-field {
    width: auto;
  }

  .app-modal--fullscreen .employee-audit-actions--modal-period .employee-audit-filter-field--branch,
  .app-modal--fullscreen .employee-audit-actions--modal-period #employeeAuditModalApplyBtn {
    grid-column: 1 / -1;
  }

  .app-modal--fullscreen .employee-audit-actions--modal-period .employee-audit-filter-field span {
    flex: 0 0 auto;
  }

  .app-modal--fullscreen .employee-audit-actions--modal-period .employee-audit-filter-field input,
  .app-modal--fullscreen .employee-audit-actions--modal-period .employee-audit-filter-field select {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-modal--fullscreen .fleet-fullscreen-meta__item,
  .app-modal--fullscreen .rentals-fullscreen-meta__item {
    min-width: 0;
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .app-modal--fullscreen .fleet-fullscreen-meta__item strong,
  .app-modal--fullscreen .rentals-fullscreen-meta__item strong {
    font-size: 15px;
  }

  .app-modal--fullscreen .fleet-fullscreen-reset-btn,
  .app-modal--fullscreen .rentals-fullscreen-reset-btn {
    margin-right: 0;
    margin-bottom: 0;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
  }

  .app-modal--fullscreen .dashboard-list-grid,
  .app-modal--fullscreen .fleet-fullscreen-board,
  .app-modal--fullscreen .fleet-fullscreen-section__grid,
  .app-modal--fullscreen .rentals-fullscreen-board,
  .app-modal--fullscreen #clientsFullscreenContent,
  .app-modal--fullscreen #analyticsFullscreenContent {
    grid-template-columns: 1fr !important;
    min-width: 0;
  }

  .app-modal--fullscreen #analyticsFullscreenContent,
  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-grid,
  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-card,
  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-bars,
  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-bars__row,
  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-bars__track {
    min-width: 0;
    max-width: 100%;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-grid {
    gap: 10px;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-card {
    padding: 14px;
    border-radius: 18px;
    gap: 10px;
    overflow: hidden;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-card__title {
    font-size: 15px;
    line-height: 1.25;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-card__subtitle {
    font-size: 11px;
    line-height: 1.35;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-card__scroller {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding-bottom: 6px;
    margin-bottom: -6px;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-card__scroller .dashboard-chart-card__svg {
    display: block;
    height: auto;
    min-width: 100%;
    max-width: none;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-legend {
    gap: 8px;
    font-size: 11px;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-legend span {
    min-width: 0;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-chart-tooltip {
    max-width: min(180px, calc(100vw - 48px));
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-bars {
    gap: 10px;
  }

  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-bars__label,
  .app-modal--fullscreen #analyticsFullscreenContent .dashboard-bars__value {
    font-size: 12px;
    line-height: 1.3;
    word-break: break-word;
  }

  .app-modal--fullscreen .leads-modal__body,
  .app-modal--fullscreen .leads-workspace {
    grid-template-columns: 1fr !important;
  }

  .app-modal--fullscreen .leads-board {
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(300px, 340px) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .app-modal--fullscreen .leads-board__column {
    height: 100% !important;
    max-height: 100% !important;
  }

  .app-modal--fullscreen .leads-modal__body,
  .app-modal--fullscreen .leads-board,
  .app-modal--fullscreen .dashboard-list-grid,
  .app-modal--fullscreen #employeeAuditModalList {
    overflow: auto;
    min-height: 0;
  }

  .app-modal--fullscreen .fleet-fullscreen-board,
  .app-modal--fullscreen .rentals-fullscreen-board,
  .app-modal--fullscreen .dashboard-list-grid {
    gap: 10px;
  }

  .app-modal--fullscreen .fleet-fullscreen-section,
  .app-modal--fullscreen .rentals-fullscreen-section,
  .app-modal--fullscreen .dashboard-screen__stack {
    gap: 8px;
  }

  .app-modal--fullscreen .dashboard-list-card,
  .app-modal--fullscreen .fleet-fullscreen-card,
  .app-modal--fullscreen .rentals-fullscreen-card {
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
  }

  .app-modal--fullscreen .dashboard-list-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .app-modal--fullscreen .dashboard-list-card__actions button {
    flex: 1 1 140px;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .app-modal--fullscreen .employee-audit-filter-field {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    gap: 6px;
    border-radius: 12px;
  }

  .employee-audit-filter-field {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    gap: 6px;
    border-radius: 12px;
  }

  .app-modal--fullscreen .employee-audit-filter-field input,
  .app-modal--fullscreen .employee-audit-filter-field select,
  .app-modal--fullscreen .employee-audit-filter-field--datetime input {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }

  .employee-audit-filter-field input,
  .employee-audit-filter-field select,
  .employee-audit-filter-field--datetime input {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }

  .app-modal--fullscreen #employeeAuditActions button,
  .app-modal--fullscreen .employee-audit-actions--modal button,
  .app-modal--fullscreen #employeeAuditRollbackToBtn,
  .app-modal--fullscreen .employee-audit-entry__action {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.2;
  }

  #employeeAuditActions button,
  .employee-audit-actions--modal button,
  #employeeAuditRollbackToBtn,
  .employee-audit-entry__action {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.2;
  }

  .app-modal--fullscreen .employee-audit-entry {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'time'
      'main'
      'actions';
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
  }

  .app-modal--fullscreen .employee-audit-entry__time {
    justify-self: start;
    white-space: normal;
    font-size: 11px;
  }

  .app-modal--fullscreen .employee-audit-entry__actions,
  .app-modal--fullscreen .employee-audit-summary-card__actions,
  .app-modal--fullscreen .employee-audit-actions,
  .app-modal--fullscreen .employee-audit-actions--modal,
  .app-modal--fullscreen .employee-audit-modal-rollback {
    gap: 6px;
  }

  .app-modal--fullscreen .employee-audit-actions--modal-quick {
    order: 1;
  }

  .app-modal--fullscreen .employee-audit-actions--modal-quick button {
    flex: 1 1 calc(33.333% - 6px);
  }

  .app-modal--fullscreen .employee-audit-actions--modal-period {
    order: 2;
    align-items: stretch;
  }

  .app-modal--fullscreen .employee-audit-chip {
    padding: 5px 8px;
    font-size: 11px;
  }

  .app-modal--fullscreen .employee-audit-summary-card {
    padding: 12px;
    border-radius: 16px;
  }

  .app-modal--fullscreen .employee-audit-summary-card__count {
    margin-top: 8px;
    font-size: 24px;
  }

  .network-admin-auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .network-admin-auth-card__form {
    align-self: stretch;
    justify-self: end;
    min-width: 240px;
  }

  .network-admin-panel--create,
  .network-admin-panel--list {
    height: 356px;
  }

  .modal-header,
  #infoModalHeader,
  #paymentMethodsModalHeader,
  .modal-body,
  #infoModalContent,
  #rentalsList,
  #paymentMethodsContent,
  #clientDataContent {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  }

  #clientDataContent {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .dashboard-screen__search,
  .dashboard-screen__select,
  .dashboard-screen__date-field input {
    width: 100%;
    min-width: 0;
  }

  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

  .fleet-fullscreen-board {
    grid-template-columns: 1fr;
  }

  .rentals-fullscreen-board,
  .network-staff-edit-grid {
    grid-template-columns: 1fr;
  }

  .network-admin-form--starline,
  .network-admin-form__actions--starline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-screen__aside {
    width: 100%;
    align-items: stretch;
    margin-left: 0;
  }

  .dashboard-screen__controls--fleet {
    grid-template-columns: 1fr;
  }

  .dashboard-screen__aside--fleet #fleetFullscreenBranchScopeWrap {
    justify-content: flex-start;
  }

  .network-admin-field--pin,
  .network-admin-field--role {
    width: 100%;
  }

  .network-admin-field--pin input,
  .network-admin-field--role select {
    max-width: none;
    min-width: 0;
  }

  .fleet-fullscreen-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  .fleet-fullscreen-meta__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    width: 100%;
  }

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

  .fleet-fullscreen-section {
    grid-column: span 1;
  }

  .fleet-fullscreen-section__grid {
    grid-template-columns: 1fr;
  }

  .dashboard-bars__row {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid--compact {
    grid-template-columns: 1fr;
  }

  .rental-create-field.date-field {
    width: 100%;
  }

  .rental-create-actions,
  .modal-actions {
    flex-direction: column;
  }

  .rental-create-actions button,
  .modal-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  :root {
    --client-collapsed-height: 144px;
  }

  #brandBadge {
    align-items: center;
  }

  #clientHeaderActions {
    grid-template-columns: 1fr;
  }

  #btnNewClient {
    width: 100%;
  }

  #brandBadge strong {
    font-size: 20px;
  }

  #brandPanel {
    width: fit-content;
    max-width: calc(100vw - 72px);
    top: 12px;
    padding: 8px 10px;
  }

  #brandBadge small {
    font-size: 10px;
  }

  #statusBar {
    top: 88px !important;
  }

  .auth-session-badge {
    top: 12px;
    min-width: 188px;
    max-width: min(236px, calc(100vw - 24px));
  }

  .auth-session-badge__handle {
    min-height: 70px;
  }

  #deviceListWrapper {
    top: 144px !important;
  }

  #analyticsWrapper {
    top: 144px !important;
  }

  #rentalsTopControl {
    bottom: var(--rentals-dynamic-bottom, calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap))) !important;
  }
}


@media (max-width: 1100px) and (orientation: landscape) {
  :root {
    --chrome-width: calc(100vw - 16px);
    --client-collapsed-height: 82px;
    --client-bottom-offset: 8px;
    --stack-gap: 8px;
    --rentals-top-limit: 72px;
    --rentals-client-offset: calc(48dvh + 8px);
  }

  #desktopMetrics,
  #desktopMetricsFilter,
  #desktopSpotlight,
  .mobile-metrics-handle,
  #mobileMetricsMiniFilters {
    display: none !important;
  }

  body.mobile-metrics-open {
    overflow: hidden;
  }

  #brandPanel {
    top: 8px;
    /* Отступ слева освобождает место под бургер-ручку (она заходит до x≈56px),
       появившуюся в компактном диапазоне на планшетах. */
    left: 72px;
    transform: none;
    max-width: calc(100vw - 420px);
    padding: 6px 10px;
    border-radius: 18px;
  }

  #brandBadge img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  #brandBadge strong {
    font-size: 17px;
  }

  #brandBadge small {
    font-size: 9px;
  }

  #statusBar {
    top: 52px !important;
    left: 72px !important; /* в один ряд с brandPanel, справа от бургер-ручки */
    transform: none !important;
    max-width: calc(100vw - 80px) !important;
  }

  #status {
    padding: 7px 10px !important;
    font-size: 11px !important;
    line-height: 1.3;
    border-radius: 14px !important;
  }

  .auth-session-badge {
    top: 8px;
    right: 8px;
    min-width: 160px;
    max-width: 164px;
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 8px;
    padding: 5px;
    border-radius: 14px;
  }

  .auth-session-badge__handle {
    width: 30px;
    min-width: 30px;
    min-height: 54px;
    border-radius: 11px;
  }

  .auth-session-badge__content {
    padding-top: 1px;
    padding-bottom: 1px;
  }

  .auth-session-badge__fio {
    font-size: 11px;
  }

  .auth-session-badge__pin {
    font-size: 9px;
  }

  #startRentalBadge {
    top: 8px;
    bottom: auto;
    right: 180px;
    min-width: 166px;
    max-width: 170px;
  }

  #startRentalBadge .auth-session-badge__content button,
  #startRentalBadge #startRentalBtn {
    padding: 6px 8px;
    font-size: 11px;
  }

  #employeeAuditWrapper {
    margin-top: 96px !important;
  }

  #startRentalBadge .start-rental-scan-btn {
    width: 36px;
    height: 36px;
    margin-top: 6px;
  }

  #deviceListWrapper,
  #analyticsWrapper,
  #rentalsTopControl,
  #clientListWrapper {
    width: calc(50vw - 12px) !important;
    max-width: calc(50vw - 12px) !important;
    transform: none !important;
  }

  #deviceListWrapper,
  #analyticsWrapper {
    top: 82px !important;
    max-height: 50px !important;
  }

  #deviceListWrapper {
    left: 8px !important;
    right: auto !important;
  }

  #analyticsWrapper {
    left: auto !important;
    right: 8px !important;
  }

  #rentalsTopControl,
  #clientListWrapper {
    bottom: 8px !important;
  }

  #rentalsTopControl {
    left: 8px !important;
    right: auto !important;
    max-height: 50px !important;
  }

  #clientListWrapper {
    left: auto !important;
    right: 8px !important;
    max-height: var(--client-collapsed-height) !important;
  }

  #deviceListWrapper.panel-open,
  #analyticsWrapper.panel-open,
  #rentalsTopControl.panel-open,
  #clientListWrapper.panel-open {
    width: calc(50vw - 12px) !important;
    max-width: calc(50vw - 12px) !important;
  }

  #deviceListWrapper.panel-open,
  #analyticsWrapper.panel-open {
    top: 82px !important;
    max-height: calc(100dvh - 148px) !important;
  }

  #rentalsTopControl.panel-open,
  #clientListWrapper.panel-open {
    bottom: 8px !important;
    max-height: calc(100dvh - 148px) !important;
  }

  #rentalsTopControl.lifted-by-client {
    bottom: calc(var(--client-bottom-offset) + var(--client-collapsed-height) + var(--stack-gap)) !important;
  }

  #deviceListHeader,
  #analyticsHeader,
  #rentalsMapHeader,
  #clientListHeader {
    padding: 9px 10px !important;
    gap: 8px !important;
  }

  #clientListHeader {
    align-items: stretch;
  }

  .panel-title {
    font-size: 14px;
  }

  .panel-heading-actions {
    min-width: 0;
    gap: 6px;
  }

  #deviceFleetFilterSelect,
  .rentals-filter-select {
    max-width: 118px;
    min-width: 0;
    padding: 5px 7px;
    font-size: 11px;
  }

  #deviceListWrapper .device-list-search-row {
    padding: 2px 8px 6px;
  }

  #deviceListContent,
  #analyticsContent,
  #rentalsMapContent,
  #clientListContent {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 8px !important;
  }

  #deviceList,
  #clientList,
  #rentalsMapContent,
  #analyticsInner {
    gap: 6px !important;
  }

  #clientHeaderActions {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  #btnNewClient {
    width: auto;
    min-width: 98px;
  }

  .info-row {
    flex-direction: column;
    gap: 4px;
  }

  .info-key,
  .info-val {
    width: 100%;
  }

  .app-modal,
  .app-modal--wide {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    height: calc(100dvh - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    border-radius: 16px !important;
  }

  .app-modal--mini {
    width: min(420px, calc(100vw - 24px)) !important;
    max-width: min(420px, calc(100vw - 24px)) !important;
    height: auto !important;
    max-height: min(70dvh, 500px) !important;
    border-radius: 20px !important;
  }

  .network-admin-form__inline-btn {
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
  }

  .modal-header,
  #infoModalHeader,
  #paymentMethodsModalHeader,
  .modal-body,
  #infoModalContent,
  #rentalsList,
  #paymentMethodsContent,
  #clientDataContent {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

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

@media (max-width: 620px) {
  .network-admin-panel--create,
  .network-admin-panel--list {
    height: auto;
  }

  .network-admin-form--starline,
  .network-admin-form__actions--starline {
    grid-template-columns: 1fr;
  }
}

  @media (min-width: 1180px) {
    body.desktop-dashboard-active:not(.desktop-map-mode) #desktopTopbar,
    body.desktop-dashboard-active:not(.desktop-map-mode) #desktopMapSummaryCard,
    body.desktop-dashboard-active:not(.desktop-map-mode) #analyticsWrapper,
    body.desktop-dashboard-active:not(.desktop-map-mode) #deviceListWrapper,
    body.desktop-dashboard-active:not(.desktop-map-mode) #rentalsTopControl {
      width: 100% !important;
      max-width: none !important;
      justify-self: stretch;
    }

    body.desktop-dashboard-active:not(.desktop-map-mode) #desktopMapSummaryCard,
    body.desktop-dashboard-active:not(.desktop-map-mode) #analyticsWrapper,
    body.desktop-dashboard-active:not(.desktop-map-mode) #deviceListWrapper,
    body.desktop-dashboard-active:not(.desktop-map-mode) #rentalsTopControl {
      min-width: 0;
    }
  }

@media (orientation: landscape) {
  body.phone-landscape {
    --client-collapsed-height: 72px;
    --client-bottom-offset: 6px;
    --stack-gap: 6px;
    --rentals-top-limit: 70px;
  }

  body.phone-landscape #desktopMetrics,
  body.phone-landscape #desktopMetricsFilter,
  body.phone-landscape #desktopSpotlight,
  body.phone-landscape #employeeAuditWrapper,
  body.phone-landscape .mobile-metrics-handle,
  body.phone-landscape #mobileMetricsMiniFilters {
    display: none !important;
  }

  body.phone-landscape .mobile-nav-handle {
    top: 8px;
  }

  body.phone-landscape #brandPanel {
    top: 6px;
    left: 6px;
    transform: scale(0.82);
    transform-origin: top left;
    max-width: calc(100vw - 300px);
  }

  body.phone-landscape #statusBar {
    top: 40px !important;
    left: 6px !important;
    transform: scale(0.86) !important;
    transform-origin: top left !important;
    max-width: calc(100vw - 96px) !important;
    z-index: 1640 !important;
  }

  body.phone-landscape #deviceListWrapper,
  body.phone-landscape #analyticsWrapper,
  body.phone-landscape #rentalsTopControl,
  body.phone-landscape #clientListWrapper {
    width: calc(50vw - 18px) !important;
    max-width: calc(50vw - 18px) !important;
    transform: none !important;
    border-radius: 20px !important;
    min-height: 56px !important;
    max-height: 56px !important;
  }

  body.phone-landscape #deviceListWrapper,
  body.phone-landscape #analyticsWrapper {
    top: 78px !important;
  }

  body.phone-landscape #deviceListWrapper {
    left: 8px !important;
    right: auto !important;
  }

  body.phone-landscape #analyticsWrapper {
    left: auto !important;
    right: 8px !important;
  }

  body.phone-landscape #rentalsTopControl,
  body.phone-landscape #clientListWrapper {
    bottom: 6px !important;
  }

  body.phone-landscape #rentalsTopControl {
    left: 8px !important;
    right: auto !important;
  }

  body.phone-landscape #clientListWrapper {
    left: auto !important;
    right: 8px !important;
  }

  body.phone-landscape #deviceListWrapper.panel-open,
  body.phone-landscape #analyticsWrapper.panel-open {
    max-height: min(44dvh, calc(100dvh - 154px)) !important;
    border-radius: 20px !important;
  }

  body.phone-landscape #rentalsTopControl.panel-open,
  body.phone-landscape #clientListWrapper.panel-open {
    max-height: min(39dvh, calc(100dvh - 154px)) !important;
    border-radius: 20px !important;
  }

  body.phone-landscape #deviceListHeader,
  body.phone-landscape #analyticsHeader,
  body.phone-landscape #rentalsMapHeader,
  body.phone-landscape #clientListHeader {
    min-height: 58px !important;
    padding: 10px 14px !important;
    gap: 8px !important;
  }

  body.phone-landscape #deviceListWrapper:not(.panel-open) #deviceListHeader,
  body.phone-landscape #analyticsWrapper:not(.panel-open) #analyticsHeader,
  body.phone-landscape #rentalsTopControl:not(.panel-open) #rentalsMapHeader,
  body.phone-landscape #clientListWrapper:not(.panel-open) #clientListHeader {
    padding-right: 12px !important;
  }

  body.phone-landscape .panel-title {
    font-size: 13px;
    line-height: 1.15;
  }

  body.phone-landscape .panel-badge,
  body.phone-landscape .panel-toggle {
    font-size: 11px;
  }

  body.phone-landscape .panel-heading-group {
    gap: 4px;
  }

  body.phone-landscape .panel-heading-actions {
    min-width: 0;
    gap: 6px;
  }

  body.phone-landscape #deviceFleetFilterSelect,
  body.phone-landscape .rentals-filter-select,
  body.phone-landscape #clientPhoneFilter,
  body.phone-landscape #clientPhoneFilterClear,
  body.phone-landscape #btnNewClient,
  body.phone-landscape #rentalsMapHeader .panel-open-btn,
  body.phone-landscape #deviceListWrapper .device-fleet-search-input {
    min-height: 34px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
  }

  body.phone-landscape #deviceFleetFilterSelect,
  body.phone-landscape .rentals-filter-select {
    max-width: 132px;
    padding-left: 8px !important;
    padding-right: 28px !important;
  }

  body.phone-landscape #deviceListWrapper .device-list-search-row {
    padding: 2px 8px 6px;
  }

  body.phone-landscape #deviceListContent,
  body.phone-landscape #analyticsContent,
  body.phone-landscape #rentalsMapContent,
  body.phone-landscape #clientListContent {
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-bottom: 10px !important;
  }

  body.phone-landscape #deviceList,
  body.phone-landscape #clientList,
  body.phone-landscape #rentalsMapContent,
  body.phone-landscape #analyticsInner {
    gap: 8px !important;
  }

  body.phone-landscape #clientHeaderActions,
  body.phone-landscape #clientPhoneFilterWrap {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  body.phone-landscape #btnNewClient {
    min-width: 108px;
    padding-left: 10px !important;
    padding-right: 10px !important;
    white-space: nowrap;
  }

  body.phone-landscape #clientPhoneFilter {
    min-width: 0;
  }

  body.phone-landscape #startRentalBadge {
    --auth-badge-peek-width: 42px;
  }

  body.phone-landscape #startRentalBadge {
    top: 50%;
    bottom: auto;
    right: 4px;
    transform: translateY(-50%) scale(0.82);
    transform-origin: center right;
    z-index: 1660;
  }

  body.phone-landscape #startRentalBadge .auth-session-badge__handle {
    width: 34px;
    min-width: 34px;
    min-height: 68px;
    border-radius: 14px;
  }

  body.phone-landscape #startRentalBadge .auth-session-badge__content {
    max-width: 126px;
  }

  body.phone-landscape #startRentalBadge .auth-session-badge__content button,
  body.phone-landscape #startRentalBadge #startRentalBtn {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  body.phone-landscape #startRentalBadge .start-rental-scan-btn {
    width: 34px;
    height: 34px;
    margin-top: 5px;
  }

  body.phone-landscape #mapControls {
    right: 48px !important;
    top: 60% !important;
    gap: 6px;
  }
}

/* ── Staff role restrictions ── */
body.role-staff #desktopSidebarBranchesLink,
body.role-staff #desktopSidebarAuditLink,
body.role-staff #desktopSidebarNav button[data-desktop-target="analyticsWrapper"],
body.role-staff #mobileNavBranchesLink,
body.role-staff #mobileNavAuditLink,
body.role-staff #mobileNavAnalyticsLink,
body.role-staff #analyticsWrapper,
body.role-staff #employeeAuditWrapper,
body.role-staff #desktopSidebarTransactionsLink,
body.role-staff #mobileNavTransactionsLink { display: none !important; }

/* Staff only sees daily revenue — hide other period buttons */
body.role-staff #desktopRevenueFilterMonth,
body.role-staff #desktopRevenueFilterTotal,
body.role-staff #mobileRevenueFilterMonth,
body.role-staff #mobileRevenueFilterTotal,
body.role-staff .desktop-metrics-filter__allreceipts { display: none !important; }

/* Staff analytics panel — рабочая сводка */
body:not(.role-staff) #staffAnalyticsWrapper { display: none !important; }
body.desktop-map-mode #staffAnalyticsWrapper { display: none !important; }

#staffAnalyticsWrapper {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8ecf0;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}

#staffAnalyticsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

#staffAnalyticsContent {
  padding: 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.staff-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  flex: 1;
}

.staff-analytics-card {
  /* дефолтные токены цвета переопределяются модификаторами статуса ниже */
  --sa-accent: #64748b;
  --sa-tint-a: rgba(100, 116, 139, 0.14);
  --sa-tint-b: rgba(100, 116, 139, 0.05);
  --sa-border: rgba(100, 116, 139, 0.30);
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--sa-tint-a), var(--sa-tint-b));
  border: 1px solid var(--sa-border);
  border-radius: 14px;
  padding: 16px 12px 14px 16px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* цветная акцентная полоса слева */
.staff-analytics-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--sa-accent);
}

.staff-analytics-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 18, 37, 0.10);
}

.staff-analytics-card__num {
  font-size: 40px;
  font-weight: 800;
  color: var(--sa-accent);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.staff-analytics-card__label {
  font-size: 13px;
  color: #475569;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.staff-analytics-card--overdue {
  --sa-accent: #dc2626;
  --sa-tint-a: rgba(220, 38, 38, 0.16);
  --sa-tint-b: rgba(220, 38, 38, 0.05);
  --sa-border: rgba(220, 38, 38, 0.32);
}
.staff-analytics-card--today {
  --sa-accent: #d97706;
  --sa-tint-a: rgba(217, 119, 6, 0.16);
  --sa-tint-b: rgba(217, 119, 6, 0.05);
  --sa-border: rgba(217, 119, 6, 0.32);
}
.staff-analytics-card--repair {
  --sa-accent: #7c3aed;
  --sa-tint-a: rgba(124, 58, 237, 0.15);
  --sa-tint-b: rgba(124, 58, 237, 0.05);
  --sa-border: rgba(124, 58, 237, 0.30);
}
.staff-analytics-card--tomorrow {
  --sa-accent: #2563eb;
  --sa-tint-a: rgba(37, 99, 235, 0.15);
  --sa-tint-b: rgba(37, 99, 235, 0.05);
  --sa-border: rgba(37, 99, 235, 0.30);
}

@media (max-width: 900px) {
  .staff-analytics-card__num { font-size: 34px; }
  .staff-analytics-card__label { font-size: 12px; }
}

/* ============================================================
   Fleet Module: Sidebar + Content Layout
   ============================================================ */

.fleet-module {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #f8fafc;
}

/* Sidebar */
.fleet-sidebar {
  width: 220px;
  min-width: 180px;
  background: #111827;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.fleet-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.fleet-sidebar__logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.fleet-sidebar__close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.fleet-sidebar__close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.fleet-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.fleet-sidebar__item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.fleet-sidebar__item--active {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-left-color: #7c3aed;
  font-weight: 700;
}

.fleet-sidebar__icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.fleet-sidebar__scope-wrap {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: center;
}

.fleet-sidebar__branch-scope {
  width: 100%;
}

.fleet-sidebar__branch-select {
  width: 100%;
  background: rgba(255,255,255,0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: auto;
}
.fleet-sidebar__branch-select:focus {
  border-color: rgba(124,58,237,0.6);
  background: rgba(255,255,255,0.12);
}

/* Content area */
.fleet-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.fleet-content__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.fleet-content__title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}

.fleet-content__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fleet-content__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Fleet sections */
.fleet-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fleet-section[hidden] { display: none !important; }

.fleet-section .dashboard-screen__meta {
  padding: 8px 20px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.fleet-section #fleetFullscreenContent {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* Раздел «Услуги мастера»: контент прокручивается внутри секции (аналитика не уходит за экран). */
.fleet-section #fleetServicesContent {
  flex: 1;
  overflow-y: auto;
}

.fleet-section__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Fleet buttons */
.fleet-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.fleet-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.fleet-btn--primary { background: #7c3aed; color: #fff; }
.fleet-btn--primary:hover:not(:disabled) { background: #6d28d9; }
.fleet-btn--secondary { background: #f1f5f9; color: #111827; border: 1px solid #e2e8f0; }
.fleet-btn--secondary:hover:not(:disabled) { background: #e2e8f0; }
.fleet-btn--delete { background: #dc2626; color: #fff; border: none; }
.fleet-btn--delete:hover:not(:disabled) { background: #b91c1c; }
.fleet-close-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #6b7280;
  font-size: 15px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  line-height: 1;
  margin-left: 16px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.fleet-close-btn:hover { color: #111827; background: #f1f5f9; border-color: #9ca3af; }
.ddc-row { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:#57534e; padding:2px 0; }
.device-card__block--danger { border-top: 1px solid #fee2e2; background: #fffafa; }
.device-card__block-title--danger { color: #b91c1c; }

/* Telemetry section */
.fleet-telemetry-block {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.fleet-telemetry-block__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #111827;
}
.fleet-telemetry-form {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fleet-telemetry-status {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.fleet-telemetry-status--connected { background: #dcfce7; color: #16a34a; }
.fleet-telemetry-status--disconnected { background: #fee2e2; color: #dc2626; }
.fleet-telemetry-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   Settings module (network admin) — sidebar layout
   ═══════════════════════════════════════════════════════════ */
.settings-module {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #f8fafc;
}
.settings-sidebar {
  width: 230px;
  min-width: 190px;
  background: #111827;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  overflow-y: auto;
}
.settings-sidebar__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  gap: 8px;
}
.settings-sidebar__logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}
.settings-sidebar__sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  line-height: 1.4;
}
.settings-sidebar__close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.settings-sidebar__close:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.settings-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.settings-sidebar__item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.settings-sidebar__item--active {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-left-color: #7c3aed;
  font-weight: 700;
}
.settings-sidebar__item--hidden {
  display: none !important;
}
.settings-sidebar__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.8;
}
.settings-sidebar__item--active .settings-sidebar__icon,
.settings-sidebar__item:hover .settings-sidebar__icon { opacity: 1; }
.settings-sidebar__status {
  margin-top: auto;
  padding: 10px 14px 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  border-top: 1px solid rgba(255,255,255,0.07);
  min-height: 0;
  word-break: break-word;
}
.settings-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.settings-content__close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 20;
  margin-left: 0;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #374151 !important;
  transform: none !important;
  box-shadow: none !important;
}
.settings-content__close-btn:hover { background: #e2e8f0 !important; color: #111827 !important; border-color: #94a3b8 !important; box-shadow: none !important; transform: none !important; }
.settings-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.settings-section[hidden] { display: none !important; }
.settings-content__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 68px 13px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
  gap: 12px;
}
.settings-content__title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.settings-content__subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 3px;
}
.settings-section__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Branches section uses a horizontal split layout — each column scrolls independently */
.settings-section__body.settings-branches-layout {
  display: grid;
  grid-template-columns: 265px 1fr;
  gap: 0;
  overflow: hidden;
  padding: 0;
  flex: 1;
  min-height: 0;
}
.settings-branches-list-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  padding: 14px 8px 14px 18px;
  border-right: 1px solid #f0f4f8;
  min-height: 0;
}
.settings-branches-detail-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 14px 20px 14px 16px;
  min-height: 0;
}
/* Card components */
.settings-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
}
.settings-card__header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}
.settings-card__title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.settings-card__title--sm {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}
.settings-card__subtitle {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}
.settings-identity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}
.settings-identity-row:last-of-type { border-bottom: none; }
.settings-identity-row__label {
  color: #64748b;
  font-weight: 600;
  min-width: 130px;
  flex-shrink: 0;
}
.settings-identity-row__value {
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}
.settings-tariff-note {
  font-size: 12px;
  color: #64748b;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  margin-bottom: 12px;
}
.settings-telemetry-content {
  display: flex;
  flex-direction: column;
}
/* Responsive */
@media (max-width: 800px) {
  .settings-sidebar { width: 200px; min-width: 160px; }
  .settings-section__body.settings-branches-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .settings-sidebar { display: none; }
  .settings-module { flex-direction: column; }
}

/* Repairs section */
.fleet-repairs-list {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.fleet-repairs-row:hover { background: #f8fafc; }

/* Device card modal */
.app-modal--slide-right {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: min(600px, 100vw) !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  background: #fff !important;
  box-shadow: -4px 0 40px rgba(0,0,0,0.18) !important;
  border-radius: 0 !important;
  z-index: 2000;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex;
  flex-direction: column;
}
.app-modal--slide-right[hidden] { display: none; }

.device-card-modal {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #f8fafc;
}
.device-card-modal__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #f8fafc;
}

.device-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  background: #111827;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  /* Липкая шапка без собственного GPU-слоя перерисовывалась на CPU на каждом кадре скролла —
     отсюда мерцание в районе шапки. Промоутим в отдельный слой композитора (тот же приём, что
     уже применён к #deviceListContent и др.), тогда скролл композитится, а не перерисовывается. */
  transform: translateZ(0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.device-card__title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}
.device-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.device-card__code {
  background: rgba(124,58,237,0.25);
  color: #c4b5fd;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}
.device-card__category {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}
.device-card__status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.device-card__status--ready { background: rgba(22,163,74,0.2); color: #4ade80; }
.device-card__status--in_rent { background: rgba(37,99,235,0.2); color: #93c5fd; }
.device-card__status--repair { background: rgba(245,158,11,0.2); color: #fbbf24; }
.device-card__status--retired { background: rgba(220,38,38,0.2); color: #fca5a5; }
.device-card__engine {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.device-card__engine--locked { background: rgba(220,38,38,0.2); color: #fca5a5; }
.device-card__engine--unlocked { background: rgba(22,163,74,0.2); color: #4ade80; }
.device-card__header-right {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-shrink: 0;
}
.device-card__close-btn {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border: none !important;
  padding: 6px 10px !important;
}
.device-card__close-btn:hover { background: rgba(255,255,255,0.2) !important; }

.device-card__block {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}
.device-card__block:last-child { border-bottom: none; }
.device-card__block-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
}
.device-card__field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.device-card__field-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.device-card__field-value {
  font-size: 14px;
  color: #111827;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.device-card__field-value--code {
  font-size: 18px;
  font-weight: 800;
  color: #7c3aed;
  letter-spacing: 0.08em;
}

/* Batch create modal */
.app-modal--dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(440px, 96vw) !important;
  height: auto !important;
  max-height: min(90vh, 640px) !important;
  background: #fff !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 60px rgba(0,0,0,0.22) !important;
  z-index: 2100;
  overflow: hidden !important;
}
.app-modal--dialog:not([hidden]) { display: flex !important; flex-direction: column !important; }
.app-modal--dialog[hidden] { display: none !important; }
.app-modal--dialog .modal-body { overflow-y: auto; flex: 1; }
.app-modal--qr-scanner { width: min(480px, 96vw) !important; max-height: min(92vh, 760px) !important; }
.app-modal--dialog .modal-dialog { display: flex; flex-direction: column; max-height: 90vh; }
.app-modal--dialog .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.modal-close-btn {
  background: #f1f5f9;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 16px;
  color: #475569;
}
.modal-close-btn:hover { background: #e2e8f0; }
.batch-preview {
  font-size: 12px;
  color: #475569;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}
.form-input {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: #7c3aed; }

/* Mobile adaptation for fleet module */
@media (max-width: 1179px) {
  .fleet-module {
    flex-direction: column;
  }
  .fleet-sidebar {
    width: 100%;
    min-width: unset;
    flex-direction: row;
    overflow-x: auto;
    padding: 0;
    height: auto;
    flex-shrink: 0;
  }
  .fleet-sidebar__header {
    display: none;
  }
  .fleet-sidebar__item {
    padding: 12px 14px;
    font-size: 13px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    flex-shrink: 0;
  }
  .fleet-sidebar__item--active {
    border-bottom-color: #7c3aed;
    border-left: none;
  }
  .fleet-sidebar__scope-wrap {
    margin-top: 0;
    padding: 8px 14px;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.08);
  }
  .fleet-content__topbar {
    padding: 10px 12px;
  }
  .fleet-content__title {
    font-size: 16px;
  }
  .app-modal--slide-right {
    width: 100vw;
  }
}

/* Clients screen filter chips */
.clients-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}
.clients-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}
.clients-filter-chip:hover { background: #e2e8f0; }
.clients-filter-chip.is-active { background: #0f172a; border-color: #0f172a; color: #fff; }
.clients-filter-chip--renting.is-active { background: #166534; border-color: #166534; }
.clients-filter-chip--free.is-active { background: #475569; border-color: #475569; }
.clients-filter-chip--problem.is-active { background: #b91c1c; border-color: #b91c1c; }
.clients-filter-chip--blacklist { border-color: #fecaca; color: #dc2626; }
.clients-filter-chip--blacklist.is-active { background: #dc2626; border-color: #dc2626; color: #fff; }

/* Clients screen list table view */
.clients-table-view { width: 100%; border-collapse: collapse; font-size: 13px; }
.clients-table-view th { padding: 8px 10px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; text-align: left; font-weight: 700; white-space: nowrap; }
.clients-table-view td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.clients-table-view tr:hover td { background: #eff6ff; cursor: pointer; }
/* Строка клиента из ЧС — красный фон для заметности (главный экран и экран клиентов) */
.clients-table-view tr.client-row--blacklisted td { background: #fff1f2; }
.clients-table-view tr.client-row--blacklisted:hover td { background: #ffe4e6; }
.clients-table-view tr.client-row--blacklisted .client-table-title { color: #dc2626; }
.dashboard-list-card--blacklisted { background: #fff1f2 !important; border-color: #fecaca !important; }
.dashboard-list-card--blacklisted .dashboard-list-card__title { color: #dc2626; }
.client-blacklist-badge { display: inline-block; background: #fef2f2; color: #dc2626; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; border: 1px solid #fecaca; margin-left: 6px; vertical-align: middle; }
/* Шапка карточки клиента из ЧС — красная, чтобы стоп-лист читался сразу */
.device-card__header--blacklisted { background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%) !important; }
.device-card__header--blacklisted .client-blacklist-badge { background: rgba(255,255,255,0.16); color: #fff; border-color: rgba(255,255,255,0.4); }

/* ═══════════════════════════════════════════════════════════════════════════
   Analytics fullscreen modal — premium redesign
   ═══════════════════════════════════════════════════════════════════════════ */

/* Dark premium header — аналитика выглядит как настоящий дашборд */
#analyticsFullscreenModal .modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#analyticsFullscreenModal .modal-title {
  color: #f8fafc;
  font-size: 20px;
  letter-spacing: -0.01em;
}

#analyticsFullscreenModal .modal-subtitle {
  color: rgba(248, 250, 252, 0.48);
}

#analyticsFullscreenModal #analyticsFullscreenClose {
  padding: 8px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.8);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

#analyticsFullscreenModal #analyticsFullscreenClose:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

/* Period switch — бренд-жёлтый для активной кнопки */
#analyticsFullscreenModal .dashboard-period-switch__btn.is-active {
  background: #ffd400;
  color: #111;
  box-shadow: 0 6px 18px rgba(255, 212, 0, 0.3);
}

/* KPI grid — чуть больше колонок, чуть уже минимальная ширина */
#analyticsFullscreenContent .dashboard-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

#analyticsFullscreenContent .dashboard-kpi-card {
  padding: 16px 16px 18px;
  border-radius: 18px;
}

#analyticsFullscreenContent .dashboard-kpi-card__value {
  font-size: 26px;
  margin-top: 8px;
}

#analyticsFullscreenContent .dashboard-kpi-card__hint {
  font-size: 12px;
  margin-top: 6px;
}

/* Section headings — акцентная левая полоса + разделитель сверху */
#analyticsFullscreenContent .dashboard-section-heading {
  padding: 20px 0 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  margin-top: 4px;
}

#analyticsFullscreenContent .dashboard-section-heading__title {
  position: relative;
  padding-left: 16px;
  font-size: 18px;
  font-weight: 900;
}

#analyticsFullscreenContent .dashboard-section-heading__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, #0f766e, #0891b2);
  border-radius: 3px;
}

/* Insight cards — тонкая акцентная левая граница */
#analyticsFullscreenContent .dashboard-insight-card {
  border-left: 3px solid rgba(15, 118, 110, 0.4);
  padding: 16px 18px;
}

#analyticsFullscreenContent .dashboard-insight-card strong {
  font-size: 22px;
  margin-top: 8px;
}

/* Chart cards — немного компактнее */
#analyticsFullscreenContent .dashboard-chart-card {
  padding: 18px;
  border-radius: 20px;
}

/* Toolbar background — чуть светлее и без жёлтого */
#analyticsFullscreenModal .dashboard-screen__toolbar {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   UNIFIED DESIGN SYSTEM — все fullscreen-модалки в едином стиле с Флотом
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Фон всех fullscreen-модальных окон — чистый светло-серый как у Флота */
#rentalsFullscreenModal,
#clientsFullscreenModal,
#networkAdminModal {
  background: #f8fafc !important;
}

/* ── 2. Toolbar Аренды / Клиенты — белый, без жёлтого градиента ──────────── */
#rentalsFullscreenModal .dashboard-screen__toolbar,
#clientsFullscreenModal .dashboard-screen__toolbar {
  background: #fff !important;
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 10px 20px !important;
  margin: 0 !important;
}

/* Chips-фильтры клиентов — чистые, без фонового оттенка */
#clientsFullscreenModal .clients-filter-chips {
  padding: 0 20px 8px;
  gap: 6px;
}

/* ── 3. Настройки сети — тёмная шапка как у Аренд и Клиентов ───────────────  */
#networkAdminModal .modal-header {
  background: #111827 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
#networkAdminModal .modal-title {
  color: #f8fafc;
}
#networkAdminModal .modal-subtitle {
  color: rgba(248, 250, 252, 0.5);
}

/* Кнопка «Закрыть» в контент-области настроек */
#networkAdminModal #networkAdminCloseBtn {
  background: transparent !important;
  border: 1px solid #d1d5db !important;
  color: #6b7280 !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
#networkAdminModal #networkAdminCloseBtn:hover {
  background: #f1f5f9 !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
}

/* ── 4. Настройки сети — панели и карточки в стиле Флота ───────────────────  */
#networkAdminModal .network-admin-auth-card,
#networkAdminModal .network-admin-panel {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
  border-radius: 16px !important;
}
#networkAdminModal .network-admin-subpanel {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}
#networkAdminModal .network-admin-subcard {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  border-radius: 12px !important;
}
#networkAdminModal .network-admin-auth-card__meta {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* ── 5. Настройки сети — вкладки раздела в стиле Флота (underline tabs) ───── */
#networkAdminModal .network-admin-section-nav {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  padding: 0 4px !important;
  border-bottom: 2px solid #e2e8f0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  margin-bottom: 4px !important;
}
#networkAdminModal .network-admin-section-nav__btn {
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  background: transparent !important;
  padding: 11px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin-bottom: -2px !important;
  transition: color 0.15s, border-color 0.15s !important;
  transform: none !important;
}
#networkAdminModal .network-admin-section-nav__btn:hover {
  background: transparent !important;
  color: #111827 !important;
  transform: none !important;
  border-bottom-color: rgba(124, 58, 237, 0.3) !important;
}
#networkAdminModal .network-admin-section-nav__btn.is-active {
  background: transparent !important;
  border-bottom-color: #7c3aed !important;
  color: #7c3aed !important;
  font-weight: 800 !important;
  transform: none !important;
}

/* ── 6. Настройки сети — фиолетовые кнопки действий, как у Флота ───────────  */
#networkAdminModal button[type="submit"] {
  background: #7c3aed !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  font: inherit !important;
  font-weight: 700 !important;
  padding: 10px 18px !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}
#networkAdminModal button[type="submit"]:hover {
  background: #6d28d9 !important;
}
#networkAdminModal button[type="submit"]:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* Второстепенные кнопки в стиле fleet-btn--secondary */
#networkAdminModal .auth-gate__secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font: inherit !important;
  font-weight: 700 !important;
  padding: 10px 16px !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}
#networkAdminModal .auth-gate__secondary:hover {
  background: #e2e8f0 !important;
}

/* ── 7. Настройки сети — поля ввода с фиолетовым фокусом ───────────────────  */
#networkAdminModal .network-admin-form input,
#networkAdminModal .network-admin-auth-card__form input,
#networkAdminModal .network-admin-form select {
  border-radius: 10px !important;
  border-color: #e2e8f0 !important;
  background: #fff !important;
}
#networkAdminModal .network-admin-form input:focus,
#networkAdminModal .network-admin-auth-card__form input:focus,
#networkAdminModal .network-admin-form select:focus {
  border-color: #7c3aed !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12) !important;
}

/* ── 8. Заметка-подсказка (section-note) — нейтральный цвет ────────────────  */
#networkAdminModal .network-admin-section-note {
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.8), rgba(248, 250, 252, 0.95)) !important;
  border-color: rgba(124, 58, 237, 0.15) !important;
  color: #334155 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   FLEET-STYLE REDESIGN  –  Главный экран, аудит, аналитика
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Скрыть телеметрию для роли Staff ── */
body.role-staff .fleet-sidebar__item[data-fleet-nav="telemetry"],
body.role-staff #fleetSectionTelemetry { display: none !important; }

/* ── 1b. Создание/удаление устройств — только для админа. Сотрудник (staff) не видит эти кнопки. ── */
body.role-staff #fleetAddBikeBtn,
body.role-staff #fleetBatchCreateBtn,
body.role-staff #fleetSelectModeBtn,
body.role-staff #fleetDeleteSelectedBtn { display: none !important; }

/* Привязка телеметрии в карточке устройства — скрыта для роли сотрудник (staff) */
body.role-staff #deviceCardTelemetryBlock { display: none !important; }

/* Чекбокс выбора устройства в списке парка */
.fleet-select-checkbox { width:18px; height:18px; cursor:pointer; accent-color:#dc2626; flex:none; }
.fleet-fullscreen-card.is-selected { outline:2px solid #dc2626; outline-offset:1px; }
tr.is-selected { background:#fef2f2 !important; }

/* ── 2. Базовые CSS-переменные нового стиля ── */
:root {
  --new-btn-bg: #f1f5f9;
  --new-btn-color: #1e293b;
  --new-btn-border: #e2e8f0;
  --new-btn-active-bg: #1e293b;
  --new-btn-active-color: #fff;
  --new-btn-radius: 10px;
  --new-primary-bg: #7c3aed;
  --new-primary-color: #fff;
  --new-input-bg: #ffffff;
  --new-input-border: #e2e8f0;
  --new-panel-header-bg: rgba(255, 255, 255, 0.82);
  --new-panel-header-border: rgba(17, 17, 17, 0.09);
}

/* ── 3. Заголовки панелей ── */
#deviceListHeader,
#analyticsHeader,
#rentalsMapHeader,
#clientListHeader,
#employeeAuditHeader {
  padding: 14px 16px;
  background: var(--new-panel-header-bg);
  border-bottom: 1px solid var(--new-panel-header-border);
  backdrop-filter: blur(8px);
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0;
}

.panel-badge {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 2px 8px;
}

.panel-toggle {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
}

/* ── 4. Кнопки внутри панелей (fleet-btn стиль) ── */
#deviceListHeader button,
#analyticsHeader button,
#rentalsMapHeader button,
#clientListHeader button,
#employeeAuditHeader button,
#employeeAuditActions button {
  appearance: none;
  background: var(--new-btn-bg) !important;
  color: var(--new-btn-color) !important;
  border: 1px solid var(--new-btn-border) !important;
  border-radius: var(--new-btn-radius) !important;
  padding: 5px 11px !important;
  min-height: auto !important;
  font: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
}

#deviceListHeader button:hover,
#analyticsHeader button:hover,
#rentalsMapHeader button:hover,
#clientListHeader button:hover,
#employeeAuditActions button:hover {
  background: #e2e8f0 !important;
  transform: none;
  box-shadow: none;
}

/* Active state for audit filter buttons */
#employeeAuditActions button.is-active {
  background: var(--new-btn-active-bg) !important;
  color: var(--new-btn-active-color) !important;
  border-color: var(--new-btn-active-bg) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18) !important;
}

/* ── 5. Кнопка «Применить» — зелёный акцент ── */
#employeeAuditApplyBtn {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  border-color: transparent !important;
}

#employeeAuditApplyBtn:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
}

/* ── 6. Кнопка «Вся история» — выделенная ── */
#employeeAuditOpenAllBtn,
.employee-audit-open-all-btn {
  background: linear-gradient(135deg, #1e293b, #334155) !important;
  color: #f8fafc !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22) !important;
  font-weight: 700 !important;
}

#employeeAuditOpenAllBtn:hover,
.employee-audit-open-all-btn:hover {
  background: linear-gradient(135deg, #0f172a, #1e293b) !important;
  transform: none;
}

/* ── 7. Кнопки «Новый клиент» и другие первичные действия ── */
#btnNewClient {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  color: #fff !important;
  border-color: transparent !important;
  border-radius: var(--new-btn-radius) !important;
  padding: 9px 15px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3) !important;
}

#btnNewClient:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6) !important;
  transform: none;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.36) !important;
}

/* ── 8. Кнопка «Сброс» поиска клиентов ── */
#clientPhoneFilterClear {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--new-btn-radius) !important;
}

#clientPhoneFilterClear:hover {
  background: #e2e8f0 !important;
}

/* ── 9. Поля ввода и select внутри панелей ── */
#deviceListHeader select,
#analyticsHeader select,
#rentalsMapHeader select,
#clientListHeader select,
#deviceFleetFilterSelect,
.device-fleet-filter-select,
.rentals-filter-select,
#clientPhoneFilter,
.device-fleet-search-input {
  background: var(--new-input-bg) !important;
  border: 1px solid var(--new-input-border) !important;
  border-radius: var(--new-btn-radius) !important;
  color: #1e293b !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 8px 11px !important;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  -webkit-appearance: none;
  appearance: none;
}

#deviceFleetFilterSelect:focus,
.device-fleet-filter-select:focus,
.rentals-filter-select:focus,
#clientPhoneFilter:focus,
.device-fleet-search-input:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
}

/* ── 10. Поля фильтра аудита (date inputs) ── */
.employee-audit-filter-field {
  background: var(--new-input-bg) !important;
  border: 1px solid var(--new-input-border) !important;
  border-radius: var(--new-btn-radius) !important;
  padding: 4px 8px !important;
  gap: 5px !important;
}

.employee-audit-filter-field span {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.employee-audit-filter-field input {
  font-size: 12px !important;
  color: #1e293b !important;
  min-width: 100px !important;
  max-width: 108px !important;
  line-height: 1.3 !important;
}

/* ── 11. Строка фильтров аудита ── */
.employee-audit-actions {
  gap: 7px !important;
  padding: 10px 16px 12px !important;
  flex-wrap: wrap;
  background: rgba(248, 250, 252, 0.7);
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

/* ══════════════════════════════════════════════════════════════════════════
   АНАЛИТИКА — редизайн полноэкранного экрана
   ══════════════════════════════════════════════════════════════════════════ */

/* Шапка полноэкранной аналитики */
.modal-header {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 14px 20px !important;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header__title {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* Toolbar полноэкранной аналитики */
.dashboard-screen__toolbar--analytics {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 12px 16px !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

/* Переключатели периодов аналитики */
.dashboard-period-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-period-switch__btn {
  appearance: none !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 7px 14px !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.dashboard-period-switch__btn:hover {
  background: #e2e8f0 !important;
  transform: none;
  box-shadow: none;
}

.dashboard-period-switch__btn.is-active {
  background: #7c3aed !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28) !important;
}

/* Поля дат в аналитике */
#analyticsFullscreenStart,
#analyticsFullscreenEnd,
.analytics-date-field {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 7px 11px !important;
  font: inherit !important;
  font-size: 13px !important;
  color: #1e293b !important;
  outline: none;
}

#analyticsFullscreenStart:focus,
#analyticsFullscreenEnd:focus,
.analytics-date-field:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
}

/* Кнопка закрыть аналитику */
.analytics-fullscreen-close,
#analyticsFullscreenClose,
.modal-close-btn {
  appearance: none !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 7px 14px !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  margin-left: auto !important;
}

.analytics-fullscreen-close:hover,
#analyticsFullscreenClose:hover,
.modal-close-btn:hover {
  background: #e2e8f0 !important;
  transform: none;
}

/* Фон контента аналитики */
.analytics-fullscreen-content,
#analyticsFullscreenContent {
  background: #f8fafc;
}

/* KPI-карточки — тёмный фон сохраняется, только скругление подгоняем */
.dashboard-kpi-card {
  border-radius: 14px !important;
}

/* Карточки с графиками ── белые с чистой рамкой */
.dashboard-chart-card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

.dashboard-chart-card__header {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 14px 18px 12px !important;
}

.dashboard-chart-card__title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.dashboard-chart-card__subtitle {
  font-size: 12px !important;
  color: #64748b !important;
}

/* Инсайты ── светлый стиль */
.analytics-insight-card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   КОНЕЦ FLEET-STYLE REDESIGN
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   ЗАЯВКИ — редизайн под fleet-стиль
   ══════════════════════════════════════════════════════════════════════════ */

/* Фон модала заявок — чистый светлый */
.leads-modal {
  background: #f8fafc !important;
}

/* Шапка модала заявок — белая с тонкой рамкой */
.leads-modal__header.modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 16px 20px !important;
}

.leads-modal__header .modal-title {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.leads-modal__header .modal-subtitle {
  font-size: 12px !important;
  color: #64748b !important;
}

/* Кнопка «Закрыть» в шапке заявок */
.leads-modal__header button {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 7px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  min-height: auto !important;
}

.leads-modal__header button:hover {
  background: #e2e8f0 !important;
  transform: none;
}

/* Тело модала */
.leads-modal__body {
  background: #f8fafc;
  padding: 16px !important;
  gap: 14px !important;
}

/* ── Сайдбар: карточка создания заявки ── */
.leads-create-card {
  padding: 18px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
  gap: 10px !important;
}

.leads-create-card__eyebrow {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  color: #7c3aed !important;
  background: rgba(124, 58, 237, 0.08) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
}

.leads-create-card h3 {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.leads-create-card p {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
}

/* Поля формы */
.leads-create-form {
  gap: 10px !important;
}

.leads-create-form label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  gap: 5px !important;
}

.leads-create-form input,
.leads-create-form select {
  min-height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  font-weight: 500 !important;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.leads-create-form input:focus,
.leads-create-form select:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
  outline: none;
  background: #fff !important;
}

.leads-create-form textarea {
  min-height: 84px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  font-weight: 500 !important;
}

.leads-create-form textarea:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
  outline: none;
  background: #fff !important;
}

/* Кнопка «Добавить заявку» */
#leadsCreateSubmit {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 9px 18px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  min-height: auto !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28) !important;
}

#leadsCreateSubmit:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6) !important;
  transform: none;
}

/* ── Тулбар доски ── */
.leads-modal__toolbar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  gap: 10px !important;
}

.leads-modal__toolbar .dashboard-screen__select,
.leads-modal__toolbar .dashboard-screen__search {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 7px 11px !important;
  font-size: 13px !important;
  color: #1e293b !important;
  font-weight: 500 !important;
  min-height: auto !important;
}

.leads-modal__toolbar .dashboard-screen__select:focus,
.leads-modal__toolbar .dashboard-screen__search:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
  outline: none;
}

/* Кнопка «Архив» в тулбаре */
#leadsArchiveBtn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 6px 13px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  min-height: auto !important;
}

#leadsArchiveBtn:hover {
  background: #e2e8f0 !important;
  transform: none;
}

/* ── Колонки канбан-доски ── */
.leads-board__column {
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
}

.leads-board__column-name {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
}

.leads-board__column-count {
  min-height: 26px !important;
  min-width: 26px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
}

/* ── Карточки заявок ── */
.lead-card {
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06) !important;
  padding: 12px !important;
  gap: 8px !important;
}

.lead-card:hover {
  border-color: #c7d2fe !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1) !important;
}

/* ── Панель деталей заявки ── */
.lead-detail-panel {
  border-radius: 16px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

.lead-detail-panel__section--fields input,
.lead-detail-panel__section--fields select,
.lead-detail-panel__section--fields textarea {
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
}

.lead-detail-panel__section--fields input:focus,
.lead-detail-panel__section--fields select:focus,
.lead-detail-panel__section--fields textarea:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
  outline: none;
  background: #fff !important;
}

.lead-detail-panel__inline-actions button {
  background: #7c3aed !important;
  color: #fff !important;
  border-radius: 8px !important;
  min-height: auto !important;
  padding: 8px 16px !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   КОНЕЦ ЗАЯВКИ REDESIGN
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   КАРТОЧКА ЗАЯВКИ (#leadDetailModal) — редизайн
   ══════════════════════════════════════════════════════════════════════════ */

/* Скрываем технический подзаголовок в шапке карточки */
#leadDetailModal .modal-subtitle {
  display: none !important;
}

/* Шапка модала карточки */
#leadDetailModal.modal-header,
#leadDetailModal .modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 14px 20px !important;
  align-items: center !important;
}

#leadDetailModal .modal-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

#leadDetailModal .modal-header button {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  min-height: auto !important;
}

#leadDetailModal .modal-header button:hover {
  background: #e2e8f0 !important;
  transform: none;
}

/* Тело карточки */
#leadDetailModal .leads-archive-detail-modal__body {
  background: #f8fafc;
  padding: 16px 18px !important;
}

/* Убираем дублирующийся eyebrow "КАРТОЧКА ЗАЯВКИ" внутри панели */
#leadDetailModal .lead-detail-panel__eyebrow {
  display: none !important;
}

/* Панель деталей внутри */
#leadDetailModal .lead-detail-panel--modal {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07) !important;
  padding: 20px !important;
  overflow: auto;
}

/* Хедер карточки: имя + значок статуса */
#leadDetailModal .lead-detail-panel__header {
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
  align-items: center !important;
}

#leadDetailModal .lead-detail-panel__header-top {
  margin-bottom: 6px;
}

#leadDetailModal .lead-detail-panel__stage-badge {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 4px 12px !important;
  min-height: 24px !important;
  border-radius: 999px !important;
}

#leadDetailModal .lead-detail-panel__title {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.15 !important;
}

/* Кнопка удаления в заголовке */
#leadDetailModal .lead-delete-icon-btn--header {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  border-radius: 8px !important;
  min-height: auto !important;
  padding: 6px 8px !important;
}

#leadDetailModal .lead-delete-icon-btn--header:hover {
  background: #fecaca !important;
  transform: none;
}

#leadDetailModal .lead-detail-panel__meta-line {
  font-size: 13px !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

/* Секция полей */
#leadDetailModal .lead-detail-panel__section--fields {
  gap: 12px !important;
}

#leadDetailModal .lead-detail-panel__section--fields label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  gap: 5px !important;
}

#leadDetailModal .lead-detail-panel__section--fields select,
#leadDetailModal .lead-detail-panel__section--fields textarea {
  min-height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #0f172a !important;
  width: 100%;
  box-sizing: border-box;
}

#leadDetailModal .lead-detail-panel__section--fields select:focus,
#leadDetailModal .lead-detail-panel__section--fields textarea:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
  outline: none;
  background: #fff !important;
}

#leadDetailModal .lead-detail-panel__section--fields textarea {
  min-height: 110px !important;
  resize: vertical;
}

/* Кнопка «Сохранить» */
#leadDetailModal #leadDetailSaveBtn {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 9px 20px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  min-height: auto !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28) !important;
}

#leadDetailModal #leadDetailSaveBtn:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6) !important;
  transform: none;
}

/* Заголовок секции «Быстрые действия» */
#leadDetailModal .lead-detail-panel__section-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Быстрые действия: сетка кнопок */
#leadDetailModal .lead-detail-panel__quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#leadDetailModal .lead-detail-panel__quick-actions button {
  border-radius: 8px !important;
  min-height: 36px !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border: 1px solid #e2e8f0 !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
}

#leadDetailModal .lead-detail-panel__quick-actions button:nth-child(2) {
  background: #0f766e !important;
  color: #fff !important;
  border-color: transparent !important;
}

#leadDetailModal .lead-detail-panel__quick-actions button:nth-child(1) {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
}

/* Активные стейты кнопок быстрых действий */
#leadDetailModal .lead-detail-panel__quick-actions button.is-active {
  background: #1e293b !important;
  color: #fff !important;
  border-color: transparent !important;
}

#leadDetailModal .lead-detail-panel__quick-actions button.is-active[data-stage="incoming"] {
  background: #f59e0b !important;
  color: #fff !important;
}

#leadDetailModal .lead-detail-panel__quick-actions button.is-active[data-stage="in_rent"] {
  background: #0f766e !important;
  color: #fff !important;
}

#leadDetailModal .lead-detail-panel__quick-actions button.is-active[data-stage="rejected"],
#leadDetailModal .lead-detail-panel__quick-actions button.is-active[data-stage="cancelled"] {
  background: #e11d48 !important;
  color: #fff !important;
}

#leadDetailModal .lead-detail-panel__quick-actions button.is-danger {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

/* Раздел истории */
#leadDetailModal .lead-detail-panel__section-title + .lead-detail-panel__history,
#leadDetailModal .lead-detail-panel__history {
  gap: 8px !important;
}

#leadDetailModal .lead-detail-panel__history-item {
  border-radius: 10px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  padding: 10px 12px !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   КОНЕЦ КАРТОЧКА ЗАЯВКИ REDESIGN
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   LEADS: FIO CLICKABLE TITLE + LIST VIEW + VIEW TOGGLE BUTTON
   ══════════════════════════════════════════════════════════════════════════ */

/* Clickable FIO in lead card */
.lead-card__title--clickable {
  color: #7c3aed;
  cursor: pointer;
  transition: color 0.15s;
}
.lead-card__title--clickable:hover {
  color: #6d28d9;
  text-decoration: underline;
}

/* View toggle buttons in toolbar */
.leads-view-toggle {
  display: flex;
  gap: 2px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}
.leads-view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.leads-view-toggle__btn:hover {
  background: #e2e8f0;
  color: #475569;
}
.leads-view-toggle__btn.is-active {
  background: #7c3aed;
  color: #fff;
}

/* ─── LIST MODE ─── */
/* Board stays horizontal kanban, columns same width, only card style changes */
.leads-board.leads-board--list .leads-board__column--list .leads-board__list {
  gap: 6px;
  padding-right: 0;
}

/* Lead card in list mode — 2-line compact card */
.lead-card.lead-card--list {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 3px !important;
  padding: 7px 8px 7px 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-left: 3px solid #e2e8f0 !important;
  box-shadow: none !important;
  background: #fff !important;
  cursor: grab !important;
  min-height: unset !important;
  transition: background 0.12s !important;
}
.lead-card.lead-card--list:last-child {
  border-bottom: none !important;
}
.lead-card.lead-card--list:hover {
  background: #faf5ff !important;
}
.lead-card.lead-card--list:nth-child(even) {
  background: #fafafa !important;
}
.lead-card.lead-card--list:nth-child(even):hover {
  background: #faf5ff !important;
}

/* Stage color stripes */
.lead-card.lead-card--list[data-stage="incoming"] { border-left-color: #f59e0b !important; }
.lead-card.lead-card--list[data-stage="reserved"] { border-left-color: #f59e0b !important; }
.lead-card.lead-card--list[data-stage="arrived"]  { border-left-color: #f59e0b !important; }
.lead-card.lead-card--list[data-stage="in_rent"]  { border-left-color: #10b981 !important; }
.lead-card.lead-card--list[data-stage="overdue"]  { border-left-color: #ea580c !important; }
.lead-card.lead-card--list[data-stage="completed"]{ border-left-color: #0f766e !important; }
.lead-card.lead-card--list[data-stage="cancelled"]{ border-left-color: #f43f5e !important; }
.lead-card.lead-card--list[data-stage="rejected"] { border-left-color: #f43f5e !important; }

/* Line 1 — FIO */
.lead-card__list-fio {
  padding-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lead-card__list-fio.lead-card__title--clickable {
  color: #7c3aed;
  cursor: pointer;
}
.lead-card__list-fio.lead-card__title--clickable:hover {
  color: #6d28d9;
}

/* Line 2 — meta row: source · date · actions */
.lead-card__list-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 8px;
  min-width: 0;
}
.lead-card__list-source {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: rgba(100, 116, 139, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Цвет бейджа по источнику */
.lead-card__list-source--integration,
.lead-card__list-source--client_app {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}
.lead-card__list-source--авито,
.lead-card__list-source--avito {
  color: #0070f3;
  background: rgba(0, 112, 243, 0.10);
}
.lead-card__list-source--яндекс_про,
.lead-card__list-source--yandex {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.09);
}
.lead-card__list-source--рекомендация,
.lead-card__list-source--referral {
  color: #059669;
  background: rgba(5, 150, 105, 0.10);
}
.lead-card__list-source--мессенджер,
.lead-card__list-source--telegram,
.lead-card__list-source--whatsapp {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.10);
}
.lead-card__list-source--звонок,
.lead-card__list-source--call,
.lead-card__list-source--phone {
  color: #d97706;
  background: rgba(217, 119, 6, 0.10);
}
.lead-card__list-date {
  font-size: 10px;
  color: #c0cad6;
  white-space: nowrap;
  flex-shrink: 0;
}
.lead-card.lead-card--list .lead-card__actions {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 3px !important;
  margin-top: 0 !important;
  margin-left: auto;
  flex-wrap: nowrap;
}
.lead-card.lead-card--list .lead-card__actions button {
  padding: 2px 5px !important;
  font-size: 10px !important;
  min-height: unset !important;
  line-height: 1.3 !important;
  white-space: nowrap;
  border-radius: 5px !important;
}
/* Delete icon smaller in list mode */
.lead-card.lead-card--list .lead-delete-icon-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: unset !important;
  padding: 0 !important;
}

/* Line 3 — branch name in list mode */
.lead-card__list-branch {
  padding-left: 8px;
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* Rental button green in list mode */
.lead-card.lead-card--list .lead-card__actions .lead-card__rental-btn {
  background: #0f766e !important;
  color: #fff !important;
}
.lead-card.lead-card--list .lead-card__actions .lead-card__rental-btn:disabled {
  background: #94a3b8 !important;
  color: #fff !important;
}

/* Board mode colored left stripe by stage */
.lead-card:not(.lead-card--list)[data-stage="incoming"]  { border-left: 3px solid #f59e0b; }
.lead-card:not(.lead-card--list)[data-stage="reserved"]  { border-left: 3px solid #f59e0b; }
.lead-card:not(.lead-card--list)[data-stage="arrived"]   { border-left: 3px solid #f59e0b; }
.lead-card:not(.lead-card--list)[data-stage="in_rent"]   { border-left: 3px solid #10b981; }
.lead-card:not(.lead-card--list)[data-stage="overdue"]   { border-left: 3px solid #ea580c; }
.lead-card:not(.lead-card--list)[data-stage="completed"] { border-left: 3px solid #0f766e; }
.lead-card:not(.lead-card--list)[data-stage="cancelled"] { border-left: 3px solid #f43f5e; }
.lead-card:not(.lead-card--list)[data-stage="rejected"]  { border-left: 3px solid #f43f5e; }

/* Leads meta summary bar — colored stage labels + bigger numbers */
.leads-meta__num {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  vertical-align: baseline;
}
.leads-meta__label {
  font-weight: 700;
}
.leads-meta__label--incoming  { color: #d97706; }
.leads-meta__label--cancelled { color: #e11d48; }
.leads-meta__label--in_rent   { color: #059669; }
.leads-meta__label--overdue   { color: #ea580c; }
.leads-meta__label--completed { color: #0f766e; }
.leads-meta__label--archived  { color: #64748b; }

/* ─── "Добавить заявку" button in leads toolbar ─── */
.leads-add-new-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 10px;
  border: none;
  background: #7c3aed;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.leads-add-new-btn:hover {
  background: #6d28d9;
}

/* ─── Create lead mini modal ─── */
.leads-create-modal__body {
  padding: 20px;
  overflow-y: auto;
}

/* Device card QR image */
.device-card__qr-wrap {
  margin-bottom: 10px;
}
.device-card__qr-img {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  object-fit: contain;
}
.device-card__qr-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  text-decoration: none;
  color: #475569;
}
.device-card__qr-download:hover {
  color: #7c3aed;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Кнопка показать/скрыть пароль — иконка глаза вместо эмодзи (все темы) */
.password-eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.password-eye-btn:hover { color: #374151; border-color: #9ca3af; background: #f9fafb; }
.password-eye-btn .eye-icon { width: 18px; height: 18px; display: block; }
.pk-pass-reveal .eye-icon { width: 17px; height: 17px; display: block; }

/* Раздел «Категории устройств» — строки списка */
.device-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.device-category-row__input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 0 10px;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}
.device-category-row__input:disabled { background: rgba(241, 245, 249, 0.95); color: #334155; }
.device-category-row__remove {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.device-category-row__remove:hover { background: #fef2f2; }

/* Кабинет филиала: раздел «Настройки филиала» (бывш. «Филиалы») без колонки списка —
   форма занимает всю ширину */
.settings-section--branch-self.settings-branches-layout,
.settings-section--branch-self .settings-branches-layout {
  grid-template-columns: 1fr !important;
}
