/* ==============================================
   Переменные
============================================== */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-rgb: 59, 130, 246;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #e2e8f0;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"],
.dark {
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-card: #242441;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --accent-rgb: 96, 165, 250;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --border: #334155;
}

/* Telegram theme override */
:root {
  --tg-bg_color: var(--bg-primary);
  --tg-secondary_bg_color: var(--bg-secondary);
  --tg-text_color: var(--text-primary);
  --tg-hint_color: var(--text-secondary);
  --tg-link_color: var(--accent);
  --tg-button_color: var(--accent);
  --tg-button_text_color: white;
}

/* ==============================================
   Базовые стили
============================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: var(--transition);
}

.app-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 16px 12px;
  width: 100%;
  min-height: 100vh;
}

/* ==============================================
   Header
============================================== */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  flex-shrink: 0;
}

.profile-avatar:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-xl);
}

.balance-card {
  background: var(--bg-card);
  padding: 8px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
  min-width: 100px;
  flex: 1;
}

.balance-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 2px;
  line-height: 1;
}

.balance-value {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

#theme-icon {
  font-size: 1.2rem;
}

/* ==============================================
   Главное меню (плитки)
============================================== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px;
  margin: 24px 0;
  width: 100%;
}

.tile {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  aspect-ratio: 1 / 1;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.6s;
}

.tile:hover::before {
  left: 100%;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.tile:active {
  transform: translateY(-1px);
}

.tile-icon {
  font-size: 2.8rem;
  color: var(--accent);
  margin-bottom: 12px;
  transition: transform 0.3s ease;
}

.tile:hover .tile-icon {
  transform: scale(1.1);
}

.tile p {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
}

/* ==============================================
   Секции (общие)
============================================== */
.section {
  width: 100%;
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  flex: 1;
}

.back-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--border);
  transform: translateY(-1px);
}

.back-btn i {
  font-size: 1.1rem;
}

/* ==============================================
   Секция пассажира
============================================== */
.search-card {
  background: var(--bg-card);
  padding: 28px 20px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
}

.input-group {
  position: relative;
  margin-bottom: 16px;
}

.input-group i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  z-index: 1;
  font-size: 1.1rem;
}

.input-group input {
  width: 100%;
  padding: 14px 14px 14px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-size: 1rem;
  color: var(--text-primary);
  transition: var(--transition);
  font-family: inherit;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.input-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Группа ввода с валютой */
.price-input-group {
  position: relative;
}

.price-input-group input {
  padding-right: 40px !important;
}

.currency {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
}

/* Подсказка цены */
.price-hint {
  background: rgba(var(--accent-rgb), 0.08);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.price-hint strong {
  color: var(--accent);
  font-weight: 600;
}

/* Блок активного заказа */
#active-order {
  margin-top: 24px;
}

.order-preview {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.order-preview:hover {
  box-shadow: var(--shadow-lg);
}

.order-preview .route-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.order-preview .route-info span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.order-preview .route-info span span {
  color: var(--text-primary);
  font-weight: 400;
}

.order-preview .price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--success);
  margin: 12px 0;
  text-align: center;
  animation: pricePulse 0.3s ease;
}

@keyframes pricePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 10px 0;
  text-align: center;
  width: 100%;
}

.status-badge.waiting {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==============================================
   Секция водителя - ОБНОВЛЕННАЯ
============================================== */
#orders-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.order-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.order-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.order-item .order-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-item .order-title strong {
  color: var(--success);
}

.order-item .order-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.driver-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

/* ==============================================
   Кнопки (общие)
============================================== */
.btn {
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  text-align: center;
}

.btn.full-width {
  width: 100%;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn.accept {
  background: linear-gradient(135deg, var(--success), #0da371);
  color: white;
  font-weight: 600;
}

.btn.accept:hover {
  background: linear-gradient(135deg, #0da371, var(--success));
  transform: translateY(-2px);
}

.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==============================================
   Личный кабинет
============================================== */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.05), transparent);
  pointer-events: none;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  color: white;
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.35);
  border: 3px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.profile-user-info {
  flex: 1;
}

