@font-face {
  font-family: "ResortRide Inter";
  src: url("/fonts/resortride-admin-inter-v.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Фирменные шрифты для печатных бланков (логотип + подпись). */
@font-face {
  font-family: "ResortRide Playlist";
  src: url("/call/fonts/resortride-playlist-script.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ResortRide Playfair SC";
  src: url("/call/fonts/resortride-playfair-sc-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #111827;
  --surface-2: #0f172a;
  --surface-3: #0b1220;
  --line: #243244;
  --line-2: #334155;
  --line-3: #475569;
  --text: #e5e7eb;
  --text-strong: #f8fafc;
  --muted: #94a3b8;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --cyan: #38bdf8;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --red-button: #dc2626;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  --font-main: "ResortRide Inter", Inter, Arial, sans-serif;
  --font-resortride: "ResortRide Playlist", "Avenir Next", "SF Pro Display", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --font-service: "ResortRide Playfair SC", "Playfair Display SC", Georgia, "Times New Roman", serif;
  font-family: var(--font-main);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  /* Прокрутка живёт на <html> (overflow-x: clip → overflow-y: auto). Если у body
     задать overflow-y, он становится скролл-контейнером без высоты и ломает
     position: sticky у шапки и панели сохранения. Поэтому здесь overflow не задаём. */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.28;
}

/* Ничто не должно вылезать за ширину экрана (адаптив ПК/мобильный). */
*,
*::before,
*::after {
  box-sizing: border-box;
}
img,
canvas,
video {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 6px 12px;
  overflow-x: hidden;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  margin-top: 3px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

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

main {
  width: 100%;
  margin: 0;
  padding: 12px 20px 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

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

.auth-card {
  width: min(460px, 100%);
  margin: 12vh auto;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 3px;
  color: #cbd5e1;
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--surface-2);
  color: var(--text-strong);
  font-size: 14px;
  outline: none;
}

textarea {
  min-height: 58px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.24);
}

.button {
  border: 0;
  border-radius: 8px;
  min-height: 32px;
  padding: 7px 10px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 8px 18px rgba(0,0,0,.18);
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .08s ease, opacity .14s ease, filter .14s ease;
  -webkit-tap-highlight-color: transparent;
}

.button:hover:not(:disabled) {
  background: var(--blue-hover);
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 0 0 1px rgba(96,165,250,.18), 0 10px 22px rgba(0,0,0,.22);
}

.button:active:not(:disabled) {
  transform: translateY(1px) scale(.985);
  filter: brightness(.94);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.28), 0 3px 8px rgba(0,0,0,.2);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary {
  background: var(--blue);
}

.secondary {
  background: var(--line-3);
  box-shadow: inset 0 0 0 1px rgba(203,213,225,.16), 0 8px 18px rgba(0,0,0,.18);
}

.secondary:hover:not(:disabled) {
  background: #64748b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 0 0 1px rgba(203,213,225,.14), 0 10px 22px rgba(0,0,0,.22);
}

.danger {
  background: var(--red-button);
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.26), 0 8px 18px rgba(0,0,0,.18);
}

.danger:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 0 0 1px rgba(248,113,113,.2), 0 10px 22px rgba(0,0,0,.22);
}

.page-head {
  position: sticky;
  top: var(--topbar-h, 84px);
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 0;
  background: var(--bg);
}

.page-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.compact-head {
  min-height: 0;
}

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

.tenant-switch {
  min-width: 220px;
}

.admin-tabs {
  min-width: 0;
  display: none;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  overflow: hidden;
  margin: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

body.admin-ready .admin-tabs {
  display: flex;
}

.tab-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 5px 9px;
  background: var(--surface-2);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .08s ease, opacity .14s ease, filter .14s ease;
}

/* Минималистичные иконки вкладок. CSS-маска currentColor: иконка наследует цвет
   текста и тему, не ломается i18n (это псевдоэлемент, а не текст кнопки). */
.tab-button::before {
  content: "";
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-right: 6px;
  background-color: currentColor;
  -webkit-mask: var(--tab-icon) no-repeat center / contain;
  mask: var(--tab-icon) no-repeat center / contain;
  opacity: 0.8;
}
.tab-button:hover::before,
.tab-button.active::before { opacity: 1; }
.tab-button[data-admin-tab="overview"]   { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1'/><rect x='14' y='3' width='7' height='7' rx='1'/><rect x='3' y='14' width='7' height='7' rx='1'/><rect x='14' y='14' width='7' height='7' rx='1'/></svg>"); }
.tab-button[data-admin-tab="mvp"]        { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 3h6M10 3v6l-5 9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1l-5-9V3'/><path d='M7.5 14h9'/></svg>"); }
.tab-button[data-admin-tab="dispatch"]   { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 2L11 13'/><path d='M22 2l-7 20-4-9-9-4z'/></svg>"); }
.tab-button[data-admin-tab="qr"]         { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1'/><rect x='14' y='3' width='7' height='7' rx='1'/><rect x='3' y='14' width='7' height='7' rx='1'/><path d='M14 14h3v3h-3zM19 19h2M21 14v3'/></svg>"); }
.tab-button[data-admin-tab="directions"] { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21s-7-6-7-11a7 7 0 0 1 14 0c0 5-7 11-7 11z'/><circle cx='12' cy='10' r='2.5'/></svg>"); }
.tab-button[data-admin-tab="inventory"]  { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='3' width='14' height='18' rx='1'/><path d='M9 7h2M13 7h2M9 11h2M13 11h2M9 15h2M13 15h2'/></svg>"); }
.tab-button[data-admin-tab="regqr"]      { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3.5'/><path d='M3 20a6 6 0 0 1 12 0'/><path d='M18 8v6M15 11h6'/></svg>"); }
.tab-button[data-admin-tab="trips"]      { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 21l3.5-16M19 21l-3.5-16M12 8v2M12 13v2'/></svg>"); }
.tab-button[data-admin-tab="drivers"]    { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><circle cx='9' cy='11' r='2'/><path d='M6 16a3 3 0 0 1 6 0M15 10h3M15 13h3'/></svg>"); }
.tab-button[data-admin-tab="problems"]   { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l9 16H3z'/><path d='M12 10v4M12 16.5v.5'/></svg>"); }
.tab-button[data-admin-tab="journal"]    { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01'/></svg>"); }
.tab-button[data-admin-tab="audit"]      { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z'/><path d='M9 12l2 2 4-4'/></svg>"); }
.tab-button[data-admin-tab="settings"]   { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1l2.1-2.1M17 7l2.1-2.1'/></svg>"); }
.tab-button[data-admin-tab="team"]       { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3'/><path d='M3 20a6 6 0 0 1 12 0'/><path d='M16 5.5a3 3 0 0 1 0 5M21 20a6 6 0 0 0-4-5.7'/></svg>"); }
.tab-button[data-admin-tab="tenants"]    { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l9 5-9 5-9-5z'/><path d='M3 13l9 5 9-5'/></svg>"); }
.tab-button[data-admin-tab="clients"]    { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='3' width='16' height='18' rx='2'/><circle cx='12' cy='10' r='2.5'/><path d='M8 17a4 4 0 0 1 8 0'/></svg>"); }
.tab-button[data-admin-tab="backup"]     { --tab-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><ellipse cx='12' cy='5' rx='8' ry='3'/><path d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5'/><path d='M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/></svg>"); }

.tab-button:hover:not(:disabled) {
  border-color: var(--line-3);
  background: #1f2937;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 0 0 1px rgba(96,165,250,.12);
}

.tab-button:active:not(:disabled) {
  transform: translateY(1px) scale(.99);
  filter: brightness(.94);
}

.tab-button.active {
  border-color: var(--cyan);
  background: #0f2f4a;
  color: #fff;
  box-shadow: 0 0 18px rgba(56,189,248,.28), inset 0 0 0 1px rgba(125,211,252,.14);
}

.tab-panel {
  min-width: 0;
  min-height: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stat-card {
  padding: 10px 14px;
}

.stat-card span {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 23px;
}

.compact-stat {
  padding: 9px 12px;
}

.compact-stat strong {
  font-size: 21px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 10px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.overview-grid .panel.wide {
  grid-column: span 2;
}

.scenario-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(360px, 1fr);
  gap: 8px;
  align-items: start;
}

/* Один столбец на всю ширину: карточкам водителей нужно место (шапка + 4 столбца
   мета + кнопки), иначе текст вылезает за блок. */
.drivers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.tenant-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(460px, 1fr);
  gap: 10px;
  align-items: start;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1fr);
  gap: 10px;
  align-items: start;
}

@media (max-width: 900px) {
  .team-layout {
    grid-template-columns: 1fr;
  }
}

.summary-list {
  display: grid;
  gap: 6px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--surface-2);
}

.summary-row span {
  min-width: 0;
  color: var(--muted);
}

.summary-row strong {
  text-align: right;
  white-space: nowrap;
}

.scenario-ok {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(34,197,94,.14);
}

.scenario-warn {
  border-color: var(--yellow);
  box-shadow: 0 0 16px rgba(245,158,11,.14);
}

.mvp-panel {
  margin-bottom: 10px;
}

.mvp-grid {
  align-items: start;
}

.mvp-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}

.mvp-metric {
  min-height: 66px;
  padding: 10px 12px;
}

.mvp-metric em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.mvp-checks {
  display: grid;
  gap: 6px;
}

.mvp-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.78);
}

.mvp-check-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mvp-check-row strong {
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.15;
}

.mvp-check-row span {
  color: var(--muted);
  font-size: 13px;
}

.mvp-check-row small {
  color: #cbd5e1;
  font-size: 12px;
}

.mvp-check-row--ok {
  border-color: rgba(34, 197, 94, 0.7);
}

.mvp-check-row--warn {
  border-color: rgba(245, 158, 11, 0.75);
}

.mvp-check-row--bad {
  border-color: rgba(239, 68, 68, 0.82);
}

.mvp-hint {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.78);
  color: #fde68a;
  font-size: 13px;
}

.mvp-hint-ok {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.7);
}

.dispatch-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.65fr) minmax(360px, 1fr);
  gap: 10px;
  align-items: start;
}

.dispatch-form {
  display: grid;
  gap: 8px;
}

.section-subtitle {
  margin: 0 0 8px;
  font-size: 14px;
}

.qr-settings-panel,
.settings-panel {
  margin-bottom: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) max-content max-content;
  align-items: end;
  gap: 8px;
}

.settings-toolbar {
  position: sticky;
  top: calc(var(--topbar-h, 84px) + var(--pagehead-h, 52px));
  z-index: 24;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.72);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(17, 24, 39, 0.92));
  backdrop-filter: blur(12px);
}

.settings-toolbar .message {
  min-height: 0;
  margin: 0;
}

.settings-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.settings-groups {
  border-top: 1px solid var(--line-2);
}

.settingsGroup {
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}

.settings-copy h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.15;
}

.settings-copy p {
  max-width: 240px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.settingsFields {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px 14px;
  align-items: start;
}

.settingsFields label {
  position: relative;
  min-width: 0;
  margin: 0;
  padding-right: 30px;
}

.settingsHelpIcon {
  position: absolute;
  top: -1px;
  right: 0;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(56, 189, 248, 0.65);
  border-radius: 50%;
  color: #bfdbfe;
  background: rgba(14, 116, 144, 0.28);
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  cursor: help;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.24);
}

.settingsHelpIcon:hover,
.settingsHelpIcon:focus {
  outline: none;
  z-index: 60;
  border-color: var(--cyan);
  color: #fff;
  background: #123a5b;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.3);
}

.settingsHelpIcon::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  z-index: 60;
  width: min(340px, 78vw);
  padding: 10px 11px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  background: #020617;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45), 0 0 18px rgba(56, 189, 248, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}

.settingsHelpIcon:hover::after,
.settingsHelpIcon:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settingsFields input,
.settingsFields select {
  min-height: 38px;
  margin-top: 6px;
  padding: 8px 10px;
}

.settingsFields small {
  display: block;
  min-height: 30px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.25;
}

.settingsFields .wide {
  grid-column: 1 / -1;
}

.settingsFields .check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(2, 6, 23, 0.28);
}

.settingsFields .check input {
  min-height: auto;
  margin: 0;
}

/* === Чекбоксы настроек: компактные «пилюли» слева, а не на всю ширину === */
.settingsFields .check,
.settingsFields .check-row {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  justify-content: flex-start;
  gap: 7px;
  padding-right: 10px;
}

/* Длинные чекбоксы — на своей строке, но контент компактный и прижат влево */
.settingsFields .check.wide,
.settingsFields .check-row.wide {
  grid-column: 1 / -1;
}

/* Встроенную подсказку в чекбоксе прячем — текст доступен по «?» */
.settingsFields .check > small,
.settingsFields .check-row > small {
  display: none;
}

/* «?» внутри чекбокса — встроенная иконка сразу после подписи, без угла */
.settingsFields .check .settingsHelpIcon,
.settingsFields .check-row .settingsHelpIcon {
  position: relative;
  top: auto;
  right: auto;
  flex: none;
  margin-left: 1px;
}

/* Аккуратный чекбокс в цвет темы */
.settingsFields .check input[type="checkbox"],
.settingsFields .check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.settingsFields .notice {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.35);
}

.settings-block {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  padding: 10px;
}

.settings-block h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.15;
}

.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 8px;
}

.settings-fields label {
  min-width: 0;
}

.settings-fields input,
.settings-fields select {
  min-height: 34px;
  padding: 7px 10px;
}

.compact-check {
  min-height: 34px;
  align-self: end;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(2, 6, 23, 0.28);
}

.link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line-3);
  border-radius: 8px;
  padding: 7px 10px;
  color: #e0f2fe;
  background: #0f2f4a;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.link-pill:hover {
  border-color: var(--cyan);
  background: #123a5b;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 0 0 1px rgba(56,189,248,.18);
}

