/* Основные стили для MPlogistic v2 */

/* CSS переменные для светлой темы (по умолчанию) */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #f9fafb;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --button-primary: #8B5CF6;
    --button-primary-hover: #7c3aed;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

/* CSS переменные для темной темы */
body.dark-theme {
    --bg-primary: #1c1c1e;
    --bg-secondary: #2c2c2e;
    --bg-tertiary: #38383a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --text-tertiary: #636366;
    --border-color: #48484a;
    --border-light: #38383a;
    --input-bg: #2c2c2e;
    --input-border: #48484a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --button-primary: #8B5CF6;
    --button-primary-hover: #9f7aea;
    --success-color: #34d399;
    --error-color: #f87171;
    --warning-color: #fbbf24;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
}

/* Заголовок */
.app-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.app-header p {
    font-size: 14px;
    opacity: 0.9;
}

/* Индикатор тестовой версии */
.test-banner {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    margin: 16px 20px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Секции */
.calculation-section,
.directions-section,
.client-section {
    padding: 20px;
}

.calculation-section h2,
.client-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Компактная форма */
.compact-form {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-select,
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--button-primary);
}

.form-select:disabled,
.form-input:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Специальный стиль для города отправления - выглядит как обычный текст */
#departure-city:disabled {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0;
    margin-left: 5px;
    font-size: inherit;
    font-weight: 500;
    cursor: default;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline;
}

/* Размещение города отправления на одной строке с label */
#departure-city:disabled + * {
    display: inline-block;
}

/* Стили для группировки направлений (складов) */
.form-select optgroup {
    font-weight: bold;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    font-size: 14px;
    padding: 8px 0;
}

.form-select optgroup option {
    font-weight: normal;
    color: var(--text-primary);
    background: var(--bg-primary);
    padding: 8px 12px;
    margin-left: 16px;
}

/* Стили для одиночных направлений (жирный текст города) */
.form-select option[style*="font-weight: bold"] {
    background: var(--bg-tertiary);
    color: var(--button-primary);
    font-weight: 600;
}

/* Иконки для разных типов складов */
.form-select option:before {
    margin-right: 8px;
}

/* Поля дат */
.dates-section {
    margin-bottom: 16px;
}

.dates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-field:hover {
    background: var(--bg-secondary);
    border-color: var(--button-primary);
}

.date-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.date-field input[type="date"] {
    cursor: pointer;
}

/* Отменяем стандартные стили input внутри date-field */
.date-field .form-input {
    border: none;
    background: transparent;
    padding: 8px 0;
    margin: 0;
}

.date-field .form-input:focus {
    outline: none;
    border: none;
}