.profile-user-info h3 {
  font-size: 1.45rem;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.profile-user-info .user-status {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.profile-balances {
  display: flex;
  gap: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.balance-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  flex-shrink: 0;
}

.balance-item.bonus .balance-icon {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.balance-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.balance-content .balance-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.balance-content .balance-value {
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--accent);
}

.balance-item.bonus .balance-value {
  color: var(--success);
}

.profile-actions {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.action-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
}

.action-item:hover {
  background: var(--bg-secondary);
}

.action-item:last-child {
  border-bottom: none;
}

.action-item i:first-child {
  font-size: 1.3rem;
  width: 28px;
  color: var(--text-secondary);
}

.action-item span {
  flex: 1;
  margin-left: 12px;
}

.action-item .fa-chevron-right {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.action-item.danger {
  color: var(--danger);
}

.action-item.danger i:first-child {
  color: var(--danger);
}

.action-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ==============================================
   Модальные окна
============================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
  border: 1px solid var(--border);
}

@keyframes modalSlideIn {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h3 {
  margin-bottom: 24px;
  font-size: 1.4rem;
  color: var(--text-primary);
  text-align: center;
}

/* Слайдеры */
.slider-container {
  position: relative;
  margin: 30px 0;
}

.slider-container input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.4);
  border: 3px solid var(--bg-primary);
}

.slider-value {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  min-width: 80px;
  text-align: center;
}

.slider-hints {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Действия в модальном окне */
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions .btn {
  flex: 1;
  justify-content: center;
}

/* ==============================================
   Лоадер и анимации
============================================== */
.loader {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(8px);
}

.loader::after {
  content: '';
  width: 48px;
  height: 48px;
  border: 5px solid var(--text-secondary);
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

/* ==============================================
   Утилиты
============================================== */
.hidden {
  display: none !important;
}

/* ==============================================
   Адаптивность
============================================== */
@media (max-width: 400px) {
  .app-container {
    padding: 12px 10px;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }

  .tile {
    padding: 24px 12px;
    aspect-ratio: 1 / 1.05;
    min-height: 130px;
  }

  .search-card {
    padding: 20px 16px;
  }

  .profile-balances {
    flex-direction: column;
    gap: 12px;
  }

  .profile-card {
    padding: 24px;
  }

  .modal-content {
    padding: 22px;
    max-width: 100%;
  }
  
  .slider-value {
    font-size: 1rem;
    padding: 6px 14px;
  }
  
  .driver-actions {
    gap: 8px;
  }
  
  .order-item {
    padding: 16px;
  }
  
  .order-preview {
    padding: 16px;
  }
}

@media (max-width: 360px) {
  .tile {
    min-height: 120px;
    padding: 20px 10px;
  }
  
  .tile-icon {
    font-size: 2.4rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .tile p {
    font-size: 0.95rem;
  }
}

/* ==============================================
   Темная тема улучшения
============================================== */
.dark .modal-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .slider-container input[type="range"] {
  background: #334155;
}

.dark .slider-container input[type="range"]::-webkit-slider-thumb {
  border-color: var(--bg-secondary);
}

.dark .input-group input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .input-group input:focus {
  background: rgba(255, 255, 255, 0.08);
}

/* ==============================================
   Специфические исправления
============================================== */
#user-name {
  word-break: break-all;
}

.app-container {
  overflow-x: hidden;
}

.tile:active {
  transform: scale(0.98);
}

/* Убираем стрелки у input[type="number"] */
input[type="tel"]::-webkit-inner-spin-button,
input[type="tel"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="tel"] {
  -moz-appearance: textfield;
}
/* ==============================================
   Стили для обязательных полей
============================================== */

/* Контейнер для обязательных полей */
.input-group.required {
    position: relative;
}

/* Бейдж "обязательно" */
.required-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    opacity: 0.8;
    pointer-events: none;
}

/* Увеличиваем padding справа для полей с бейджем */
.input-group.required input {
    padding-right: 85px !important;
}

/* Особый стиль для price-input-group с бейджем */
.price-input-group.required input {
    padding-right: 85px !important;
}

.price-input-group.required .required-badge {
    right: 45px; /* Учитываем символ валюты */
}

/* Плейсхолдер для обязательных полей */
.input-group.required input::placeholder {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Стиль при фокусе обязательных полей */
.input-group.required input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

/* Стиль при ошибке валидации */
.input-group.required input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.input-group.required input:invalid:not(:focus):not(:placeholder-shown) + .required-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    opacity: 1;
}

/* Примечание о обязательных полях */
.required-note {
    margin-top: 20px;
    padding: 12px;
    background: rgba(var(--accent-rgb), 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.required-note i {
    color: var(--accent);
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Стили для телефона в заказе водителя */
.order-contact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.order-contact i {
    color: var(--accent);
    font-size: 1rem;
}

.order-contact .contact-phone {
    font-weight: 500;
    color: var(--text-primary);
}

/* Стили для телефона в активном заказе */
.order-preview .route-info span:nth-child(3) {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

/* Адаптивность для бейджей */
@media (max-width: 400px) {
    .required-badge {
        font-size: 0.65rem;
        padding: 1px 5px;
        right: 10px;
    }
    
    .input-group.required input {
        padding-right: 75px !important;
    }
    
    .price-input-group.required input {
        padding-right: 75px !important;
    }
    
    .price-input-group.required .required-badge {
        right: 40px;
    }
}

@media (max-width: 360px) {
    .required-badge {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    
    .input-group.required input {
        padding-right: 70px !important;
    }
    
    .price-input-group.required input {
        padding-right: 70px !important;
    }
    
    .price-input-group.required .required-badge {
        right: 35px;
    }
    
    .required-note {
        font-size: 0.8rem;
        padding: 10px;
    }
}

/* Темная тема для обязательных полей */
.dark .required-badge {
    background: rgba(239, 68, 68, 0.2);
}

.dark .input-group.required input:invalid:not(:focus):not(:placeholder-shown) {
    background: rgba(239, 68, 68, 0.1);
}

.dark .required-note {
    background: rgba(var(--accent-rgb), 0.12);
}

.dark .order-contact {
    background: rgba(var(--accent-rgb), 0.08);
}
/* ==============================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ НОВЫХ ФУНКЦИЙ
============================================== */

/* Header с уведомлениями */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notifications {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Быстрые адреса */
.quick-addresses {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.quick-address {
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 110px;
}

.quick-address:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quick-address:hover i {
    color: white;
}

.quick-address i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Специальные опции */
.special-options {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.option-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.option-toggle:last-child {
    border-bottom: none;
}

.option-toggle i {
    color: var(--accent);
    font-size: 1.2rem;
    width: 24px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: var(--accent);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

.trip-settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.setting-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
}

.setting-item i:first-child {
    color: var(--accent);
}

/* Фото водителя и информация */
.driver-photo-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.driver-photo {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.driver-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.driver-verified {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--success);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.driver-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
}

.driver-rating {
    color: var(--warning);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.car-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Детали заказа */
.order-details {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 15px;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-md);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.detail-item i {
    color: var(--accent);
}

/* История заказов */
.history-section {
    margin-top: 30px;
}

.section-subtitle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.section-subtitle i {
    color: var(--accent);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.history-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-status {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.history-status.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.history-status.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.history-route {
    font-weight: 500;
    margin-bottom: 8px;
}

.history-info {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-price {
    color: var(--success);
    font-weight: 600;
}

.history-rating {
    color: var(--warning);
}

/* Статус водителя */
.driver-status-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.driver-status-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator.offline {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-text {
    flex: 1;
    font-weight: 500;
}

/* Статистика водителя */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Фильтры */
.filters {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-tag {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-tag.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.sort-dropdown select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Семейный раздел */
.family-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.family-balance {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.family-balance .balance-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(var(--accent-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
}

.balance-info {
    flex: 1;
}

.family-members h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.member-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.member-actions {
    display: flex;
    gap: 8px;
}

.btn.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Планирование поездок */
.planned-trips-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.planned-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.planned-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.planned-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.planned-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.planned-date {
    text-align: center;
    min-width: 70px;
}

.date-day {
    font-weight: 600;
    font-size: 0.9rem;
}

.date-time {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

.planned-details {
    flex: 1;
}

.planned-route {
    font-weight: 500;
    margin-bottom: 6px;
}

.planned-info {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.planned-info i {
    margin-right: 4px;
}

/* Регулярные маршруты */
.regular-routes {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.regular-routes h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.routes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.route-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 1.2rem;
}

.route-details {
    flex: 1;
}

.route-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.route-schedule {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Модальные окна настроек поездки */
.settings-modal {
    max-height: 80vh;
    overflow-y: auto;
}

.settings-group {
    margin-bottom: 25px;
}

.settings-group h4 {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-primary);
}

.temperature-control {
    display: flex;
    gap: 10px;
}

.temp-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.temp-btn.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.temp-btn i {
    font-size: 1.5rem;
}

.music-options, .lighting-options {
    display: flex;
    gap: 10px;
}

.music-option, .lighting-option {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.music-option.active, .lighting-option.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.music-option i, .lighting-option i {
    font-size: 1.8rem;
    color: var(--accent);
}

.additional-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Рейтинговая модалка */
.rating-modal {
    max-height: 80vh;
    overflow-y: auto;
}

.driver-review {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.driver-photo-small {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.driver-photo-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.star-rating {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
}

.star-rating i {
    font-size: 2.5rem;
    color: var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.star-rating i.active {
    color: var(--warning);
}

.categories-rating {
    margin: 25px 0;
}

.category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.category-stars i {
    color: var(--border);
    margin-left: 3px;
    cursor: pointer;
}

.category-stars i.active {
    color: var(--warning);
}

.comment-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
}

/* Чат */
.chat-modal {
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.chat-partner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-partner i {
    font-size: 2.5rem;
    color: var(--accent);
}

.chat-name {
    font-weight: 600;
}

.chat-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 10px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message.received {
    align-self: flex-start;
    background: var(--bg-secondary);
    border-bottom-left-radius: 4px;
}

.message.sent {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.send-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Пополнение баланса */
.auto-topup-section {
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 20px;
}

.auto-topup-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.auto-topup-input {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.auto-topup-input input {
    width: 60px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
}

.auto-topup-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.amount-option {
    padding: 15px;
    text-align: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.amount-option:hover {
    border-color: var(--accent);
}

.amount-option.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.amount-option.custom {
    grid-column: span 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.amount-option.custom input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
}

.payment-methods {
    margin-bottom: 25px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-method.selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.payment-method i {
    font-size: 1.5rem;
    color: var(--accent);
}

.add-payment {
    width: 100%;
    margin-top: 10px;
}

/* Адаптивность */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .amount-option.custom {
        grid-column: span 2;
    }
    
    .temperature-control,
    .music-options,
    .lighting-options {
        flex-direction: column;
    }
    
    .quick-address {
        min-width: 100px;
    }
}

@media (max-width: 360px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-addresses {
        flex-wrap: wrap;
    }
    
    .quick-address {
        min-width: calc(50% - 5px);
    }
}
/* ==============================================
   СТИЛИ ДЛЯ СЕКЦИИ ДОСТАВКИ
   ============================================== */

/* Контейнер для текстового поля */
#delivery-section .input-group {
    position: relative;
    margin-bottom: 16px;
}

/* Текстовое поле для списка товаров */
#delivery-section .input-group textarea {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: var(--transition);
    line-height: 1.5;
}

/* Иконка для текстового поля */
#delivery-section .input-group:has(textarea) i {
    position: absolute;
    left: 16px;
    top: 16px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

#delivery-section textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

#delivery-section textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    font-size: 0.95rem;
}

/* Подсказка под полем товаров */
.delivery-items-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -10px;
    margin-bottom: 8px;
    padding-left: 48px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Счетчик символов */
.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: -8px;
    margin-bottom: 16px;
    padding-right: 10px;
}

.char-counter.warning {
    color: var(--warning);
}

.char-counter.error {
    color: var(--danger);
}

/* Обзор товаров в активной доставке */
.delivery-items-preview {
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 15px 0;
    border: 1px solid var(--border);
}

.delivery-items-preview h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.delivery-items-preview h5 i {
    color: var(--accent);
}

.delivery-items-preview p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Быстрые адреса для доставки */
#delivery-section .quick-address {
    min-width: 100px;
}

/* Темная тема для доставки */
.dark #delivery-section textarea {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .delivery-items-preview {
    background: rgba(var(--accent-rgb), 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Адаптивность для доставки */
@media (max-width: 400px) {
    #delivery-section .input-group textarea {
        padding: 12px 14px 12px 44px;
        min-height: 110px;
        font-size: 0.95rem;
    }
    
    #delivery-section .input-group:has(textarea) i {
        left: 14px;
        top: 14px;
        font-size: 1rem;
    }
    
    .delivery-items-hint {
        padding-left: 44px;
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    #delivery-section .input-group textarea {
        padding: 10px 12px 10px 40px;
        min-height: 100px;
        font-size: 0.9rem;
    }
    
    #delivery-section .input-group:has(textarea) i {
        left: 12px;
        top: 12px;
        font-size: 0.95rem;
    }
    
    .delivery-items-hint {
        padding-left: 40px;
        font-size: 0.75rem;
    }
}
/* ==============================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ МОДУЛЬНОЙ СТРУКТУРЫ
   ============================================== */

/* Лоадер */
.loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--text-secondary);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Сообщение об ошибке */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    min-height: 300px;
    color: var(--text-secondary);
}

.error-message i {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 20px;
    opacity: 0.8;
}

.error-message h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.error-message p {
    font-size: 0.95rem;
    max-width: 300px;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Анимация появления контента */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Состояние загрузки для кнопок */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Адаптивность для модулей */
@media (max-width: 400px) {
    .error-message {
        padding: 30px 16px;
        min-height: 250px;
    }
    
    .error-message i {
        font-size: 2.5rem;
    }
    
    .error-message h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 360px) {
    .error-message {
        padding: 24px 12px;
        min-height: 200px;
    }
    
    .error-message i {
        font-size: 2rem;
    }
}
/* Кнопка отмены */
.btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Анимация переключателя */
.toggle-switch.toggled .slider:before {
    transform: scale(1.1);
}

/* Статусы заказа */
.status-badge.waiting {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.accepted {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.completed {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
/* Дополнительные стили для модуля доставки */
.input-group.focused {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.input-group.warning input,
.input-group.warning textarea {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.input-group.error input,
.input-group.error textarea {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.quick-address.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quick-address.active i {
    color: white;
}

.option-toggle.active {
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-sm);
}

/* Анимация для кнопки публикации */
#publish-delivery-btn {
    position: relative;
    overflow: hidden;
}

#publish-delivery-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

#publish-delivery-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

/* ==============================================
   СТИЛИ ДЛЯ МОДУЛЯ ВОДИТЕЛЯ - НОВАЯ ЧАСТЬ
   ============================================== */

/* Широкое модальное окно */
.modal-content.wide {
    max-width: 500px;
}

/* Форма регистрации водителя */
.driver-form {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.driver-form::-webkit-scrollbar {
    width: 6px;
}

.driver-form::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.driver-form::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.form-section h4 i {
    color: var(--accent);
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-group input, .input-group textarea, .input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Загрузка фото */
.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.photo-upload {
    text-align: center;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.upload-area i {
    font-size: 2rem;
    color: var(--accent);
}

.upload-area span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-preview {
    min-height: 100px;
}

.preview-image {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 100px;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Соглашение */
.agreement {
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-top: 20px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.checkbox input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox input:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 0.8rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox a {
    color: var(--accent);
    text-decoration: none;
}

.checkbox a:hover {
    text-decoration: underline;
}

/* Карточка "не водитель" */
.not-driver-card {
    text-align: center;
    padding: 30px 20px;
}

.not-driver-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: var(--accent);
}

.not-driver-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.not-driver-card p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.registration-benefits {
    text-align: left;
    max-width: 300px;
    margin: 0 auto 25px;
}

.registration-benefits p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.registration-benefits i {
    color: var(--success);
    font-size: 0.9rem;
}

.small-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 15px;
}

/* Карточка модерации */
.moderation-card {
    text-align: center;
    padding: 30px 20px;
}

.moderation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: var(--warning);
}

.moderation-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.moderation-card p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.moderation-note {
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 0.9rem;
    margin: 20px auto;
    max-width: 300px;
}

.moderation-note i {
    color: var(--accent);
    margin-right: 8px;
}

.moderation-details {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 15px;
    max-width: 300px;
    margin: 20px auto 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-value {
    font-weight: 500;
    color: var(--text-primary);
}

.status-waiting {
    color: var(--warning);
    font-weight: 600;
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* Модалка модерации */
.moderation-status {
    text-align: center;
    padding: 20px;
}

.moderation-status i {
    font-size: 4rem;
    margin-bottom: 20px;
}

.moderation-status.approved i {
    color: var(--success);
}

.moderation-status.rejected i {
    color: var(--danger);
}

.moderation-status h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.moderation-status p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.rejection-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.rejection-actions .btn {
    flex: 1;
}

/* Контент табов */
.profile-tab-content {
    padding-top: 10px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    text-align: left;
    width: 100%;
}

.action-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.action-btn:hover i {
    color: white;
}

.action-btn i {
    font-size: 1.2rem;
    color: var(--accent);
    width: 24px;
}

.tab-profile-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.tab-profile-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tab-profile-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.tab-profile-section h4 i {
    color: var(--accent);
}

.car-details {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.car-photo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.car-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-photo i {
    font-size: 2rem;
    color: var(--accent);
}

.car-specs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-value {
    font-weight: 500;
    color: var(--text-primary);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.price-input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: center;
}

/* Telegram настройки */
.telegram-tab-content {
    padding-top: 10px;
}

.tg-setup {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.tg-setup h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.tg-setup h4 i {
    color: var(--accent);
}

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.step-content h5 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.step-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Статистика */
.stats-tab-content {
    padding-top: 10px;
}

.stats-period {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.period-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 0.9rem;
}

.period-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.stats-overview {
    margin-bottom: 25px;
}

.stats-details {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.stats-details h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.stats-details h4 i {
    color: var(--accent);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-orders {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.recent-orders h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.recent-orders h4 i {
    color: var(--accent);
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-rating {
    color: var(--warning);
    font-weight: 600;
}

/* Карточка водителя */
.driver-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.driver-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.driver-details {
    flex: 1;
}

.driver-details h3 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
}

.driver-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--warning);
}

.driver-rating i {
    font-size: 1rem;
}

.rating-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.car-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Статус водителя */
.driver-status-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.driver-status-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator.offline {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-text {
    flex: 1;
    font-weight: 500;
    font-size: 1.1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 34px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: var(--accent);
}

.switch input:checked + .slider:before {
    transform: translateX(30px);
}

.driver-stats {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.stat {
    text-align: center;
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Тариф */
.tariff-info {
    margin-top: 20px;
}

.tariff-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.tariff-status.inactive {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.tariff-status i {
    font-size: 1.5rem;
    color: var(--accent);
}

.tariff-status.inactive i {
    color: var(--danger);
}

.tariff-status h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.tariff-status p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tariff-status .btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Табы */
.tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Выбор города */
.city-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.city-selector .form-select {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.city-selector .btn.icon-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Фильтры */
.filters {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-tag {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.filter-tag.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.sort-dropdown select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Лента заказов */
.orders-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.order-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.order-item.tg-order {
    border-left: 4px solid var(--accent);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-id {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.order-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.order-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.price-badge {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success);
}

.price-badge small {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: normal;
}

.distance {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 12px;
}

.order-route {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.route-point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.route-point i {
    color: var(--accent);
    margin-top: 2px;
    font-size: 0.9rem;
}

.route-point.from i {
    color: var(--success);
}

.order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 12px;
}

.meta-item i {
    font-size: 0.8rem;
}

.driver-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn.outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn.outline:hover {
    background: var(--accent);
    color: white;
}

/* Контакты в заказе */
.order-contacts {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.contact-item i {
    color: var(--accent);
    font-size: 1.1rem;
    width: 20px;
}

.contact-phone, .contact-telegram {
    flex: 1;
    font-weight: 500;
}

.btn.icon-btn.small {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.order-status {
    margin-top: 10px;
}

/* Уведомление Telegram */
.tg-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 136, 204, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 136, 204, 0.2);
}

.tg-notice i {
    font-size: 2rem;
    color: #0088cc;
}

.tg-notice h5 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.tg-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.weekly-stats {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.weekly-stats h5 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-orders {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.recent-orders h5 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.history-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-id {
    font-weight: 600;
    color: var(--text-primary);
}

.history-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-route {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-price {
    font-weight: 600;
    color: var(--success);
}

.history-status {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.history-status.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Модальные окна */
.modal-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.price-comparison {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 15px;
    margin: 20px 0;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.comparison-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comparison-item.difference {
    font-weight: 600;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--border);
}

.price-original {
    color: var(--text-primary);
    font-weight: 600;
}

.price-offer {
    color: var(--accent);
    font-weight: 600;
}

.price-diff {
    font-weight: 700;
}

.price-diff.positive {
    color: var(--success);
}

.price-diff.negative {
    color: var(--danger);
}

.tariff-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.tariff-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.tariff-option.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.tariff-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.tariff-header i {
    font-size: 1.8rem;
    color: var(--accent);
}

.tariff-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.tariff-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    margin-bottom: 15px;
}

.tariff-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tariff-features p {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.tariff-features i {
    color: var(--success);
}

.order-preview-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.order-id-modal {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-price-modal {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 20px;
}

.order-route-modal {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-details-modal {
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: var(--radius-md);
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

.order-details-modal p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.order-details-modal i {
    color: var(--accent);
    font-size: 1.1rem;
}

/* Загрузка и пустые состояния */
.loading-orders, .empty-orders {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.loading-orders i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent);
}

.empty-orders i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.empty-orders p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.offer-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    color: var(--warning);
    font-size: 0.9rem;
}

.offer-status i {
    animation: spin 1s linear infinite;
}

/* Адаптивность для модуля водителя */
@media (max-width: 400px) {
    .photo-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .car-details {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .car-specs {
        width: 100%;
    }
    
    .spec-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .tg-setup {
        padding: 15px;
    }
    
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .stats-period {
        justify-content: space-between;
    }
    
    .period-btn {
        flex: 1;
        text-align: center;
    }
    
    .driver-info {
        flex-direction: column;
        text-align: center;
    }
    
    .driver-photo {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        min-width: calc(50% - 8px);
    }
    
    .order-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .meta-item {
        width: fit-content;
    }
}

@media (max-width: 360px) {
    .modal-content.wide {
        max-width: 100%;
        margin: 10px;
    }
    
    .upload-area {
        height: 100px;
        padding: 15px;
    }
    
    .upload-area i {
        font-size: 1.5rem;
    }
    
    .upload-area span {
        font-size: 0.8rem;
    }
    
    .rejection-actions {
        flex-direction: column;
    }
    
    .driver-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tariff-option {
        padding: 15px;
    }
    
    .tariff-price {
        font-size: 1.8rem;
    }
}
/* FIX: поле цены в пассажирской форме */
.price-input-group,
.price-input-group * {
  pointer-events: auto;
}

.price-input-group .currency,
.price-input-group .required-badge,
.price-input-group i {
  pointer-events: none;
}

#offer-price {
  position: relative;
  z-index: 5;
  cursor: text;
}

/* =========================================
   UI FIXES: passenger / active order
   ========================================= */

.section-content,
.passenger-content,
.order-form,
.active-order-card,
.order-card,
.driver-card {
  box-sizing: border-box;
}

#content-container {
  min-height: auto !important;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-header h2,
.section-title {
  margin: 0;
  line-height: 1.15;
}

.back-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

/* форма нового заказа */
.order-form,
.passenger-form,
.form-card {
  background: #fff;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.form-group,
.input-group {
  margin-bottom: 14px;
}

.input-group {
  position: relative;
}

.input-group input,
.input-group textarea,
.input-group select,
#from,
#to,
#phone,
#offer-price {
  width: 100%;
  min-height: 54px;
  border: 1px solid #dbe3ef;
  background: #fff;
  border-radius: 16px;
  padding: 0 16px 0 46px;
  font-size: 17px;
  color: #1f2937;
  outline: none;
  box-shadow: none;
}

#offer-price {
  padding-left: 16px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.input-group input::placeholder,
#from::placeholder,
#to::placeholder,
#phone::placeholder,
#offer-price::placeholder {
  color: #97a3b6;
  opacity: 1;
}

.input-group input:focus,
#from:focus,
#to:focus,
#phone:focus,
#offer-price:focus {
  border-color: #4a7dff;
  box-shadow: 0 0 0 4px rgba(74, 125, 255, 0.12);
}

.input-group i,
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
}

.required-badge,
.required-label {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 1;
  color: #ff6b6b;
  background: #fff1f1;
  border-radius: 999px;
  padding: 6px 8px;
  pointer-events: none;
}

.options-card,
.options-block {
  background: #fff;
  border: 1px solid #e8eef7;
  border-radius: 20px;
  padding: 8px 0;
  margin-bottom: 16px;
}

.option-toggle,
.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  cursor: pointer;
}

.option-toggle + .option-toggle,
.option-item + .option-item {
  border-top: 1px solid #edf2f8;
}

.option-toggle i,
.option-item i {
  color: #4a7dff;
  font-size: 20px;
}

.price-input-group {
  position: relative;
  margin-bottom: 12px;
}

.price-hint,
.similar-price-hint {
  border-left: 4px solid #4a7dff;
  background: #eef4ff;
  color: #50627a;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  margin-top: 10px;
}

.price-hint strong,
.similar-price-hint strong {
  color: #2563eb;
}

.publish-btn,
#publish-order-btn {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.publish-btn:disabled,
#publish-order-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* активный заказ */
#active-order,
.active-order-card {
  background: #fff;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin-bottom: 16px;
}

.active-order-card .driver-header,
#active-order .driver-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.active-order-card .driver-avatar,
#active-order .driver-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex: 0 0 72px;
  object-fit: cover;
}

.active-order-card .driver-meta,
#active-order .driver-meta {
  flex: 1;
  min-width: 0;
}

.active-order-card .driver-meta h3,
#active-order .driver-meta h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  line-height: 1.2;
}

.active-order-card .driver-meta .sub,
#active-order .driver-meta .sub {
  color: #7b8798;
  font-size: 14px;
  margin-bottom: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-badge.waiting {
  background: #fff7e8;
  color: #d97706;
}

.status-badge.success {
  background: #eafbf1;
  color: #16a34a;
}

.order-route {
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  margin: 14px 0;
}

.order-route .route-point {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.order-route .route-point + .route-point {
  margin-top: 12px;
}

.order-route .route-label {
  min-width: 26px;
  color: #64748b;
  font-weight: 700;
}

.order-extra {
  background: #f8fafc;
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 12px;
  color: #334155;
}

.order-price {
  text-align: center;
  font-size: 44px;
  line-height: 1;
  font-weight: 800;
  color: #10b981;
  margin: 18px 0 6px;
}

.order-price small {
  font-size: 20px;
  font-weight: 700;
}

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

.order-actions button {
  flex: 1;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
}

/* убираем лишнюю пустоту */
#active-order .spacer,
.active-order-card .spacer,
.empty-gap {
  display: none !important;
}

/* мобильная плотность */
@media (max-width: 480px) {
  .order-form,
  .passenger-form,
  .form-card,
  #active-order,
  .active-order-card {
    border-radius: 20px;
    padding: 14px;
  }

  .section-header h2,
  .section-title {
    font-size: 18px;
  }

  .order-price {
    font-size: 38px;
  }
}