.admin-editor-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(360px, 1fr);
  gap: 10px;
  align-items: start;
}

.editor-form {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  padding: 10px 12px;
}

.editor-form h3 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 17px;
}

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

.wide-field {
  grid-column: span 2;
}

.check-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--surface-2);
}

.check-row input {
  width: auto;
  min-height: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.compact-actions {
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
}

.panel {
  min-width: 0;
  padding: 12px 16px;
}

.panel.wide {
  grid-column: span 2;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-title h2 {
  color: var(--text-strong);
  font-size: 20px;
}

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

.location-card,
.list-row,
.timeline-item {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
}

/* Подсветка буксующих заказов диспетчеру. */
.order-row.has-problem {
  border-color: var(--yellow);
  box-shadow: inset 3px 0 0 0 var(--yellow);
}

.order-problems {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 11px 9px;
}

.problem-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.problem-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 7px 11px;
  margin-bottom: 8px;
}

.location-card {
  display: grid;
  gap: 7px;
  padding: 9px 11px;
}

.location-card label {
  margin-top: 2px;
}

.location-card header,
.list-row header,
.timeline-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.title {
  font-weight: 800;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.15;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.meta {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
}

.meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 14px;
}

.meta strong {
  color: var(--text);
}

.driver-row-disabled {
  opacity: 0.78;
}

.driver-row,
.application-row {
  grid-template-columns: minmax(240px, 0.78fr) minmax(520px, 1.45fr) max-content;
  align-items: center;
  padding: 6px 10px;
}

.driver-row header,
.application-row header {
  align-items: center;
}

.driver-row .meta-grid,
.application-row .meta-grid {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 1px 12px;
}

/* Длинные значения (GPS, «Последняя связь») переносятся внутри карточки, не вылезают. */
.driver-row > *,
.application-row > * { min-width: 0; }
.driver-row .meta-grid span,
.application-row .meta-grid span { overflow-wrap: anywhere; }

.driver-row .actions {
  align-self: center;
  justify-content: flex-end;
  gap: 5px;
}

.driver-row .button,
.application-row .button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 13px;
}

