:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --card-bg: rgba(30, 41, 59, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --input-bg: #0f172a;
  --input-border: #334155;
  --input-focus: #3b82f6;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.4);
  --danger-text: #fca5a5;
  --success-bg: rgba(34, 197, 94, 0.15);
  --success-border: rgba(34, 197, 94, 0.4);
  --success-text: #86efac;
  --radius: 12px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Контейнери */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.center-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* Картка авторизації */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow:
    0 20px 40px -15px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(59, 130, 246, 0.05);
  animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.brand-title {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Поля форми */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.form-label-row .form-label,
.form-label-row .form-label-compact {
  margin-bottom: 0;
}

.char-counter {
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.2px;
}

.char-counter-compact {
  font-size: 11px;
}

.char-counter.limit-reached {
  color: #f59e0b;
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
  color: #64748b;
}

/* Обгортка поля пароля */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .form-control {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.password-toggle:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Спіннер */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
}

.hidden {
  display: none !important;
}

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

/* Повідомлення */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

/* =====================================================
   TOP NAVBAR — горизонтальне меню (Firebase-style)
   ===================================================== */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 64px;
  padding: 0 32px;
  background: #1a2332;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

/* Ліва частина: бренд + посилання */
.tnav-left {
  display: flex;
  align-items: center;
  gap: 36px;
  flex: 1;
}

/* Бренд/логотип */
.tnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.tnav-brand:hover { opacity: 0.85; }

.tnav-logo-icon {
  color: var(--primary);
  flex-shrink: 0;
}

/* Список пунктів меню */
.tnav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tnav-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.tnav-link:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

.tnav-link.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.2);
}

.tnav-link.active:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

/* Права частина */
.tnav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.tnav-user {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255,255,255,0.06);
  padding: 5px 13px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}

.tnav-btn-logout {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
  transition: var(--transition);
  white-space: nowrap;
}
.tnav-btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* Бургер (мобільний) */
.tnav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.tnav-burger:hover { background: rgba(255,255,255,0.06); }
.tnav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #cbd5e1;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* Мобільне розкривне меню */
.tnav-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  background: #1a2332;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.tnav-mobile-menu.open { display: flex; }

.tnav-mobile-link {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: var(--transition);
}
.tnav-mobile-link:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
  color: #ffffff;
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}
.tnav-mobile-link.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #ffffff;
  font-weight: 600;
}

.tnav-mobile-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 8px 0;
}

.tnav-mobile-user {
  font-size: 13px;
  color: #94a3b8;
  padding: 4px 14px;
}

.tnav-mobile-logout {
  width: 100%;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fca5a5;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.tnav-mobile-logout:hover { background: rgba(239,68,68,0.22); }

/* Відступ сторінки від фіксованого меню */
.page-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Контент дашборду */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 32px auto;
  padding: 0 16px;
}

/* Повноширинний контейнер для довідників (Cars, Reference Books) */
.main-content.dict-container {
  max-width: 100%;
  width: 100%;
  padding: 0 32px;
  margin: 32px auto;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .main-content.dict-container .dict-table-card,
  .main-content.dict-container .table-card {
    overflow: visible;
  }
  .main-content.dict-container .table-responsive {
    overflow-x: visible;
  }
  .main-content.dict-container .dict-table th,
  .main-content.dict-container .cars-table th,
  .main-content.dict-container .orders-table th {
    position: sticky;
    top: 64px;
    z-index: 20;
    background: #111a28;
    background: rgba(17, 26, 40, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .main-content.dict-container .dict-table thead tr:first-child th:first-child {
    border-top-left-radius: var(--radius);
  }
  .main-content.dict-container .dict-table thead tr:first-child th:last-child {
    border-top-right-radius: var(--radius);
  }
  .main-content.dict-container .dict-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius);
  }
  .main-content.dict-container .dict-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius);
  }
}

@media (max-width: 1150px) {
  .main-content.dict-container .orders-table-card {
    overflow: hidden;
  }
  .main-content.dict-container .orders-table-responsive {
    overflow-x: auto;
  }
  .main-content.dict-container .orders-table th {
    position: static;
  }
}

@media (max-width: 768px) {
  .main-content.dict-container {
    padding: 0 16px;
    margin: 20px auto;
  }
  .main-content.dict-container .dict-table-card,
  .main-content.dict-container .table-card {
    overflow: hidden;
  }
  .main-content.dict-container .table-responsive {
    overflow-x: auto;
  }
  .main-content.dict-container .dict-table th,
  .main-content.dict-container .cars-table th,
  .main-content.dict-container .orders-table th {
    position: static;
  }
}