/* Мобильная адаптация */
@media (max-width: 640px) {
    .dates-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Контейнер коробок и паллет */
.packages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.package-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.package-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.package-type input[type="radio"] {
    width: 18px;
    height: 18px;
}

.package-type label {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    cursor: pointer;
}

.package-size-select,
.package-weight-select {
    min-width: 140px;
}

.custom-size-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.custom-size-inputs input {
    width: 60px;
    padding: 6px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.custom-size-inputs span {
    font-size: 14px;
    color: var(--text-secondary);
}

.package-quantity {
    width: 80px;
}

.package-remove {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.package-remove:hover {
    background: var(--error-color);
    opacity: 0.8;
}

.btn-add-package {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-add-package:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-add-package:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Услуги */
.services-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.service-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.service-item label {
    flex: 1;
    margin: 0;
    font-size: 14px;
    cursor: pointer;
}

.service-price {
    font-weight: 600;
    color: #8B5CF6;
}

/* Количественные услуги - стили для унификации с обычными услугами */
.service-item.quantitative {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;  /* как у обычных услуг */
    background: var(--bg-tertiary);
    border-radius: 6px;  /* как у обычных услуг */
    border: 1px solid var(--border-color);
}

.service-name {
    font-size: 14px;      /* меньше, как у обычных услуг */
    font-weight: 600;     /* жирнее */
    color: var(--text-primary);
}

.service-quantity-block {
    display: flex;
    align-items: center;
    gap: 6px;  /* меньше размер */
}

.quantity-label {
    font-size: 12px;  /* меньше */
    font-weight: 500;
    color: var(--text-secondary);
}

.service-quantity-block .form-input {
    width: 60px;      /* меньше размер ячейки */
    padding: 4px 8px; /* меньше padding */
    font-size: 14px;
}

.service-total-block .total-price {
    font-weight: 600;    /* жирнее */
    color: var(--button-primary);     /* фиолетовые рубли, как у обычных услуг */
    font-size: 14px;    /* меньше размер */
}

/* Предварительный расчет */
.calculation-preview {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.price-display {
    margin: 10px 0;
}

.price-display span {
    font-size: 24px;
    font-weight: 700;
    color: var(--button-primary);
}

/* Кнопки */
.btn-add,
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-add {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-add:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-add:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Список направлений */
.directions-section {
    background: var(--bg-primary);
    margin: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.directions-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.direction-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.direction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.direction-title {
    font-weight: 600;
    color: var(--text-primary);
}

.direction-price {
    font-weight: 700;
    color: var(--button-primary);
    font-size: 16px;
}

.direction-details {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.direction-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direction-remove:hover {
    background: var(--error-color);
    opacity: 0.8;
}

/* Общий расчет */
.total-calculation {
    border-top: 2px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
    text-align: center;
}

.total-price {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.total-price span {
    color: var(--button-primary);
}

/* Форма клиента */
.client-form-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

/* Автозаполнение */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.suggestion-item:hover {
    background: var(--bg-tertiary);
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Итоговая сводка */
.final-summary {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.final-summary h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.final-total {
    text-align: center;
    font-size: 18px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.final-total span {
    color: var(--button-primary);
}

/* Действия формы */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions .btn-secondary,
.form-actions .btn-primary {
    flex: 1;
}

/* Сообщение об успехе */
.success-section {
    padding: 40px 20px;
    text-align: center;
}

.success-content {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 40px 20px;
    box-shadow: var(--shadow-md);
}

.success-content h2 {
    color: var(--success-color);
    margin-bottom: 16px;
}

.success-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Адаптивность */
@media (max-width: 480px) {
    .app-header {
        padding: 16px;
    }
    
    .calculation-section,
    .directions-section,
    .client-section {
        padding: 16px;
    }
    
    .compact-form,
    .client-form-container {
        padding: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .direction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .package-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .package-type {
        width: 100%;
    }
    
    .custom-size-inputs {
        width: 100%;
        justify-content: space-between;
    }
    
    .custom-size-inputs input {
        flex: 1;
        max-width: 70px;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.direction-item {
    animation: slideIn 0.3s ease-out;
}

/* Индикатор загрузки */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

body.dark-theme .loading-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.loading-spinner {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--button-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Disclaimer стили */
.disclaimer {
    background: rgba(245, 158, 11, 0.1); /* Светлый желтый фон с прозрачностью */
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
}

.disclaimer p {
    margin: 0;
    color: #92400e; /* Темно-коричневый текст для светлой темы */
    font-size: 13px;
    line-height: 1.5;
}

.disclaimer p small {
    font-size: inherit; /* Наследуем размер от родителя, чтобы текст не был слишком мелким */
}

/* Disclaimer для темной темы */
body.dark-theme .disclaimer {
    background: rgba(251, 191, 36, 0.15); /* Более яркий желтый для темной темы */
    border: 1px solid rgba(251, 191, 36, 0.3);
}

body.dark-theme .disclaimer p {
    color: #fef3c7; /* Светло-желтый текст для темной темы */
}

/* Скрытие элементов */
.hidden {
    display: none !important;
}

/* Индикатор загрузки */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-content {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.loading-spinner {
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--button-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Кастомные уведомления */
.custom-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    max-width: 90%;
    width: 400px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.custom-notification.error {
    border-left: 4px solid var(--error-color);
}

.custom-notification.success {
    border-left: 4px solid var(--success-color);
}

.custom-notification.info {
    border-left: 4px solid var(--button-primary);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    margin-left: 8px;
    flex-shrink: 0;
}

.notification-close:hover {
    color: var(--text-primary);
}

/* Подсветка невалидных полей */
.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-input.invalid:focus,
.form-select.invalid:focus,
.form-textarea.invalid:focus {
    border-color: var(--button-primary) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1) !important;
}

/* Стили для дат в форме расчета */
.dates-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    background-color: var(--bg-tertiary);
}

.dates-section > label {
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
    color: var(--text-primary);
}

.dates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.date-field {
    display: flex;
    flex-direction: column;
}

.date-field label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.date-field .form-input {
    background-color: var(--input-bg);
}

/* Стили для валидации ИНН */
.validation-message {
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
    font-weight: 500;
}

.validation-message.error {
    color: var(--error-color);
}

.validation-message.success {
    color: var(--success-color);
}

/* Стили для чекбокса согласия */
.consent-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    transition: all 0.2s ease;
}

.checkbox-container:hover {
    background-color: var(--bg-secondary);
    border-color: var(--input-border);
}

.checkbox-container input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: var(--button-primary);
    min-width: 16px;
}

.checkbox-container span:not(.checkmark) {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Индивидуальные стили для чекбокса */
.checkbox-container input[type="checkbox"]:checked + span {
    color: var(--button-primary);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .dates-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .dates-section {
        padding: 12px;
        margin: 12px 0;
    }
    
    .checkbox-container {
        padding: 12px;
    }
    
    .checkbox-container span:not(.checkmark) {
        font-size: 13px;
    }
}

/* Дополнительные стили для улучшения UX */
.dates-section:focus-within {
    border-color: var(--button-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.checkbox-container input[type="checkbox"]:focus {
    outline: 2px solid var(--button-primary);
    outline-offset: 2px;
}

/* Стили для множественных телефонов */
.phones-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phone-input-group {
    position: relative;
}

.phone-input-group input {
    width: 100%;
}

/* ========================================
   Стили для графиков отгрузок
   ======================================== */

/* Информационный блок о графике отгрузок */
.schedule-info {
    margin-top: 12px;
    padding: 14px 16px;
    background-color: #E3F2FD;
    border-left: 4px solid #2196F3;
    border-radius: 6px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.schedule-info .info-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #1565C0;
}

.schedule-info .info-text strong {
    font-weight: 600;
    color: #0D47A1;
}

.schedule-info small {
    display: block;
    margin-top: 6px;
    color: #424242;
    font-size: 12px;
    line-height: 1.5;
}

/* Темная тема для блока графика */
body.dark-theme .schedule-info {
    background-color: rgba(33, 150, 243, 0.15);
    border-left-color: #42A5F5;
}

body.dark-theme .schedule-info .info-text {
    color: #90CAF9;
}

body.dark-theme .schedule-info .info-text strong {
    color: #BBDEFB;
}

body.dark-theme .schedule-info small {
    color: #B0BEC5;
}

/* Поле даты только для чтения (readonly) */
input[type="date"][readonly] {
    background-color: #F5F5F5;
    cursor: not-allowed;
    color: #6b7280;
}

body.dark-theme input[type="date"][readonly] {
    background-color: rgba(255, 255, 255, 0.05);
    color: #a1a1a6;
}

/* Визуальный календарь недели */
.week-schedule {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.day-cell {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: default;
}

.day-cell .day-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.day-cell .day-status {
    width: 100%;
    height: 24px;
    border-radius: 4px;
    background: var(--bg-secondary);
    transition: background-color 0.2s ease;
}

/* Состояния дней */
.day-cell.pickup .day-status {
    background: #10b981; /* Зеленый - приемка */
}

.day-cell.delivery .day-status {
    background: #ef4444; /* Красный - выгрузка (день отгрузки) */
}

.day-cell.no-reception .day-status {
    background: #f59e0b; /* Оранжевый - нет приемки */
}

/* День с приемкой И выгрузкой - разделенный квадратик */
.day-cell.both .day-status {
    background: linear-gradient(to bottom, #10b981 0%, #10b981 50%, #ef4444 50%, #ef4444 100%);
}

/* Темная тема для календаря */
body.dark-theme .week-schedule {
    background: var(--bg-secondary);
}

body.dark-theme .day-cell {
    background: var(--bg-tertiary);
}

body.dark-theme .day-cell .day-status {
    background: var(--bg-primary);
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .day-cell {
        padding: 6px 2px;
    }

    .day-cell .day-name {
        font-size: 10px;
    }

    .day-cell .day-status {
        height: 20px;
    }
}

/* ========================================
   Стили для блока выбора даты выгрузки
   ======================================== */

#delivery-date-selector {
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Карточка варианта даты */
.date-option-card {
    display: block;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-option-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.date-option-card input[type="radio"] {
    display: none;
}

.card-content {
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-emoji {
    font-size: 16px;
    flex-shrink: 0;
}

.date-text {
    flex: 1;
}

.date-badge {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.card-warning {
    margin-top: 6px;
    margin-left: 24px;
    font-size: 11px;
    color: #dc2626;
    line-height: 1.4;
}

.card-success {
    margin-top: 6px;
    margin-left: 24px;
    font-size: 11px;
    color: #16a34a;
    font-weight: 500;
    line-height: 1.4;
}

/* Оранжевая карточка (-24ч) */
.option-risky {
    border-color: #f97316;
}

.option-risky:hover {
    background: #fff7ed;
    border-color: #f97316;
}

.option-risky.active {
    border-color: #f97316;
    border-width: 4px;
    background: #ffedd5;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 12px rgba(249, 115, 22, 0.3);
    transform: scale(1.02);
}

/* Зеленая карточка (основная, рекомендуемая) */
.option-recommended {
    border-color: #10b981;
}

.option-recommended:hover {
    background: #f0fdf4;
    border-color: #10b981;
}

.option-recommended.active {
    border-color: #10b981;
    border-width: 4px;
    background: #d1fae5;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25), 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: scale(1.02);
}

/* Желтая карточка (+24ч) */
.option-safe {
    border-color: #fbbf24;
}

.option-safe:hover {
    background: #fefce8;
    border-color: #fbbf24;
}

.option-safe.active {
    border-color: #fbbf24;
    border-width: 4px;
    background: #fef3c7;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25), 0 4px 12px rgba(251, 191, 36, 0.3);
    transform: scale(1.02);
}

/* Темная тема для карточек */
body.dark-theme #delivery-date-selector {
    background: var(--bg-secondary);
}

body.dark-theme .date-option-card {
    background: var(--bg-tertiary);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .option-risky.active {
    background: rgba(249, 115, 22, 0.25);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.3), 0 4px 12px rgba(249, 115, 22, 0.4);
    transform: scale(1.02);
}

body.dark-theme .option-recommended.active {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: scale(1.02);
}

body.dark-theme .option-safe.active {
    background: rgba(251, 191, 36, 0.25);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3), 0 4px 12px rgba(251, 191, 36, 0.4);
    transform: scale(1.02);
}

body.dark-theme .card-warning {
    color: #f97316;
}

body.dark-theme .card-success {
    color: #34d399;
}