.driver-delete-button {
  background: #991b1b;
}

.driver-delete-button:hover:not(:disabled) {
  background: #7f1d1d;
}

.compact-list,
.timeline {
  display: grid;
  gap: 6px;
}

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

/* Шапка-таблица больше не нужна — клиенты выводятся карточками. */
.clients-table-head {
  display: none;
}

/* Глобальная база клиентов (superadmin) — компактная таблица всех отелей. */
.gclients-table {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.gclients-head,
.gclients-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.1fr 1fr 0.8fr 1fr 1.2fr;
  gap: 8px;
  padding: 7px 9px;
  align-items: center;
  font-size: 13px;
}
.gclients-head {
  font-weight: 600;
  color: var(--muted, #94a3b8);
  border-bottom: 1px solid var(--line-2);
}
.gclients-row {
  border-bottom: 1px solid var(--line-2);
}
.gclients-row:hover {
  background: rgba(255, 255, 255, 0.02);
}
@media (max-width: 980px) {
  .gclients-head {
    display: none;
  }
  .gclients-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 2px;
  }
}

/* Карточка клиента — аккуратная, читаемая, дружелюбная. */
.client-card,
.empty-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, rgba(15, 23, 42, 0.6));
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.3;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.client-card:hover {
  border-color: rgba(94, 177, 255, 0.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}

.client-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.client-card-id {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.client-card-id strong {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.client-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  color: var(--muted);
  font-size: 12px;
}

.client-card-meta span {
  position: relative;
}

.client-card-meta span:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: -8px;
  color: var(--line);
}

.client-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.client-ban-status .badge {
  white-space: nowrap;
}

.client-ban-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* Блок «Блокировка» в карточке клиента */
.client-ban-section {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.client-ban-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 8px;
}
.client-ban-block {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-left: 4px solid var(--yellow);
  background: rgba(245, 158, 11, 0.10);
}
.client-ban-block.ban-perm {
  border-left-color: var(--red, #ef4444);
  background: rgba(239, 68, 68, 0.10);
}
.client-ban-block-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-strong);
}
.ban-block-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}
.ban-block-k {
  min-width: 96px;
  color: var(--muted);
}
.client-ban-section .client-ban-actions {
  justify-content: flex-start;
}