.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
}

/* Картки швидкого доступу */
.quick-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.quick-link-card:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

.ql-icon {
  font-size: 28px;
  line-height: 1;
}

.ql-label {
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  text-align: center;
}

/* Футер */
.footer {
  text-align: center;
  padding: 18px;
  font-size: 13px;
  color: #64748b;
  border-top: 1px solid var(--card-border);
}

/* Бейджі ролей */
.nav-role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-left: 6px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.badge-admin {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-user {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.pill-admin {
  background: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.pill-user {
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Сторінка моніторингу бази даних (db-health) */
.db-health-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.db-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.db-breadcrumb-link {
  color: var(--primary);
  text-decoration: none;
}

.db-breadcrumb-link:hover {
  text-decoration: underline;
}

.db-breadcrumb-separator {
  color: #475569;
}

.db-breadcrumb-current {
  color: #cbd5e1;
}

.db-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.db-page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.db-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-refresh, .btn-json {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.btn-refresh {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-refresh:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-json {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid var(--card-border);
}

.btn-json:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.health-hero-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  gap: 16px;
  flex-wrap: wrap;
}

.health-hero-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.status-online {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-offline {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-pulse-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: statusPulse 2s infinite ease-in-out;
}

.status-offline .status-pulse-dot {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

@keyframes statusPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.health-hero-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.health-hero-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.health-hero-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.pill-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.pill-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

/* Сітка метрик */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.health-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}

.health-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hcard-icon {
  font-size: 24px;
}

.hcard-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.hcard-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.hcard-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.db-details-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.db-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.db-detail-row:last-child {
  border-bottom: none;
}

.db-detail-label {
  color: var(--text-muted);
}

.db-detail-value {
  color: var(--text-main);
  font-weight: 500;
}

/* Адаптивність */
@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
  }
}

@media (max-width: 768px) {
  .tnav-links,
  .tnav-right {
    display: none;
  }
  .tnav-burger {
    display: flex;
  }
  .top-navbar {
    padding: 0 16px;
  }
  .health-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================================
   Довідники (Dictionaries / Cars / etc.)
   ======================================================== */

/* Верхній блок дій */
.dict-header-bar,
.cars-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.dict-title-wrap,
.cars-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dict-page-title,
.cars-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.dict-counter-badge,
.cars-counter-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.dict-btn-add,
.btn-add-car {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.dict-btn-add:hover,
.btn-add-car:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.dict-btn-add:active,
.btn-add-car:active {
  transform: translateY(0);
}

/* Контейнер таблиці */
.dict-table-card,
.table-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dict-table,
.cars-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.dict-table th,
.cars-table th {
  background: rgba(15, 23, 42, 0.75);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
  user-select: none;
  white-space: nowrap;
}

.dict-table th.sortable,
.cars-table th.sortable {
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.dict-table th.sortable:hover,
.cars-table th.sortable:hover {
  color: #ffffff;
  background: rgba(30, 48, 75, 0.98);
}

.dict-table th .th-content,
.cars-table th .th-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sort-icon {
  display: inline-flex;
  font-size: 10px;
  opacity: 0.4;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dict-table th.sorted-asc .sort-icon,
.dict-table th.sorted-desc .sort-icon,
.cars-table th.sorted-asc .sort-icon,
.cars-table th.sorted-desc .sort-icon {
  opacity: 1;
  color: var(--primary);
}

.dict-table td,
.cars-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.dict-table tbody tr,
.cars-table tbody tr {
  transition: background 0.15s ease;
}

.dict-table tbody tr:hover,
.cars-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.dict-table tbody tr:last-child td,
.cars-table tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================================
   Колонки таблиці довідників (Cars & Dictionary Template)
   ======================================================== */
.col-car-id,
.dict-col-id {
  width: 68px;
  min-width: 68px;
  text-align: center;
}

.dict-table th.col-car-id .th-content,
.dict-table th.dict-col-id .th-content {
  justify-content: center;
}

.dict-table td.col-car-id,
.dict-table td.dict-col-id {
  text-align: center;
}

.col-car-plate {
  width: 180px;
  min-width: 140px;
}

.col-car-date,
.dict-col-date {
  width: 160px;
  min-width: 130px;
}

.col-car-vin {
  width: auto;
  min-width: 190px;
}

.col-car-status,
.dict-col-status {
  width: 160px;
  min-width: 130px;
}

/* Колонки еталонного шаблону довідника */
.dict-col-name {
  width: auto;
  min-width: 180px;
}

.dict-col-code {
  width: 180px;
  min-width: 140px;
}

/* ========================================================
   Колонки таблиці замовлень (Orders Columns)
   ======================================================== */
.col-order-id {
  width: 58px;
  min-width: 50px;
  text-align: center;
}
.dict-table th.col-order-id .th-content {
  justify-content: center;
}
.dict-table td.col-order-id {
  text-align: center;
}

.col-order-departure {
  width: 150px;
  min-width: 135px;
}

.col-order-arrival {
  width: 150px;
  min-width: 135px;
}

.col-order-duration {
  width: 130px;
  min-width: 110px;
}

.col-order-created {
  width: 140px;
  min-width: 125px;
}

.col-order-client {
  width: 160px;
  min-width: 130px;
}

.col-order-phone {
  width: 145px;
  min-width: 125px;
}

.col-order-route {
  width: auto;
  min-width: 175px;
}

.col-order-price {
  width: 165px;
  min-width: 135px;
}



/* Елементи таблиці */
.dict-id-cell,
.car-id-cell {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
}

.plate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.plate-flag {
  font-size: 11px;
}

.vin-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: #93c5fd;
  letter-spacing: 0.04em;
}

.date-text {
  color: #cbd5e1;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.status-active {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.status-inactive {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Порожній стан таблиці */
.dict-empty-state,
.empty-table-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto 18px;
}

/* ========================================================
   Модальне вікно (Modal Dialog)
   ======================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 35px rgba(59, 130, 246, 0.1);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid var(--card-border);
}

/* Елементи форми у модалці */
.field-error-text {
  font-size: 12px;
  color: #f87171;
  margin-top: 4px;
  display: none;
}

.form-control.is-invalid {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.form-control.is-invalid + .field-error-text {
  display: block;
}

.modal-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
}

.modal-alert.show {
  display: flex !important;
}

.modal-alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-primary {
  background: var(--primary);
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px var(--primary-glow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger,
.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover:not(:disabled),
.btn-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #ffffff;
}

.btn-danger:disabled,
.btn-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cars-table tbody tr {
  cursor: pointer;
}

/* Toast сповіщення */
.toast-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-msg {
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s ease-out;
  pointer-events: auto;
}

.toast-msg.toast-success {
  border-left-color: #22c55e;
}

.toast-msg.toast-error {
  border-left-color: #ef4444;
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Стилі розділу замовлень (Orders) --- */
.duration-badge-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  transition: var(--transition);
}

.duration-badge-preview.duration-invalid {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.duration-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* Семантичні класи дашборду та списків */
.welcome-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.welcome-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome-username {
  color: var(--primary);
}

.welcome-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.dashboard-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #cbd5e1;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.dict-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.col-order-departure-text {
  font-weight: 600;
  color: #ffffff;
}

.col-order-created-text {
  font-size: 12px;
  color: var(--text-muted);
}

.col-order-route-text {
  font-size: 13px;
}

.empty-state-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-empty-reset {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-form-flex {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.input-readonly {
  opacity: 0.85;
  cursor: default;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}

.order-price-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.payment-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.payment-badge-cash {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.payment-badge-terminal {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.payment-badge-iban {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ========================================================
   Фільтр за датою виїзду та Пагінація замовлень
   ======================================================== */

.orders-filter-center {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}

.filter-date-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 5px 10px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  color-scheme: dark;
}

.filter-date-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.btn-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.btn-filter-reset:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: rotate(-45deg);
}

.orders-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.4);
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-pagination {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  user-select: none;
}

.btn-pagination:hover:not(.disabled):not(.active) {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-pagination.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
  pointer-events: none;
}

.btn-pagination.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-page-nav {
  padding: 0 12px;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--text-muted);
  font-size: 14px;
  user-select: none;
}

@media (max-width: 768px) {
  .orders-filter-center {
    width: 100%;
    justify-content: center;
    order: 3;
  }
  .orders-pagination-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ========================================================================== */
/* Компактне уніфіковане модальне вікно замовлень (2 колонки, 95% екрану)      */
/* ========================================================================== */
.modal-dialog-order-compact {
  width: 95vw !important;
  max-width: 95vw !important;
  height: 95vh !important;
  max-height: 95vh !important;
  margin: auto;
  display: flex !important;
  flex-direction: column !important;
}

.modal-dialog-order-compact .modal-header {
  flex-shrink: 0;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.modal-dialog-order-compact .modal-footer {
  flex-shrink: 0;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
}

.orders-modal-body-compact {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 20px;
}

.order-form-single-column {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.order-form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  width: 100%;
}

.order-form-col {
  display: flex;
  flex-direction: column;
}

.order-meta-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 4px;
}

.order-section-block {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.orders-section-heading-compact {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
}

.section-divider-compact {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0 8px 0;
}

.form-group-compact {
  margin-bottom: 7px;
}

.form-label-compact {
  display: block;
  font-size: 12.5px;
  margin-bottom: 3px;
  font-weight: 500;
  color: #cbd5e1;
}

.form-control-compact {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  height: 32px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  color: var(--text-color);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control-compact:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.duration-badge-compact {
  margin: 2px 0 7px 0;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.field-error-compact {
  font-size: 11px;
  margin-top: 2px;
}

/* Інтерактивні рядки таблиці замовлень */
.orders-table tbody tr.orders-table-row {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.orders-table tbody tr.orders-table-row:hover {
  background: rgba(59, 130, 246, 0.1) !important;
}

.orders-table tbody tr.orders-table-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

@media (max-width: 768px) {
  .modal-dialog-order-compact {
    width: 96vw !important;
    max-width: 96vw !important;
    height: 96vh !important;
    max-height: 96vh !important;
  }
  .orders-modal-body-compact {
    padding: 10px 14px;
  }
  .order-form-grid-2col,
  .order-meta-grid-2col {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ========================================================================== */
/* Компактне модальне вікно маршрутів (2-колонкова компактна сітка)           */
/* ========================================================================== */
.modal-dialog-route-compact {
  width: 95vw !important;
  max-width: 95vw !important;
  height: 95vh !important;
  max-height: 95vh !important;
  margin: auto;
  display: flex !important;
  flex-direction: column !important;
}

.modal-dialog-route-compact .modal-header {
  flex-shrink: 0;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.modal-dialog-route-compact .modal-footer {
  flex-shrink: 0;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
}

.route-modal-body-compact {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 20px;
}

.route-form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}

.route-form-col {
  display: flex;
  flex-direction: column;
}

.route-meta-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .modal-dialog-route-compact {
    width: 96vw !important;
    max-width: 96vw !important;
    height: 96vh !important;
    max-height: 96vh !important;
  }
  .route-modal-body-compact {
    padding: 10px 14px;
  }
  .route-form-grid-2col,
  .route-meta-grid-2col {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ========================================================
   Довідник користувачів та ролі (Users & Roles)
   ======================================================== */
.users-container {
  max-width: 1200px;
  margin: 0 auto;
}

.badge-role {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}

.roles-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.btn-action-edit-roles {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-edit-roles:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
  border-color: #3b82f6;
}

.users-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.users-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  font-family: inherit;
  line-height: inherit;
  outline: none;
}

.status-btn.status-active {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.status-btn.status-active:hover:not(:disabled):not(.status-btn-disabled) {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.status-btn.status-inactive {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.status-btn.status-inactive:hover:not(:disabled):not(.status-btn-disabled) {
  background: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.5);
  color: #e2e8f0;
}

.status-btn:disabled,
.status-btn.status-btn-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.roles-user-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13.5px;
}

.roles-user-highlight {
  font-weight: 700;
  color: var(--primary);
}

.roles-section-block {
  margin-bottom: 16px;
}

.roles-section-heading {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.assigned-roles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  align-items: center;
}

.roles-empty-placeholder {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.role-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #f0f9ff;
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn 0.2s ease;
}

.role-btn-minus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.role-btn-minus:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.role-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-select-box {
  flex: 1;
  height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  font-size: 13.5px;
}

.role-select-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.role-btn-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.45);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.role-btn-plus:hover:not(:disabled) {
  background: #22c55e;
  color: #ffffff;
  border-color: #22c55e;
}

.role-btn-plus:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========================================================
   Стилі модуля «Маршрути» (Routes Management)
   ======================================================== */

.routes-fullwidth-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 16px 20px !important;
}

.routes-main-card {
  width: 100%;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Заголовок колонок 50% / 50% */
.routes-columns-header {
  display: flex;
  width: 100%;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  overflow: hidden;
}

.routes-col-title-half {
  flex: 1 1 50%;
  width: 50%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.routes-col-title-left {
  color: #60a5fa;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.routes-col-title-right {
  color: #34d399;
}

.col-title-icon {
  font-size: 16px;
}

/* Список карток маршрутів */
.routes-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.route-item-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition);
}

.route-item-box:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Шапка окремого маршруту */
.route-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  gap: 12px;
  flex-wrap: wrap;
}

.route-strip-left,
.route-strip-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.route-badge-id {
  font-size: 12px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
}

.route-badge-datetime {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.route-badge-direction {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.route-badge-type {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.route-badge-type-group {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.route-badge-type-individual {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.route-badge-driver,
.route-badge-car {
  font-size: 12.5px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Двохколонкова сітка маршруту 50% / 50% */
.route-body-grid {
  display: flex;
  width: 100%;
}

.route-half-column {
  flex: 1 1 50%;
  width: 50%;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.route-half-outbound {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.3);
}

.route-half-return {
  background: rgba(15, 23, 42, 0.45);
}

.route-half-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.half-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.half-header-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

.half-header-counter {
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 7px;
  border-radius: 10px;
}

/* Кнопки-символи (без тексту) */
.btn-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  padding: 0;
  text-decoration: none;
}

.btn-symbol-edit {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 14px;
}

.btn-symbol-edit:hover {
  background: #3b82f6;
  color: #ffffff;
}

.btn-symbol-add,
.btn-symbol-add-order {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.btn-symbol-add:hover,
.btn-symbol-add-order:hover {
  background: #22c55e;
  color: #ffffff;
}

.btn-symbol-toggle-seat.btn-seat-remove {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-symbol-toggle-seat.btn-seat-remove:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-symbol-toggle-seat.btn-seat-restore {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-symbol-toggle-seat.btn-seat-restore:hover {
  background: #f59e0b;
  color: #ffffff;
}

/* Список пасажирів */
.passenger-items-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 48px;
}

.passenger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.passenger-row:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
}

.passenger-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.passenger-seat-wrap {
  width: 68px;
  flex-shrink: 0;
}

.seat-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  min-width: 32px;
}

.badge-no-seat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.passenger-meta-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.passenger-order-num {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.passenger-client-name {
  font-size: 13px;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
}

.passenger-client-phone {
  font-size: 12px;
  color: #94a3b8;
  flex-shrink: 0;
}

.passenger-actions-wrap {
  flex-shrink: 0;
}

/* Пасажири без місця - візуальне відокремлення внизу */
.passenger-row.passenger-unseated {
  background: rgba(245, 158, 11, 0.05);
  border: 1px dashed rgba(245, 158, 11, 0.25);
  opacity: 0.85;
}

.passenger-row.passenger-unseated:hover {
  opacity: 1;
  border-color: rgba(245, 158, 11, 0.45);
}

.passenger-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

/* Модальні вікна замовлень та вільних місць */
.modal-dialog-compact {
  max-width: 480px;
}

.modal-dialog-wide {
  max-width: 620px;
}

.modal-tabs-wrap {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin: -6px 0 16px 0;
  gap: 8px;
}

.modal-tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.modal-tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.unassigned-orders-container {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  padding: 6px;
  margin-top: 8px;
}

.unassigned-loading-text,
.unassigned-empty {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.unassigned-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  margin-bottom: 4px;
}

.unassigned-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.unassigned-item.selected {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
}

.unassigned-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unassigned-order-num {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.unassigned-client-name {
  font-size: 13px;
  color: #f8fafc;
}

.unassigned-phone {
  font-size: 12px;
  color: #94a3b8;
}

.unassigned-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unassigned-route-text {
  font-size: 12px;
  color: #cbd5e1;
}

.unassigned-price-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #94a3b8;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .route-body-grid {
    flex-direction: column;
  }
  .route-half-column {
    width: 100%;
    flex: 1 1 100%;
  }
  .route-half-outbound {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .routes-columns-header {
    display: none;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* Дії в рядках таблиць довідників */
.dict-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  background: transparent;
  user-select: none;
}

.btn-action-toggle {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-action-toggle:hover {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border-color: #f59e0b;
}

.btn-action-toggle.btn-action-activate {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-action-toggle.btn-action-activate:hover {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border-color: #10b981;
}

.btn-action-edit {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-action-edit:hover {
  background: rgba(59, 130, 246, 0.22);
  color: #ffffff;
  border-color: #3b82f6;
}

.btn-action-delete {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #ffffff;
  border-color: #ef4444;
}

.price-currency-badge {
  font-weight: 600;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

/* --- Стилі поля вводу телефону та індикатора некоректності (SPEC.md) --- */
.phone-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.phone-input-container {
  position: relative;
  width: 100%;
}

.phone-warning-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 6px;
}

.phone-warning-badge:hover {
  transform: scale(1.1);
  background: #dc2626;
}

.phone-warning-badge.hidden {
  display: none !important;
}

