/* storage-modal.css */

.storage-modal-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.5rem 0;
}

/* Карточка груза */
.storage-cargo-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1rem;
}

.cargo-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cargo-icon {
    font-size: 2rem;
}

.cargo-details {
    flex: 1;
}

.storage-days-badge {
    background: var(--warning-light);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    text-align: center;
    min-width: 80px;
}

.days-number {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.days-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.days-sub {
    font-size: 0.7rem;
    opacity: 0.8;
}

.saved-cost-info {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--background-alt);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-lg);
}

/* Бейджи расчётов */
.calculation-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    background: var(--background-alt);
    border-left: 4px solid;
}

.calculation-badge.individual {
    border-left-color: #f59e0b;
    background: #fef3c7;
}

.calculation-badge.system {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.badge-icon {
    font-size: 1.5rem;
}

.badge-text {
    flex: 1;
}

.badge-text strong {
    display: block;
    font-size: 0.9rem;
}

.badge-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Карточка тарифов */
.storage-tariffs-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tariffs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.tariff-item {
    display: flex;
    gap: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    border: 1px solid var(--border);
}

.tariff-item.individual {
    border-color: #f59e0b;
    background: #fef3c7;
}

.tariff-icon {
    font-size: 1.5rem;
}

.tariff-info {
    flex: 1;
}

.tariff-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tariff-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.tariff-unit {
    font-size: 0.8rem;
    font-weight: normal;
}

.tariff-system {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.tariff-badge {
    font-size: 0.7rem;
    color: #b45309;
    margin-top: 0.25rem;
}

/* Параметры расчёта */
.storage-params-card .card-header {
    margin-bottom: 1rem;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.param-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.param-field label {
    font-weight: 600;
    font-size: 0.85rem;
}

.param-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.individual-field {
    border-color: #f59e0b;
    background: #fef3c7;
}

.individual-hint {
    font-size: 0.7rem;
    color: #b45309;
}

/* Результаты */
.storage-results-card .card-header {
    margin-bottom: 1rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px dashed var(--border);
}

.result-row.total {
    background: var(--success-light);
    border-radius: var(--radius-lg);
    border-bottom: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0.9rem;
}

.result-label {
    flex: 2;
    font-weight: 500;
}

.result-value {
    flex: 1;
    font-weight: 700;
    text-align: right;
}

.result-formula {
    flex: 2;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.result-row.total .result-value {
    font-size: 1.2rem;
    color: var(--success);
}

/* Дополнительные опции */
.storage-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-card {
    background: var(--background-alt);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.option-icon {
    font-size: 1.5rem;
}

.option-title {
    font-weight: 700;
}

.option-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: auto;
}

.option-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.option-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.option-textarea {
    width: 100%;
    margin: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    resize: vertical;
}

.option-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.additional-cost {
    font-size: 0.85rem;
    color: var(--info);
    margin-top: 0.5rem;
}

/* Итоговая сумма */
.storage-total-card {
    background: linear-gradient(135deg, var(--success-light), #d1fae5);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    border: 2px solid var(--success);
}

.total-header {
    margin-bottom: 0.5rem;
}

.total-title {
    font-weight: 700;
    font-size: 1rem;
}

.total-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.total-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success);
}

.total-note {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.saved-note {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Кнопки действий */
.storage-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.actions-left,
.actions-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.storage-location-badge {
    background: var(--primary-light);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--warning);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.param-readonly {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
    cursor: default !important;
    border-color: #d1d5db !important;
    opacity: 0.9;
}

.param-readonly:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #d1d5db !important;
}

/* Адаптивность */
@media (max-width: 768px) {

    .tariffs-grid,
    .storage-options-grid,
    .params-grid {
        grid-template-columns: 1fr;
    }

    .result-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-value {
        text-align: left;
    }

    .storage-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-left,
    .actions-right {
        justify-content: center;
    }
}