/* Клиентская база: тулбар (поиск + фильтры) и компактные строки с раскрытием */
.clients-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.clients-search {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
}
.clients-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.filter-chip:hover { border-color: #3b82f6; color: var(--text); }
.filter-chip.active { background: rgba(59, 130, 246, 0.16); border-color: #3b82f6; color: var(--text-strong); }
.filter-chip .chip-count { opacity: 0.65; font-variant-numeric: tabular-nums; }

.client-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--surface);
  overflow: hidden;
}
.client-row--inactive { opacity: 0.72; }
.client-row-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  min-height: 44px;
}
.client-row-line:hover { background: rgba(59, 130, 246, 0.06); }
.client-row.open .client-row-line { border-bottom: 1px dashed var(--line); }
.client-row-chevron { color: var(--muted); font-size: 12px; width: 12px; }
.client-row-name { font-size: 14px; color: var(--text-strong); }
.client-row-phone { font-size: 13px; }
.client-row-tags { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.crow-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.crow-room { color: var(--text-strong); border-color: rgba(59, 130, 246, 0.5); }
.crow-stay-ok { color: var(--green); border-color: rgba(16, 185, 129, 0.4); }
.crow-stay-warn { color: var(--yellow); border-color: rgba(245, 158, 11, 0.4); }
.crow-stay-bad, .crow-ban { color: #f87171; border-color: rgba(239, 68, 68, 0.45); }
.client-row-details { padding: 12px 14px 14px; }

/* Кликабельный заказ -> модал с подробным логом */
.order-clickable { cursor: pointer; transition: border-color .15s, background .15s; }
.order-clickable:hover { border-color: #3b82f6; background: rgba(59, 130, 246, 0.06); }
.trace-open-mark { font-size: 12px; opacity: 0.5; }

.trace-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.trace-modal.hidden { display: none; }
.trace-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.trace-modal-card {
  position: relative; z-index: 1; width: min(760px, 94vw); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); overflow: hidden;
}
.trace-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.trace-modal-title { font-weight: 700; font-size: 15px; color: var(--text-strong); }
.trace-modal-body { padding: 16px 18px; overflow-y: auto; }
.trace-summary {
  display: flex; flex-wrap: wrap; gap: 14px; padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--line); font-size: 13px; color: var(--muted);
}
.trace-timeline { display: flex; flex-direction: column; }

/* Карта маршрута поездки в трейсе заказа (#24) */
.trace-map {
  height: 300px;
  border-radius: 10px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid rgba(120, 140, 170, 0.25);
}
.trace-map.hidden { display: none; }
.trace-map .maplibregl-ctrl-attrib { font-size: 9px; }

/* Map Studio (#23): редактор карты территории отеля */
.hm-map {
  height: 62vh;
  min-height: 380px;
  border-radius: 12px;
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid rgba(120, 140, 170, 0.25);
}
.hm-toolbar,
.hm-props {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}
.hm-props input,
.hm-props select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(120, 140, 170, 0.35);
  background: #131c2e;
  color: #e8edf4;
}
/* Выпадающие списки: браузер рисует опции своим белым фоном, а текст
   наследуется светлым — задаём цвета явно, иначе пункты «невидимы». */
