﻿* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f6f9;
  --sidebar-bg: #1e2536;
  --sidebar-text: #b8c0d4;
  --sidebar-active: #2f3b57;
  --card-bg: #ffffff;
  --border: #e3e7ee;
  --text: #1a2233;
  --text-muted: #6b7486;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green: #16a34a;
  --orange: #d97706;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --radius: 10px;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

/* ---------- Переключатель языка ---------- */
.lang-switcher {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.lang-btn {
  flex: 1;
  background: #262f47;
  border: 1px solid #3a4560;
  color: var(--sidebar-text);
  padding: 6px 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lang-btn:hover { background: #2f3b57; }
.lang-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.lang-switcher-login {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 150px;
}

/* ---------- Логин ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2536, #2f3b57);
}

.login-card {
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius);
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}

.login-logo { font-size: 42px; margin-bottom: 8px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.login-card label {
  display: block;
  text-align: left;
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 4px;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.login-card .btn { margin-top: 20px; }

.error-text {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 16px;
}

/* ---------- Кнопки ---------- */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-block { width: 100%; }
.btn-secondary { background: #eef1f6; color: var(--text); }
.btn-secondary:hover { background: #e2e6ee; }
.btn-danger { background: #fde8e8; color: var(--red); }
.btn-small { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

.btn-logout {
  background: transparent;
  border: 1px solid #3a4560;
  color: var(--sidebar-text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  width: 100%;
}
.btn-logout:hover { background: #2f3b57; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-bottom: 24px;
  padding: 0 8px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.nav-item .notification-badge { position: static; margin-left: 6px; }
.nav-item:hover { background: #262f47; }
.nav-item.active { background: var(--sidebar-active); color: white; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid #2f3b57; }
.employee-name { color: white; font-size: 13px; margin-bottom: 8px; }

.location-switcher {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: linear-gradient(155deg, #2a3350, #232b42);
  border: 1px solid #3a4560;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 6px rgba(0,0,0,0.15);
}
.location-switcher label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sidebar-text);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.location-switcher label::before {
  content: "📍";
  font-size: 13px;
}
.location-switcher select {
  width: 100%;
  padding: 9px 30px 9px 11px;
  border-radius: 8px;
  border: 1px solid #3a4560;
  background: #1a2133 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b95b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: white;
  font-size: 13px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.location-switcher select:hover { border-color: var(--accent); }
.location-switcher select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.28);
}
.location-switcher select option {
  background: #1e2536;
  color: white;
  font-weight: 500;
}
.location-static {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 11px 14px;
  background: linear-gradient(155deg, #2a3350, #232b42);
  border: 1px solid #3a4560;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 6px rgba(0,0,0,0.15);
}

.main { flex: 1; padding: 24px 32px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.topbar h2 { font-size: 22px; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* ---------- Карточки справочников ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
@media (min-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(4, 1fr); }
}
.catalog-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  cursor: pointer;
}
.catalog-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.catalog-card-icon { font-size: 28px; margin-bottom: 10px; }
.catalog-card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.catalog-card-sub { font-size: 13px; color: var(--text-muted); }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  border-left: 4px solid var(--accent);
}
.stat-card.accent-green { border-left-color: var(--green); }
.stat-card.accent-orange { border-left-color: var(--orange); }
.stat-card.accent-blue { border-left-color: var(--accent); }

.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ---------- Toolbar / таблицы ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar input, .toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.toolbar input { flex: 1; min-width: 200px; }
.toolbar-narrow { max-width: 460px; }
.results-count {
  margin-left: auto;
  align-self: center;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; white-space: nowrap; }
thead th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }

.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-th:hover { color: var(--text); }
.sort-arrow { display: inline-block; width: 10px; margin-left: 4px; font-size: 10px; }

.filter-row td { padding: 6px 16px; border-bottom: 1px solid var(--border); }
.col-filter {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: normal;
  text-transform: none;
}

.maintenance-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.15s;
}
.maintenance-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.maintenance-input[type="number"]::-webkit-inner-spin-button,
.maintenance-input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

.due-warning {
  color: var(--red);
  font-weight: 700;
  background: var(--red-bg);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.25);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-available { background: #dcfce7; color: #166534; }
.badge-rented { background: #fef3c7; color: #92400e; }
.badge-booked { background: #dbeafe; color: #1e40af; }
.badge-maintenance { background: #f3e8ff; color: #6b21a8; }
.badge-retired { background: #f3f4f6; color: #6b7280; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }

/* Значок «заявка с сайта» — красный, чтобы менеджер сразу заметил и позвонил */
.site-booking-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
/* Новая необработанная заявка с сайта — подсветка строки, чтобы бросалась в глаза */
tr.booking-from-site-new > td {
  background: #fef2f2;
  box-shadow: inset 3px 0 0 #dc2626;
}

/* ---------- Цветные статусы байков ---------- */
.status-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-pill-list { display: flex; flex-direction: column; gap: 6px; }
.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  text-align: left;
  color: var(--text);
}
.status-pill:hover { background: #f4f6f9; }
.status-pill.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.status-pill .status-dot { width: 12px; height: 12px; }
.color-swatch-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
}
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--text); }

.icon-edit-btn {
  font-size: 20px;
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  line-height: 1;
}
.icon-edit-btn:hover { border-color: var(--border); background: #f4f6f9; }

.icon-picker-input {
  font-size: 20px;
  text-align: center;
  max-width: 160px;
}
.icon-picker-input::placeholder {
  font-size: 13px;
  text-align: center;
}

/* ---------- Выбор эмодзи ---------- */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-width: 100%;
}
.emoji-btn {
  font-size: 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  cursor: pointer;
  line-height: 1;
}
.emoji-btn:hover { background: #eef1f6; }
.emoji-btn.selected { background: var(--accent); border-color: var(--accent); }

/* ---------- Автокомплит (поиск клиента/байка) ---------- */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.autocomplete-item:hover { background: #f4f6f9; }
.autocomplete-empty { padding: 8px 12px; color: var(--text-muted); font-size: 13px; }

/* ---------- Модалка ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 20, 35, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 20px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 8px; }

/* ---------- Карточки точек (Локации) ---------- */
.location-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.location-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  transition: box-shadow 0.15s, transform 0.15s;
}
.location-card:hover {
  box-shadow: 0 4px 14px rgba(20, 30, 60, 0.08);
  transform: translateY(-1px);
}
.location-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.location-card-name {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.location-card-city {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-dark);
  background: rgba(37, 99, 235, 0.1);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 12px;
}
.location-card-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
}
.location-card-row strong { color: var(--text); font-weight: 500; }
.location-card-icon { flex-shrink: 0; opacity: 0.75; }
.location-card-delete {
  position: absolute;
  top: 14px;
  right: 14px;
}
.location-cards-empty {
  color: var(--text-muted);
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

/* ---------- Карточки разделов-справочников (список + форма добавления) ---------- */
.list-card { margin-bottom: 24px; }
.list-card-narrow { margin-bottom: 24px; max-width: 460px; }
.section-card {
  max-width: 460px;
  padding: 20px;
}
.section-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2233;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 200;
}
.toast.toast-error { background: var(--red); }

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 800px) {
  .sidebar {
    position: fixed;
    left: -240px;
    top: 0; bottom: 0;
    z-index: 50;
    transition: left 0.2s;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  }
  .sidebar.open { left: 0; }
  .main { padding: 16px; }
  .mobile-menu-btn { display: block; }
  table { font-size: 13px; }
  th, td { padding: 10px; }
}

/* ---------- Печать договора ---------- */
.contract-print-area { display: none; }
.contract-print-area h1 { font-size: 20px; margin-bottom: 12px; }
.contract-print-area h3 { font-size: 15px; margin: 16px 0 6px; }
.contract-print-area p { line-height: 1.6; }
.contract-print-area .contract-placeholder { margin-top: 20px; font-style: italic; color: #555; }
.contract-print-area .contract-signatures { margin-top: 48px; display: flex; justify-content: space-between; gap: 40px; }

@media print {
  body * { visibility: hidden; }
  .contract-print-area, .contract-print-area * { visibility: visible; }
  .contract-print-area {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    color: #000;
  }
}

/* ---------- Колокольчик уведомлений ---------- */
.notification-bell {
  position: relative;
  margin-left: auto;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}
.notification-badge {
  position: absolute;
  top: -2px;
  right: 0;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

/* ---------- Календарь ---------- */
.calendar-due-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.calendar-due-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  padding: 12px 16px;
}
.calendar-due-card-overdue { background: #fef2f2; border-color: var(--red); }
.calendar-overdue-tag { color: var(--red); font-size: 12px; font-weight: 700; }
.calendar-due-name { font-weight: 600; margin-right: 8px; }
.calendar-due-sub { color: var(--text-muted); font-size: 13px; flex: 1; }
.calendar-due-amount { width: 120px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }

.calendar-grid-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.calendar-grid-weekdays, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekday { text-align: center; font-size: 12px; color: var(--text-muted); padding: 4px 0; }
.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  cursor: default;
}
.calendar-cell[onclick] { cursor: pointer; }
.calendar-cell[onclick]:hover { background: #f4f6f9; }
.calendar-cell-empty { visibility: hidden; }
.calendar-cell-today .calendar-cell-day {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); margin-top: 2px; display: inline-block; margin-right: 2px; }

/* ---------- Календарь бронирований ---------- */
.booking-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.booking-calendar-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-confirmed, .calendar-dot.legend-confirmed { background: #2563eb; }
.legend-waitlist, .calendar-dot.legend-waitlist { background: #9333ea; }
.legend-return { background: #16a34a; }
.legend-longterm { background: #6b7280; }
.legend-maintenance { background: #d97706; }
.legend-deficit { background: var(--red); }
.priority-override-tag { color: #d97706; font-size: 12px; font-weight: 700; cursor: help; }
.bike-assigned-info { margin-top: 4px; font-size: 12px; color: #2563eb; cursor: pointer; }
.bike-assigned-info:hover { text-decoration: underline; }

/* ---------- Мультивыбор видов ремонтных работ (в модальном окне) ---------- */
.multiselect-btn { text-align: left; cursor: pointer; min-width: 200px; background: #fff; }
#worktype-picker-list { max-height: 340px; overflow-y: auto; }
.multiselect-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
}
.multiselect-item:hover { background: #f4f6f9; }
.multiselect-item input { cursor: pointer; }
/* ---------- Пагинация таблиц ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 24px;
  flex-wrap: wrap;
}
.pager-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}
.pager-btn:hover:not([disabled]) { background: #f4f6f9; }
.pager-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager-btn[disabled] { opacity: 0.4; cursor: default; }
.pager-ellipsis { color: var(--text-muted); padding: 0 2px; }

.engine-class-tag {
  display: inline-block;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  vertical-align: middle;
}

/* ---------- Касса ---------- */
.section-card.cash-wide { max-width: 1000px; }
.cash-layout { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
.cash-layout-left { flex: 1; min-width: 320px; }
.cash-layout-right { flex: 1; min-width: 320px; }
.cash-columns { display: flex; gap: 32px; flex-wrap: wrap; margin: 16px 0; }
.cash-column { flex: 1; min-width: 220px; }
.cash-column h4 { margin-bottom: 10px; }
.cash-denom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.cash-denom-row label { width: 48px; font-weight: 600; }
.cash-denom-row input { width: 70px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.cash-denom-total { color: var(--text-muted); font-size: 13px; }
.cash-column-total { margin-top: 8px; font-size: 14px; }
.cash-grand-total { font-size: 16px; font-weight: 700; margin: 12px 0; }


/* ---------- Внутренний чат ---------- */
.chat-rooms { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.chat-room-tab {
  padding: 6px 14px; border-radius: 16px; border: 1px solid var(--border, #d8dee6);
  background: #fff; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.chat-room-tab.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.chat-messages {
  height: 55vh; overflow-y: auto; border: 1px solid var(--border, #d8dee6);
  border-radius: 8px; padding: 12px; background: #f8fafc; display: flex; flex-direction: column; gap: 8px;
}
.chat-msg { max-width: 75%; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid #e2e8f0; align-self: flex-start; word-break: break-word; white-space: pre-wrap; }
.chat-msg.own { align-self: flex-end; background: #dbeafe; border-color: #bfdbfe; }
.chat-msg-meta { font-size: 11px; color: #64748b; margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.chat-msg-del { cursor: pointer; color: var(--red, #dc2626); font-size: 11px; }
.chat-day-sep { align-self: center; font-size: 12px; color: #64748b; background: #e2e8f0; border-radius: 10px; padding: 2px 10px; margin: 4px 0; }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; resize: none; padding: 8px 10px; border: 1px solid var(--border, #d8dee6); border-radius: 8px; font: inherit; }
/* Счётчик байков на карточках Техобслуживания */
.maint-count { color: var(--red, #e53935); font-weight: 800; }

/* Компактная таблица аренд: раздельные колонки, минимальные отступы — всё на 24" */
.rentals-compact { overflow-x: visible; }
.rentals-compact table { width: 100%; table-layout: auto; }
.rentals-compact th, .rentals-compact td { padding: 5px 5px; font-size: 12.5px; vertical-align: top; }
.rentals-compact th { white-space: nowrap; }
.rentals-compact .col-filter { padding: 3px 4px; font-size: 12px; min-width: 0; width: 100%; box-sizing: border-box; }
.rentals-compact .rentals-actions { max-width: 140px; }
.rentals-compact .rentals-actions .btn-small { margin: 0 2px 3px 0; padding: 2px 6px; font-size: 11.5px; }

/* Колонка действий в арендах: аккуратный блок у правого края */
.rentals-compact .rentals-actions { min-width: 120px; max-width: 150px; }
.rentals-compact .rentals-actions .btn-small { display: inline-block; margin: 0 3px 3px 0; padding: 3px 7px; font-size: 11.5px; line-height: 1.3; white-space: nowrap; vertical-align: top; }

/* Меню «...» в строке аренды */
.row-menu-wrap { position: relative; display: inline-block; }
.row-menu {
  position: absolute; right: 0; top: 100%; z-index: 1500;
  display: block; background: #fff; border: 1px solid var(--border, #dfe3ea);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 4px; min-width: 190px;
}
.row-menu.hidden { display: none; }
.row-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 7px 10px; font-size: 13px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.row-menu button:hover { background: var(--bg-muted, #f0f2f6); }

/* Жёсткая сетка таблицы аренд: гарантированно 100% ширины экрана, без скролла */
.rentals-compact table { table-layout: fixed; }
.rentals-compact td { overflow: hidden; }
.rentals-compact .cell-ellipsis { white-space: nowrap; text-overflow: ellipsis; }
.rentals-compact th:nth-child(1) { width: 15%; }   /* Клиент */
.rentals-compact th:nth-child(2) { width: 9%; }    /* Модель */
.rentals-compact th:nth-child(3) { width: 5.5%; }  /* Номер */
.rentals-compact th:nth-child(4) { width: 6%; }    /* Начало */
.rentals-compact th:nth-child(5) { width: 2%; }    /* Дней */
.rentals-compact th:nth-child(6) { width: 6.5%; }  /* Окончание */
.rentals-compact th:nth-child(7) { width: 5.5%; }  /* Пробег */
.rentals-compact th:nth-child(8) { width: 5.5%; }  /* Масло */
.rentals-compact th:nth-child(9) { width: 6%; }    /* Техосмотр */
.rentals-compact th:nth-child(10) { width: 6%; }   /* Сумма */
.rentals-compact th:nth-child(11) { width: 7%; }   /* Залог */
.rentals-compact th:nth-child(12) { width: 8.5%; } /* Статус */
.rentals-compact th:nth-child(13) { width: 6.5%; } /* Оформил (admin) */
.rentals-compact th:nth-child(14) { width: 11%; }  /* Действия */
.rentals-compact th { overflow: hidden; text-overflow: ellipsis; }
.rentals-compact .rentals-actions { min-width: 0; max-width: none; }

/* Кнопки действий аренды — в одну линию */
.rentals-compact .rentals-actions { white-space: nowrap; }
.rentals-compact .rentals-actions .btn-small { margin-bottom: 0; }

/* Меню «...» обрезалось из-за overflow:hidden на ячейке — колонке действий возвращаем visible */
.rentals-compact td.rentals-actions { overflow: visible; }
