/* ==================== ОБЩИЕ СТИЛИ ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
  text-decoration: none;
 }

/* ==================== ОСНОВНЫЕ КОМПОНЕНТЫ ==================== */

/* Заголовок страницы */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1d21;
    margin: 0;
}

/* Блок информации о пользователе */
/* Блок информации о пользователе */
.user-info-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-info-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Это выровняет текст слева, кнопку справа */
    gap: 12px;
}

.user-info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    flex: 1; /* Занимает всё доступное пространство */
}



/* Иконки */
.info-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0; /* Фиксированная ширина для иконки */
}


/* Блок баланса */
.balance-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.balance-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-direction: column;
}

.balance-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.balance-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.balance-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* Карточки заявок */
.order-section {
    background: white;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0;
    margin-bottom: 12px;
}

.order-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1d21;
}

.order-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-monitoring {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.status-booked {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.status-cancelled, .status-time_is_up {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.status-queue {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.status-authorization {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); /* фиолетовый для ожидания пользователя */
}

.status-cancellation_request {
    background: linear-gradient(135deg, #8b9cf6 0%, #7c9aed 100%) !important; /* оранжевый для запроса на отмену */
}

.order-content {
    padding: 0 20px 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

.full-width {
    grid-column: 1 / -1;
}

/* Смены */
.shifts-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f3f4;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.shifts-container {
    display: grid;
    gap: 8px;
}

.shift-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.shift-booked {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #10b981;
    border-left: 4px solid #10b981;
}

.shift-date {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.shift-time {
    font-size: 13px;
    color: #6b7280;
}

.shift-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #10b981;
    color: white;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    margin-left: auto;
    margin-right: 10px;
}

.badge-text {
    font-weight: 500;
}

/* Прогресс бронирования */
.booking-progress {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f3f4;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6b7280;
}

.progress-count {
    font-weight: 600;
    color: #1f2937;
}

.progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Мониторинг */
/*.monitoring-settings-item {*/
/*    margin-bottom: 8px;*/
/*}*/

.monitoring-display-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.monitoring-time {
    font-weight: 600;
    color: #1f2937;
    /*background: #f8fafc;*/
    /*padding: 4px 8px;*/
    /*border-radius: 6px;*/
    /*border: 1px solid #e5e7eb;*/
}

.change-monitoring-btn-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
    font-size: 12px;
    padding: 0;
}

.change-monitoring-btn-compact:hover {
    background: #e9ecef;
    border-color: #0088cc;
    color: #0088cc;
    transform: scale(1.05);
}

/* Пустые состояния */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    color: #6b7280;
    margin-bottom: 24px;
}

.empty-hint {
    color: #6b7280;
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
    /*max-width: 300px;*/
    line-height: 1.4;
}

/* ==================== КНОПКИ ==================== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
    min-height: 30px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-secondary {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #d1d5db;
}

.btn-outline {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/*.btn-cancel {*/
/*    background: linear-gradient(135deg, #44c7ef 0%, #2675dc 100%);*/
/*    color: white;*/
/*    border: none;*/
/*}*/

/*.btn-cancel:hover {*/
/*    background: linear-gradient(135deg, #2675dc 0%, #1c53b9 100%);*/
/*}*/

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-text {
    font-weight: 600;
}

.btn-icon {
    font-size: 16px;
}

.btn-mobile-full {
    min-width: auto;
}

/* ==================== ФОРМЫ ==================== */
.order-form {
    padding: 0 24px 24px;
}

.form-section {
    margin-bottom: 24px;
    padding: 20px;
    background: #fafbfc;
    border-radius: 12px;
    border: 1px solid #f1f3f4;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.section-icon {
    font-size: 18px;
    margin-right: 8px;
}

.section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1d21;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.label-text {
    font-size: 14px;
}

.required {
    color: #ef4444;
    margin-left: 2px;
}

.select-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    appearance: none;
    transition: all 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
    font-size: 12px;
}

.form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
}

/* Даты */
.dates-container {
    display: grid;
    gap: 12px;
}

.date-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.date-card:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.date-card.selected {
    border-color: #10b981;
    background: #f0fdf4;
}

.date-card.required {
    border-color: #f59e0b;
    background: #fffbeb;
}

.date-checkbox {
    position: relative;
    margin-right: 12px;
}

.date-checkbox input {
    position: absolute;
    opacity: 0;
}

.checkbox-display {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.date-card.selected .checkbox-display {
    background: #10b981;
    border-color: #10b981;
}

.date-card.selected .checkbox-display::after {
    content: "✓";
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.date-content {
    flex: 1;
}

.date-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.date-value {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.date-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f59e0b;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Время */
.times-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.time-card {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.time-card:hover {
    border-color: #3b82f6;
}

.time-card.selected {
    border-color: #10b981;
    background: #f0fdf4;
}

.time-checkbox {
    position: relative;
    margin-right: 8px;
}

.time-checkbox input {
    position: absolute;
    opacity: 0;
}

.time-checkbox .checkbox-display {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.time-card.selected .checkbox-display {
    background: #10b981;
    border-color: #10b981;
}

.time-card.selected .checkbox-display::after {
    content: "✓";
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.time-content {
    flex: 1;
}

.time-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.time-period {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

/* Ввод времени */
.time-inputs {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.time-inputs .select-wrapper {
    flex: 1;
}

.time-inputs-large {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

.time-select {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.time-preview {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #e2e8f0;
}

.preview-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.preview-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Стоимость */
.price-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #e2e8f0;
}

.price-summary {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-line.total {
    margin-bottom: 0;
}

.price-label {
    font-size: 14px;
    color: #374151;
}

.price-value {
    font-weight: 600;
    color: #1f2937;
}

.price-line.total .price-label {
    font-weight: 600;
    font-size: 16px;
}

.price-line.total .price-value {
    font-size: 18px;
    color: #059669;
}

.price-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 12px 0;
}

/* Действия формы */
.form-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-top: 24px;
}

/* ==================== МОДАЛЬНЫЕ ОКНА ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow-x: hidden;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid #e1e5e9;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1d21;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    min-width: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 0 24px 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Специфичные модальные окна */

/* Пополнение баланса */
.deposit-input {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.deposit-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.quick-amount {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-amount:hover {
    border-color: #3b82f6;
    background-color: #f0f9ff;
}

.quick-amount.selected {
    border-color: #3b82f6;
    background-color: #3b82f6;
    color: white;
}

/* Склад */
.search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.warehouse-results {
    max-height: 300px;
    overflow-y: auto;
    /*border: 1px solid #e0e0e0;*/
    /*border-radius: 8px;*/
    padding: 8px;
    margin-bottom: 5px;
}

.warehouse-result-item {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.warehouse-result-item:hover {
    border-color: #0088cc;
    background-color: #f0f8ff;
}

.warehouse-result-item.selected {
    border-color: #0088cc;
    background-color: #e3f2fd;
}

.not-found-message {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 16px 0;
}

.not-found-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.support-link {
    color: #0088cc;
    text-decoration: none;
    font-weight: 500;
}

.support-link:hover {
    text-decoration: underline;
}


/* История баланса */
.history-filters {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.filter-btn:hover:not(.active) {
    border-color: #3b82f6;
    color: #3b82f6;
}

.history-stats {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat-value {
    font-weight: 600;
    font-size: 16px;
}

.stat-value.income {
    color: #10b981;
}

.stat-value.expense {
    /*color: #ef4444;*/
    color: #1f2937;
}

.history-item {
    border-bottom: 1px solid #f3f4f6;
    padding: 16px 0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-item.outflow-item {
    background: #fef2f2;
    border-left: 4px solid #1f2937;
    /*border-left: 4px solid #ef4444;*/
    margin: 8px 0;
    border-radius: 0 8px 8px 0;
}

.history-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.history-info {
    flex: 1;
}

.history-description {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
}

.history-date {
    font-size: 12px;
    color: #6b7280;
}

.history-amount {
    font-weight: 600;
    font-size: 16px;
}

.history-amount-positive {
    color: #10b981;
}

.history-amount-negative {
    /*color: #ef4444;*/
    color: #1f2937;
}

.history-order-details {
    margin-top: 8px;
    padding-left: 36px;
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.order-detail {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.history-pagination {
    margin-top: 16px;
    text-align: center;
}

.loading-state {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Подтверждение */
.confirm-modal-body {
    padding: 20px;
}

.confirm-modal-body p {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 20px;
    text-align: center;
    color: #374151;
}

/* Кнопка "Изменить" */
.back-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
    font-family: inherit;
    flex-shrink: 0; /* Не позволяет кнопке сжиматься */
    margin-bottom: 10px;
}

.back-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}


/* ==================== TOAST УВЕДОМЛЕНИЯ ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    width: auto;
    border-left: 4px solid #3b82f6;
}

.toast.info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.toast.success {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.toast.error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.toast.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-line;
    max-height: 200px;
    overflow-y: auto;
}

/* ==================== ПРЕЛОАДЕР ==================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    transform: translateY(-50px);
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
    position: relative;
}

.loader-spinner:after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid transparent;
    border-radius: 50%;
    border-top-color: #0056b3;
    animation: spin 2s ease-in-out infinite;
}

.loader-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* Блокировка интерфейса при загрузке */
body.loading {
    overflow: hidden;
    pointer-events: none;
}

body.loading * {
    pointer-events: none !important;
}

/* ==================== АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ ==================== */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    /* Общие улучшения для мобильных */
    .modal {
        padding: 10px;
        align-items: flex-start;
    }

    .modal-content {
        width: 95vw;
        max-width: 95vw;
        margin: 0;
        max-height: 85vh;
    }

    .modal-body {
        padding: 0 16px 16px;
        max-height: calc(85vh - 60px);
    }

    .modal-header {
        padding: 20px 16px 0;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    /* Баланс */
    .balance-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .balance-main {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .balance-info {
        text-align: center;
    }

    .balance-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .balance-amount {
        font-size: 24px;
    }

    .balance-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-mobile-full {
        width: 100%;
        justify-content: center;
    }

    /* Заголовок страницы */
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    /* Карточки заявок */
    .order-content {
        padding: 0 16px 16px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Формы */
    .order-form {
        padding: 0 16px 16px;
    }

    .form-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Даты и время */
    .dates-container {
        gap: 8px;
    }

    .date-card {
        padding: 12px;
    }

    .times-container {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Время мониторинга */
    .time-inputs-large {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 12px 0;
    }

    .time-preview {
        padding: 12px;
        margin: 12px 0;
    }

    .preview-value {
        font-size: 16px;
    }

    /* Пополнение баланса */
    .quick-amounts {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 16px 0;
    }

    .quick-amount {
        padding: 10px 8px;
        font-size: 14px;
    }

    /* История баланса */
    .filter-buttons {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .history-item-main {
        align-items: flex-start;
    }

    .history-order-details {
        flex-direction: column;
        gap: 4px;
    }

    /* Склад */
    .warehouse-results {
        max-height: 50vh;
        margin: 0 -8px;
    }

    /* Toast */
    .toast {
        top: 10px;
        max-width: 95%;
        padding: 14px;
    }


    /* Улучшения для касаний */
    .btn:active {
        transform: scale(0.98);
    }

    .toast {
    max-width: 95%;
    padding: 12px;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-message {
        font-size: 13px;
        max-height: 150px;
    }

    /* Предотвращение зума в iOS */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ==================== ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ ==================== */
@media (max-width: 360px) {
    body {
        padding: 12px;
    }

    .modal-content {
        width: 98vw;
        max-width: 98vw;
    }

    .balance-amount {
        font-size: 22px;
    }

    .times-container {
        grid-template-columns: 1fr;
    }

    .quick-amounts {
        grid-template-columns: 1fr;
    }

    .date-card {
        padding: 10px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* ==================== ПОДДЕРЖКА БЕЗОПАСНЫХ ЗОН ==================== */
@supports(padding: max(0px)) {
    .balance-section, .modal-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .modal-content {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .modal-body {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* ==================== УЛУЧШЕНИЯ СКРОЛЛА ==================== */
.modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}



/* ===================== */


/* Добавим в style.css после существующих стилей */

/* Стили для радиокнопок */
.date-radio, .shift-count-radio {
    position: relative;
    margin-right: 12px;
}

.date-radio input, .shift-count-radio input {
    position: absolute;
    opacity: 0;
}

.radio-display {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.date-card.selected .radio-display,
.shift-count-option.selected .radio-display {
    border-color: #10b981;
    background: #10b981;
}

.date-card.selected .radio-display::after,
.shift-count-option.selected .radio-display::after {
    content: "";
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Контейнер для выбора количества смен */
.shifts-count-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.shift-count-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.shift-count-option:hover {
    border-color: #3b82f6;
}

.shift-count-option.selected {
    border-color: #10b981;
    background: #f0fdf4;
}

.shift-count-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.shift-count-option.disabled:hover {
    border-color: #e5e7eb;
}

.shift-count-content {
    flex: 1;
}

.shift-count-value {
    font-weight: 600;
    color: #1f2937;
    text-align: center;
}

/* Стили для просроченных смен */
.shift-expired {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px solid #dee2e6 !important;
    opacity: 0.7;
}


.shift-badge-expired {
    background: #6c757d !important;
    color: white !important;
}

.shift-badge-expired .badge-text {
    font-weight: 500;
}

/* Убедимся, что забронированные смены имеют приоритет над просроченными */
.shift-booked {
    opacity: 1 !important;
}

.shift-booked.shift-expired {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border: 2px solid #10b981 !important;
    opacity: 1 !important;
}

.shift-booked.shift-expired .shift-date,
.shift-booked.shift-expired .shift-time {
    color: #1f2937 !important;
    text-decoration: none !important;
}

/* Улучшенные стили для toast */
.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: #1f2937;
}



/* Стили для поля ввода кода подтверждения */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

/* Улучшения для мобильных устройств */
@media (max-width: 480px) {
    .form-input {
        font-size: 16px; /* Предотвращает зум в iOS */
        padding: 14px 16px;
    }
}


/* Стили для блока action-buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: 140px;
    flex-shrink: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .action-buttons {
        justify-content: stretch;
        flex-direction: column;
    }

    .action-buttons .btn {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .action-buttons {
        gap: 8px;
    }

    .action-buttons .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}


/* Стили для предупреждающих сообщений */
.warning-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
}

.warning-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.warning-icon {
    font-size: 16px;
    color: #856404;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-text {
    flex: 1;
}

.warning-title {
    font-weight: 600;
    color: #856404;
    font-size: 14px;
    margin-bottom: 4px;
}

.warning-description {
    color: #856404;
    font-size: 13px;
    line-height: 1.4;
}

/* Административная панель (на основе телефона) */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #3b82f6;
    margin: 8px 0;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
}

.admin-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.quick-search {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-form {
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
}

.phone-display {
    font-family: monospace;
    font-weight: 500;
    color: #1f2937;
}

.recent-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-item, .order-item {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:last-child, .order-item:last-child {
    border-bottom: none;
}

.user-info, .order-info {
    flex: 1;
}

.user-actions, .order-actions {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background: #3b82f6;
    color: white;
}

.badge-banned {
    background: #ef4444;
    color: white;
}

.badge-active {
    background: #10b981;
    color: white;
}

.badge-monitoring { background: #3b82f6; color: white; }
.badge-booked { background: #10b981; color: white; }
.badge-cancelled { background: #ef4444; color: white; }
.badge-expired { background: #6b7280; color: white; }
.badge-queue { background: #f59e0b; color: white; }
.badge-auth { background: #8b5cf6; color: white; }

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Адаптивность для админ-панели */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .user-item, .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .user-actions, .order-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        flex-direction: column;
    }

    .admin-nav .btn {
        width: 100%;
        justify-content: center;
    }

    .search-form {
        flex-direction: column;
    }

    .user-stats {
        grid-template-columns: 1fr;
    }
}


.change-phone-btn, .change-warehouse-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    color: #374151;
}

.change-phone-btn:hover, .change-warehouse-btn:hover {
    background: #e9ecef;
    border-color: #0088cc;
}



/* Стили для реферальной программы */
.referral-stats {
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.stat-value.income {
  color: #10b981;
}

.recent-bonuses {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px;
}

.recent-bonuses h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #374151;
}

.bonus-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bonus-item {
  padding: 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.bonus-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.bonus-amount {
  font-weight: 600;
  color: #10b981;
}

.bonus-date {
  font-size: 12px;
  color: #9ca3af;
}

.bonus-desc {
  font-size: 12px;
  color: #6b7280;
}

.referral-link-section {
  margin: 20px 0;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
}

.referral-link-section h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #374151;
}

.referral-link-container {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.referral-link-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: #374151;
}

.referral-hint {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.referral-info {
  margin-top: 20px;
}

.referral-info h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #374151;
}

.referral-steps {
  margin: 0;
  padding-left: 20px;
  list-style-type: none;
}

.referral-steps li {
  position: relative;
  padding: 6px 0;
  padding-left: 30px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.4;
}

.referral-steps li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 18px;
  height: 18px;
  background-color: #3b82f6;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.referral-steps li:nth-child(1):before { content: "1"; }
.referral-steps li:nth-child(2):before { content: "2"; }
.referral-steps li:nth-child(3):before { content: "3"; }
.referral-steps li:nth-child(4):before { content: "4"; }

/* Стили для состояния загрузки и ошибок */
.loading-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.error-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.error-text {
  color: #6b7280;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}



/* Стили для модального окна предупреждения */
.warning-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 0;
}

.warning-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.warning-text {
    font-size: 15px;
    line-height: 1.5;
    color: #374151;
}

.warning-text p {
    margin-bottom: 10px;
}

.support-link {
    margin: 15px 0;
    padding: 10px;
    background-color: #f3f4f6;
    border-radius: 8px;
    font-weight: 500;
}

/* Для мобильных устройств */
@media (max-width: 480px) {
    .warning-content {
        padding: 5px;
    }

    .warning-text {
        font-size: 14px;
    }

    .form-actions {
        flex-direction: column;
    }
}