.hm-props select option,
.hm-props select optgroup {
  background: #131c2e;
  color: #e8edf4;
}
.hm-props select optgroup { font-weight: 700; color: #9fb3cd; }
.hm-props .wide { flex-basis: 100%; }
.hm-toolbar input[type="text"],
.hm-toolbar #hmSearch {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(120, 140, 170, 0.35);
  background: #131c2e;
  color: #e8edf4;
}
.reg-ban-btn { color: #ff8a80; border-color: rgba(255, 138, 128, 0.5); }

/* Полная инструкция Map Studio под картой */
.hm-manual {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(120, 140, 170, 0.22);
  border-radius: 12px;
  background: rgba(120, 140, 170, 0.06);
}
.hm-manual h3 { margin: 0 0 10px; font-size: 16px; }
.hm-manual h4 { margin: 12px 0 6px; font-size: 13.5px; color: #9fb3cd; }
.hm-manual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 26px;
}
@media (max-width: 900px) { .hm-manual-grid { grid-template-columns: 1fr; } }
.hm-manual ul { margin: 0; padding-left: 18px; }
.hm-manual li { margin-bottom: 6px; font-size: 13px; line-height: 1.5; }
.trace-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.10); }
.trace-time { min-width: 88px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trace-line { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.trace-actor {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; align-self: flex-start;
  padding: 1px 7px; border-radius: 6px;
}
.trace-actor-client { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
.trace-actor-server { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.trace-actor-driver { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.trace-actor-system { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.trace-msg { font-size: 13px; line-height: 1.45; color: var(--text); }

.client-action {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.05;
}

/* Приглашённые (семья) внутри карточки хозяина */
.client-family {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(94, 177, 255, 0.06);
  border: 1px solid rgba(94, 177, 255, 0.18);
}
.client-family-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.family-member {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 4px 0;
  font-size: 12.5px;
}
.family-member + .family-member {
  border-top: 1px dashed var(--line);
}
.family-member-name { font-weight: 600; }
.family-member-phone { color: var(--muted); }
.family-member-state {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
}
.family-member.is-active .family-member-state {
  color: var(--green);
  background: rgba(34, 197, 94, 0.12);
}
.family-member.is-inactive {
  opacity: 0.6;
}
.family-member.is-inactive .family-member-state {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.14);
}

/* Журнал поездок в карточке */
.client-trips {
  margin-top: 10px;
  font-size: 12.5px;
}
.client-trips > summary {
  cursor: pointer;
  color: var(--blue, #60a5fa);
  font-weight: 600;
  list-style: none;
}
.client-trips[open] > summary { margin-bottom: 6px; }
.client-trips-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trip-row {
  display: flex;
  gap: 6px 12px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.trip-row .trip-who { font-weight: 600; min-width: 80px; }
.trip-row .trip-route { color: var(--text); flex: 1; min-width: 140px; }
.trip-row .trip-when { color: var(--muted); font-size: 11px; }
.trip-row .trip-cost.paid { color: var(--yellow); font-weight: 700; }
.trip-row .trip-cost.free { color: var(--muted); }

.client-delete-action {
  background: #991b1b;
}

.client-delete-action:hover:not(:disabled) {
  background: #7f1d1d;
}

.empty-row {
  color: var(--muted);
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr) auto;
  align-items: start;
  gap: 4px 14px;
}

.list-row > header {
  min-width: 0;
}

.list-row > .meta {
  min-width: 0;
}

.list-row > .actions {
  grid-column: 1 / -1;
  align-self: start;
  justify-content: flex-start;
  flex-wrap: wrap;
  min-width: 0;
  margin-top: 2px;
}

.qr-location-row {
  grid-template-columns: minmax(0, 1fr);
}

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

.qr-url-field {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.qr-row-actions {
  min-width: 0;
  flex-wrap: wrap;
}

.list-row,
.timeline-item {
  padding: 8px 11px;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1fr);
  gap: 4px;
}

.timeline-item > header {
  min-width: 0;
}

.timeline-item > .meta {
  min-width: 0;
}

.timeline-item > .meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 14px;
}

.journal-tech-meta {
  color: #9fb5d1;
}

.journal-tech-meta strong {
  color: #d8e7fb;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.65);
}

.badge-ok {
  color: #bbf7d0;
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(34,197,94,.28);
}

.badge-warn {
  color: #fde68a;
  border-color: var(--yellow);
  box-shadow: 0 0 18px rgba(245,158,11,.24);
}

.badge-bad {
  color: #fecaca;
  border-color: var(--red);
  box-shadow: 0 0 18px rgba(239,68,68,.28);
}

.badge-info {
  color: #bae6fd;
  border-color: var(--cyan);
}

.badge-muted {
  color: var(--muted);
  border-color: var(--line-3);
}

.message {
  min-height: 18px;
  margin-top: 8px;
  color: var(--yellow);
}

.toast {
  position: fixed;
  right: 16px;
  top: 74px;
  bottom: auto;
  z-index: 90;
  max-width: 460px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(15,23,42,.98);
  color: #cbd5e1;
  box-shadow: 0 18px 44px rgba(0,0,0,.42);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  min-height: 32px;
}

.pager-info {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.print-root {
  display: none;
}

.qr-print-sheet {
  display: grid;
  justify-items: center;
  gap: 8mm;
  width: 100%;
  color: #101418;
  background: #fff;
  text-align: center;
}

.qr-print-sheet h1 {
  margin: 0;
  color: #101418;
  font-size: 26pt;
  line-height: 1.08;
}

.qr-print-code {
  width: 112mm;
  max-width: 100%;
  aspect-ratio: 1;
}

.qr-print-meta {
  display: grid;
  gap: 3mm;
  width: 100%;
  color: #344054;
  font-size: 12pt;
  text-align: left;
}

.qr-print-meta strong {
  color: #101418;
}

.qr-print-url {
  overflow-wrap: anywhere;
  color: #475467;
  font-size: 10pt;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body.printing-qr {
    background: #fff !important;
  }

  body.printing-qr > *:not(.print-root) {
    display: none !important;
  }

  body.printing-qr .print-root {
    display: block !important;
  }
}

@media (max-width: 980px) {
  .stats-grid,
  .content-grid,
  .overview-grid,
  .scenario-grid,
  .mvp-summary-grid,
  .mvp-check-row,
  .dispatch-grid,
  .settings-grid,
  .settings-sections,
  .admin-editor-grid,
  .drivers-grid,
  .tenant-layout,
  .clients-table-head,
  .client-table-row,
  .list-row,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .clients-table-head {
    display: none;
  }

  .client-ban-actions {
    justify-content: flex-start;
  }

  .list-row > .actions {
    align-self: start;
  }

  .settingsGroup,
  .settingsFields {
    grid-template-columns: 1fr;
  }

  .settings-copy p {
    max-width: none;
  }

  .drivers-grid .panel:nth-child(3) {
    grid-column: auto;
  }

  .panel.wide {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  main {
    width: 100%;
    margin: 0;
    padding: 14px 10px 18px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions {
    align-items: stretch;
    justify-content: stretch;
  }

  .pager {
    align-items: stretch;
    justify-content: flex-start;
  }

  .tenant-switch {
    min-width: 0;
  }

  .session {
    justify-content: flex-start;
  }

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

  .settings-fields,
  .settingsFields {
    grid-template-columns: 1fr;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .driver-row .meta-grid,
  .application-row .meta-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }
}

/* ======================= SaaS: вход, онбординг, квоты ======================= */

/* OAuth-кнопки и разделитель на экране входа */
.oauth-buttons {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
}

.oauth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 13px;
}

.oauth-google {
  background: #ffffff;
  color: #1f2937;
}

.oauth-google .oauth-icon {
  background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.oauth-google:hover:not(:disabled) {
  background: #f1f5f9;
  color: #111827;
}

.oauth-apple {
  background: #000000;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.oauth-apple .oauth-icon {
  font-size: 16px;
}

.oauth-apple:hover:not(:disabled) {
  background: #1f2937;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Оверлей мастера онбординга */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 14px;
  overflow-y: auto;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(6px);
}

.onboarding-overlay.hidden {
  display: none;
}

.onboarding-card {
  width: min(880px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  padding: 22px;
}

.onboarding-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.onboarding-brand {
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 12px;
  text-transform: uppercase;
}

.onboarding-head h1 {
  margin: 2px 0 0;
  font-size: 22px;
  color: var(--text-strong);
}

.onboarding-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-steps {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 18px 0;
  padding: 0;
  flex-wrap: wrap;
}

.onboarding-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.onboarding-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  font-size: 12px;
}

.onboarding-steps li.active {
  border-color: var(--blue);
  color: var(--text-strong);
}

.onboarding-steps li.active span {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.onboarding-steps li.done {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.5);
}

.onboarding-steps li.done span {
  background: var(--green);
  border-color: var(--green);
  color: #04210f;
}

.onboarding-step.hidden {
  display: none;
}

.onboarding-lead {
  color: var(--muted);
  margin: 0 0 14px;
}

.onboarding-form {
  display: grid;
  gap: 12px;
  max-width: 460px;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

/* Карточки тарифов */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.plan-card {
  position: relative;
  text-align: left;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.14s ease, transform 0.08s ease, box-shadow 0.14s ease;
}

.plan-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--line-3);
  background: var(--surface-2);
  filter: none;
}

.plan-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4);
}

.plan-card.recommended {
  border-color: rgba(56, 189, 248, 0.5);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cyan);
  color: #042330;
  font-size: 11px;
  font-weight: 800;
}

.plan-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-strong);
}

.plan-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--cyan);
}

.plan-price span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

.plan-desc {
  color: var(--muted);
  font-size: 12px;
}

.plan-features {
  margin: 4px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 3px;
  font-size: 12px;
}

.plan-limits {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.plan-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.plan-counts small {
  color: var(--muted);
}

.plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
}

.plan-summary-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--cyan);
}

.plan-summary-price span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

/* Способы оплаты */
.payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
}

.payment-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--line-3);
  filter: none;
}

.payment-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4);
}

.payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  flex: none;
}

.payment-payme { background: #33b6ff; }
.payment-click { background: #16b364; }
.payment-card-icon,
.payment-card .payment-card { background: var(--line-3); }
.payment-icon.payment-card { background: var(--line-3); }

.payment-body {
  display: grid;
  gap: 2px;
}

.payment-name {
  font-weight: 700;
  color: var(--text-strong);
}

.payment-desc {
  font-size: 12px;
  color: var(--muted);
}

/* Бейджи квот на вкладках QR / Водители */
.quota-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line-2);
}

.quota-badge.hidden {
  display: none;
}

.quota-ok {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.quota-full {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
}

/* Провижен готовых аккаунтов */
.provision-form {
  border-color: rgba(56, 189, 248, 0.35);
}

.wide-form {
  grid-column: 1 / -1;
}

.provision-result {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
  font-size: 13px;
}

.provision-result.hidden {
  display: none;
}

.provision-result code {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 6px;
}

.provision-cred {
  color: var(--yellow);
}

.meta-wide {
  grid-column: 1 / -1;
}

/* Переключатель языка */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lang-select {
  width: auto;
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line-2);
}

.onboarding-account .lang-select {
  min-height: 32px;
}

/* Профиль объекта — сводка по тарифу */
.profile-panel .editor-form {
  margin-top: 10px;
}

.profile-plan-info {
  margin-top: 12px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
  font-size: 13px;
}

.profile-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-plan-row span {
  color: var(--muted);
}

/* Код отеля для регистрации водителей — выделяем крупно. */
.profile-join-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  padding: 10px 14px;
  border: 1px solid rgba(94, 177, 255, 0.45);
  border-radius: 10px;
  background: rgba(94, 177, 255, 0.1);
}
.profile-join-code > span:first-child {
  color: var(--muted);
}
.profile-join-code strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text, #e8f0fb);
}

/* QR регистрации отеля */
.regqr-body {
  margin-top: 10px;
}

.regqr-card {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.regqr-img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.regqr-info {
  display: grid;
  gap: 10px;
}

.regqr-slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

.regqr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Регистрации / проживание */
.reg-assign {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.reg-assign label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.reg-assign select,
.reg-assign input {
  min-height: 34px;
}

.client-table-row.client-awaiting {
  outline: 1px solid rgba(234, 179, 8, 0.6);
  border-radius: 8px;
}

/* Даты заезда/выезда в карточке клиента */
.client-stay-dates {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* Инлайн-форма редактирования клиента */
.client-edit-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--cyan);
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
}
.client-edit-form label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}
.client-edit-form input,
.client-edit-form select {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-3, rgba(15, 23, 42, 0.5));
  color: var(--text);
}
.client-edit-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

/* Чекбокс автоперевода под полями названий */
.autotranslate-row {
  grid-column: 1 / -1;
}

/* Компактная узкая форма заселения в строке клиента. */
.client-reassign {
  margin-top: 6px;
  gap: 5px;
  max-width: 180px;
  margin-left: auto;
  align-items: stretch;
}
.client-reassign label {
  font-size: 10px;
  gap: 2px;
  width: 100%;
}
.client-reassign select,
.client-reassign input {
  width: 100%;
  max-width: 180px;
  min-height: 30px;
  box-sizing: border-box;
  font-size: 12px;
  padding: 4px 6px;
}
.client-reassign button {
  width: 100%;
  margin-top: 2px;
}

.client-stay {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
}

.client-stay-ok { color: var(--green); }
.client-stay-warn { color: var(--yellow); }
.client-stay-muted { color: var(--muted); }

/* Статус доступа сотрудника (Команда) */
.access-state { font-weight: 700; }
.access-state.access-ok { color: var(--green); }
.access-state.access-bad { color: var(--red); }

/* Поиск в аудите */
.audit-search {
  width: 100%;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-3, var(--surface));
  color: var(--text);
  font-size: 14px;
}
.audit-actor strong { color: var(--text); }
.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.audit-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.audit-filters .button.is-active {
  background: var(--blue, #2563eb);
  border-color: var(--blue, #2563eb);
  color: #fff;
}
.client-stay-bad {
  color: #fff;
  background: var(--red);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Выселен / срок проживания истёк — карточку видно сразу. */
.client-card--inactive {
  border-color: rgba(239, 68, 68, 0.5);
  border-left: 4px solid var(--red);
  background: rgba(239, 68, 68, 0.07);
}

/* Платные поездки (начисления на счета номеров) */
.charges-summary {
  margin-bottom: 12px;
}
.charges-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.charges-total > strong {
  font-size: 18px;
  color: var(--yellow);
}
.charges-total > .sub {
  color: var(--muted);
  font-size: 12px;
}
/* Кликабельные карточки номеров (поиск/выбор → подробный отчёт ниже) */
.charges-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.charges-room-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.34);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.charges-room-card:hover {
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(245, 158, 11, 0.16);
}
.charges-room-card:active {
  transform: scale(0.99);
}
.charges-room-card.is-selected {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.14);
  box-shadow: inset 0 0 0 1px var(--cyan);
}
.crc-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.crc-room {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.2px;
}
.crc-room-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}
.crc-sum {
  font-size: 15px;
  font-weight: 700;
  color: var(--yellow);
  white-space: nowrap;
}
.crc-meta {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.crc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.crc-count {
  font-size: 11px;
  color: var(--muted);
}
.charges-room-card .charges-settle {
  margin: 0;
}
/* Поиск по журналу */
.charges-search {
  width: 100%;
  margin: 10px 0;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-strong, rgba(15,23,42,0.5));
  color: var(--text);
  font-size: 13px;
}
/* Узкие компактные карточки журнала */
.charges-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.charge-row {
  padding: 8px 12px;
}
.charge-row .title {
  font-weight: 600;
  font-size: 13px;
}
.charge-row .charge-rider {
  color: var(--text);
  font-weight: 500;
}
.charges-settle {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--green);
  background: transparent;
  color: var(--green);
  font-size: 11px;
  cursor: pointer;
}
.charges-settle:hover {
  background: rgba(34, 197, 94, 0.12);
}
.charges-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.charges-shared-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

/* Подробный отчёт по выбранному номеру */
.charges-report-hint {
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.charges-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.charges-report-title {
  margin: 0 0 4px;
  font-size: 17px;
}
.charges-report-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 13px;
}
.charges-report-totals .crt-due strong {
  color: var(--yellow);
  font-size: 15px;
}
.charges-report-totals .crt-paid {
  color: var(--muted);
}
.charges-print-btn {
  white-space: nowrap;
}
.charges-report-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== Фирменные печатные бланки (отчёт по поездкам + QR регистрации) ===== */
.print-brand {
  text-align: center;
  margin-bottom: 6mm;
}
.print-wordmark {
  font-family: var(--font-resortride, "Avenir Next", "Trebuchet MS", sans-serif);
  font-size: 40pt;
  line-height: 1;
  color: #0b2a4a;
}
.print-service {
  font-family: var(--font-service, "Playfair Display SC", Georgia, serif);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11pt;
  font-weight: 700;
  color: #475467;
  margin-top: 2mm;
}
.print-hotel {
  font-size: 15pt;
  font-weight: 700;
  color: #101418;
  margin-top: 2mm;
}
.report-print-sheet,
.regqr-print-sheet {
  color: #101418;
  background: #fff;
  width: 100%;
}
.report-print-title,
.regqr-print-title {
  margin: 0 0 4mm;
  text-align: center;
  font-size: 18pt;
}
.report-print-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2mm 8mm;
  margin-bottom: 4mm;
  font-size: 11pt;
  color: #344054;
}
.report-print-meta strong {
  color: #101418;
}
.report-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5pt;
}
.report-print-table th,
.report-print-table td {
  border: 1px solid #c7ccd4;
  padding: 2mm 3mm;
  text-align: left;
  vertical-align: top;
}
.report-print-table th {
  background: #f1f4f9;
  font-weight: 700;
}
.report-print-table .rpt-amount {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}
.report-print-table .rpt-phone {
  color: #667085;
  font-size: 9.5pt;
}
.report-print-table .rpt-share {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid #6366f1;
  color: #4f46e5;
  font-size: 8.5pt;
  font-weight: 700;
}
.report-print-total {
  margin-top: 5mm;
  text-align: right;
  font-size: 13pt;
}
.report-print-total strong {
  font-size: 16pt;
}
.report-print-total .rpt-paid-total {
  display: block;
  margin-top: 1mm;
  font-size: 11pt;
  color: #667085;
}
.regqr-print-sheet {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 4mm;
}
.regqr-print-hint {
  margin: 0;
  font-size: 12pt;
  color: #344054;
  max-width: 130mm;
}
.regqr-print-steps {
  margin: 0;
  font-size: 11pt;
  color: #475467;
  max-width: 130mm;
}
.regqr-print-url {
  overflow-wrap: anywhere;
  color: #475467;
  font-size: 9.5pt;
}

/* ===== Резервные копии отеля (вкладка Бэкап) ===== */
.backup-create,
.backup-settings-actions,
.backup-restore-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.backup-create {
  flex-direction: column;
  align-items: flex-start;
}
.backup-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.backup-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.backup-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}
.backup-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}
.backup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.backup-field select,
.backup-field input {
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-3, rgba(15, 23, 42, 0.5));
  color: var(--text);
  font-size: 14px;
}
.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3, rgba(15, 23, 42, 0.4));
}
.backup-row-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.backup-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.backup-row-actions .button {
  padding: 6px 12px;
  font-size: 13px;
}
/* Кастомный выбор файла: нативную кнопку прячем (её текст зависит от локали
   браузера и не переводится), показываем свою локализованную подпись. */
.file-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 240px;
  min-width: 0;
}
.file-pick input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.file-pick .button {
  cursor: pointer;
  flex: 0 0 auto;
}
.file-pick .file-name {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Техподдержка (Настройки) + подсветка объектов с подключённой поддержкой (Объекты) */
.support-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.support-panel #supportMeta {
  margin-top: 4px;
}
.list-row.tenant-support-on {
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}
.readonly-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--yellow);
  border-radius: 10px;
  background: color-mix(in srgb, var(--yellow) 14%, transparent);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

/* «Код входа» гостя (без местного номера/Telegram) */
.checkin-code-box {
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  font-size: 13px;
}
.checkin-code {
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--text-strong);
  margin: 0 8px;
  font-variant-numeric: tabular-nums;
}
.checkin-code-box .sub { display: block; margin-top: 4px; }

/* Полноэкранный предпросмотр Map Studio */
.hm-preview-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: #0d1420;
}
.hm-preview-modal.hidden { display: none; }
.hm-preview-map { position: absolute; inset: 0; }
.hm-preview-close {
  position: absolute; top: 14px; right: 14px; z-index: 1001;
}

.hm-preview-debug {
  position: absolute; left: 14px; top: 14px; z-index: 1001;
  max-width: 480px; padding: 10px 12px; border-radius: 10px;
  background: rgba(10, 16, 28, 0.85); color: #cfe0f5;
  font: 12px/1.5 monospace; white-space: pre-wrap;
}
.hm-preview-debug:empty { display: none; }

/* Форма «Добавить гостя» */
.addclient-form { display: flex; flex-direction: column; gap: 12px; }
.addclient-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #9fb3cd; }
.addclient-form input, .addclient-form select {
  background: #101827; color: #e8eefc; border: 1px solid #26334a;
  border-radius: 8px; padding: 9px 11px; font-size: 14px;
}
.addclient-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.addclient-error { color: var(--red, #f87171); font-size: 13px; }
.addclient-error.hidden { display: none; }
