/* ============================================
   CSS для грузовых мест (cargo spaces)
   Объединённый файл из двух исходных
   ============================================ */

/* --------------------------------------------
   Переменные
   -------------------------------------------- */
:root {
    /* Основные цвета - более спокойная палитра */
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-dark: #1d4ed8;
    --primary-rgb: 37, 99, 235;

    /* Нейтральные цвета для минимализма */
    --surface: #ffffff;
    --surface-elevated: #fafafa;
    --background: #f8fafc;
    --background-alt: #f1f5f9;

    /* Текст с улучшенной контрастностью */
    --text: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-disabled: #94a3b8;

    /* Границы */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* Статусные цвета - более приглушенные */
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-medium: #db8420;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;

    /* Тени - более мягкие */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Анимации */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Отступы - система 8px (совместимая с основным файлом) */
    --space-xxs: 4px;
    /* --space-1 */
    --space-xs: 8px;
    /* --space-2 */
    --space-sm: 12px;
    /* --space-3 */
    --space-md: 16px;
    /* --space-4 */
    --space-lg: 20px;
    /* --space-5 */
    --space-xl: 24px;
    /* --space-6 */
    --space-2xl: 32px;
    /* --space-8 */

    /* Скругления из основного файла */
    --radius: 15px / 14px;
    --radius-lg: 25px / 24px;
    --radius-sm: 6px / 5px;
    --radius-plateau: 25px;
    --radius-full: 9999px;

    /* Градиенты из основного файла */
    --gradient-primary: linear-gradient(135deg, var(--primary), #587fff);
    --gradient-error: linear-gradient(135deg, var(--error), #b91c1c);
    --gradient-success: linear-gradient(135deg, var(--success), #7aae8c);

    /* Специфичные переменные для грузовых мест (из второго файла) */
    --space-card-bg: #fefefe;
    --space-card-accent: var(--primary);
    --space-metric-bg: #F8FAFC;
    --space-border-light: #E2E8F0;

    --text-xxs: 0.7rem;
    --text-xs: 0.75rem;
    --text-sm: 0.8rem;

}

/* --------------------------------------------
   Контейнер и общие элементы
   -------------------------------------------- */

/* Контейнер грузовых мест (из первого файла) */
.cargo-spaces-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: var(--space-xl);
    background: var(--surface);
    border-radius: var(--radius-lg);
    /* box-shadow: var(--shadow-md); */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.cargo-spaces-container::-webkit-scrollbar {
    width: 8px;
}

.cargo-spaces-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--radius-full);
}

.cargo-spaces-container::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: var(--radius-full);
}

.cargo-spaces-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Заголовок грузовых мест (из второго файла) */
.cargo-spaces-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.cargo-spaces-header .header-left h4 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.cargo-spaces-header .header-left small {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Предупреждение о синхронизации (из второго файла) */
.sync-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.sync-warning-text {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.sync-warning strong {
    color: var(--warning);
}

.discrepancy-details {
    display: flex;
    gap: var(--space-sm);
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    font-size: var(--text-xs);
    padding: var(--space-xs);
}

.sync-button {
    background: var(--warning);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: var(--font-medium);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition);
}

.sync-button:hover {
    background: var(--warning-medium);
    box-shadow: var(--shadow-md);
}

/* --------------------------------------------
   Карточка грузового места (из обоих файлов)
   -------------------------------------------- */

.cargo-space-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    transition: all var(--transition);
    animation: fadeIn 0.3s ease-out;
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cargo-space-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.cargo-space-card:active {
    transform: translateY(0);
}

.cargo-space-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.cargo-space-card:hover::before {
    opacity: 1;
}

/* Акцентная полоса слева */
.space-card-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--space-card-accent);
}

/* Заголовок карточки (из первого файла) */
.cargo-space-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}

.cargo-space-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.cargo-space-subtitle {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 400;
    margin-top: var(--space-xxs);
}

/* Действия (из первого файла) */
.cargo-space-actions {
    display: flex;
    gap: var(--space-xs);
}

/* Структура из второго файла для более детальной карточки */
.space-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xs);
    margin-left: var(--space-sm);
}

.space-card-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}

.space-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
}

.space-card-details {
    flex: 1;
    min-width: 0;
}

.space-card-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    /* margin-bottom: var(--space-xxs); */
}

.space-card-number {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.space-card-type-badge {
    font-size: var(--text-xs);
    padding: var(--space-xxs) var(--space-sm);
    border-radius: var(--radius);
    font-weight: var(--font-semibold);
    background: var(--primary-light);
    color: var(--primary);
}

.space-card-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.space-card-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0.8;
    transition: opacity var(--transition);
}

.cargo-space-card:hover .space-card-actions {
    opacity: 1;
}

.space-action-btn {
    /* background: transparent; */
    border: none;
    font-size: 0.75rem;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.15s;
    color: #475569;
    background: var(--border);
    border: 0.5px solid #eef2f6;
}

.space-action-btn:hover {
    background: #ffffff;
    transform: scale(1.02);
}

.space-action-duplicate:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.space-action-edit:hover {
    background: var(--warning-light);
    border-color: var(--warning);
}

.space-action-delete:hover {
    background: var(--error-light);
    border-color: var(--error);
}

.space-action-icon {
    font-size: var(--text-sm);
}

.space-action-duplicate .space-action-icon {
    color: var(--primary);
}

.space-action-edit .space-action-icon {
    color: var(--warning);
}

.space-action-delete .space-action-icon {
    color: var(--error);
}

/* Метрики карточки */
.space-card-metrics {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-md);
    padding: var(--space-xs);
    background: var(--space-metric-bg);
    border-radius: var(--radius);
    margin-left: var(--space-sm);
}

.space-metric {
    text-align: center;
}

.space-metric-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.space-metric-value {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.space-metric-unit {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.space-metric-total-volume {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.05));
    border-radius: 18px;
}

.space-metric-total-weight {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
    border-radius: 18px;
}

/* Информация о партии */
.space-card-batch-info {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    background: var(--background);
    margin-left: var(--space-lg);
}

.batch-info-content {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.batch-info-label {
    font-weight: var(--font-semibold);
    color: var(--text);
}

.batch-info-divider {
    color: var(--border);
}

/* Теги */
.space-card-tags {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--text-xxs);
}

.tags-content {
    display: flex;
    gap: var(--space-sm);
}

.space-tag {
    padding: var(--space-xxs) var(--space-sm);
    border-radius: var(--radius);
}

.space-tag-density {
    background: var(--primary-light);
    color: var(--primary);
}

.space-tag-size {
    background: var(--info-light);
    color: var(--info);
}

/* Детали карточки (из первого файла) */
.cargo-space-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.cargo-space-detail {
    background: var(--surface-elevated);
    padding: var(--space-sm);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.cargo-space-detail:hover {
    background: var(--background);
    border-color: var(--border);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xxs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.detail-value {
    font-weight: 500;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.4;
}

.detail-value.highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Бейджи (из первого файла) */
.space-badge {
    display: inline-flex;
    align-items: center;
    background: var(--primary-light);
    color: var(--primary);
    padding: var(--space-xxs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: var(--space-xs);
    height: 24px;
    border: 1px solid transparent;
}

.space-badge.success {
    background: var(--success-light);
    color: var(--success);
}

.space-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.space-badge.error {
    background: var(--error-light);
    color: var(--error);
}

/* --------------------------------------------
   Метрики и прогресс (из второго файла)
   -------------------------------------------- */

.metrics-header-block {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
}

.metrics-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
}

.metrics-header-left {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-right: var(--space-xl);
    flex-shrink: 0;
}

.metrics-header-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.metrics-header-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.metrics-header-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.metrics-header-compact {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xl);
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-right: var(--space-xl);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.metric-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.metric-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.metric-item-weight .metric-icon {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
}

.metric-item-volume .metric-icon {
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
}

.metric-item-pieces .metric-icon {
    background: linear-gradient(135deg, #10B981, #059669);
}

.metric-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xxs);
}

.metric-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text);
}

.metric-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

/* Прогресс-бары */
.progress-group-container {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
}

.progress-group-container.compact {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding-bottom: var(--space-sm);
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.progress-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    width: 100%;
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
}

.progress-group-title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-right: var(--space-xl);
    flex-shrink: 0;
}

.progress-group-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.progress-group-heading {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.progress-group-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.progress-group-items {
    position: relative;
    padding-bottom: var(--space-sm);
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.progress-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-md);
    width: 250px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: inline-flex;
    flex-direction: column;
    gap: var(--space-sm);
    transition: all var(--transition);
    vertical-align: top;
    margin-right: var(--space-md);
}

.progress-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.progress-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.progress-card-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
}

.progress-card-title {
    flex: 1;
    min-width: 0;
}

.progress-card-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--text);
    margin-bottom: var(--space-xxs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-card-target {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.progress-card-values {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: var(--space-xxs) 0;
}

.progress-card-current-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: 1;
    color: var(--text);
}

.progress-card-unit {
    font-size: var(--text-xs);
    margin-top: var(--space-xxs);
    color: var(--text-muted);
}

.progress-card-percentage {
    text-align: right;
}

.progress-card-percent {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.progress-card-status {
    font-size: var(--text-xs);
    margin-top: var(--space-xxs);
    color: var(--text-muted);
}

.progress-card-visual {
    margin-top: var(--space-xs);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    margin-bottom: var(--space-xs);
}

.progress-bar-track {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition);
    position: relative;
}

.progress-bar-handle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.progress-bar-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--primary);
}

.progress-card-diff {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-xs);
}

.progress-diff-value {
    font-weight: var(--font-semibold);
    padding: var(--space-xxs) var(--space-xs);
    border-radius: var(--radius-sm);
    background: var(--background-alt);
}

/* Мини-статистика */
.mini-stats-container {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--background);
    font-size: var(--text-xs);
}

.mini-stat {
    text-align: center;
}

.mini-stat-label {
    color: var(--text-muted);
    margin-bottom: var(--space-xxs);
}

.mini-stat-value {
    font-weight: var(--font-semibold);
    color: var(--text);
}

.progress-group-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
    font-size: var(--text-xs);
}

.progress-stat {
    text-align: center;
}

.progress-stat-label {
    color: var(--text-muted);
    margin-bottom: var(--space-xxs);
}

.progress-stat-value {
    font-weight: var(--font-semibold);
    color: var(--text);
}

/* --------------------------------------------
   Блок аналитики мест (из второго файла)
   -------------------------------------------- */

.spaces-analytics-block {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.analytics-title-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.analytics-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.analytics-heading {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.analytics-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.analytics-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.analytics-metric-card {
    border-radius: var(--radius);
    padding: var(--space-md);
    transition: all var(--transition);
    border: 1px solid transparent;
}

.analytics-metric-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.metric-card-weight {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
    border-color: rgba(139, 92, 246, 0.2);
}

.metric-card-volume {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.05));
    border-color: rgba(59, 130, 246, 0.2);
}

.metric-card-pieces {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    border-color: rgba(16, 185, 129, 0.2);
}

.metric-card-unique {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
    border-color: rgba(245, 158, 11, 0.2);
}

.metric-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.metric-card-title-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.metric-card-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.metric-card-weight .metric-card-icon {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
}

.metric-card-volume .metric-card-icon {
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
}

.metric-card-pieces .metric-card-icon {
    background: linear-gradient(135deg, #10B981, #059669);
}

.metric-card-unique .metric-card-icon {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.metric-card-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.metric-card-percentage,
.metric-card-count {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-xxs) var(--space-sm);
    border-radius: var(--radius);
    font-weight: var(--font-semibold);
}

.metric-card-weight .metric-card-percentage {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.metric-card-volume .metric-card-percentage {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.metric-card-pieces .metric-card-percentage {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.metric-card-unique .metric-card-count {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.metric-card-value {
    font-size: var(--text-m);
    font-weight: var(--font-bold);
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.metric-card-target,
.metric-card-info {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.analytics-progress-indicator {
    margin-top: var(--space-md);
    padding: 0 var(--space-md);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.progress-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.progress-percentage {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.analytics-progress-indicator .progress-bar-track {
    height: 6px;
    background: var(--background-alt);
    border-radius: var(--radius-full);
}

.analytics-progress-indicator .progress-bar-fill {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.progress-stat-completed,
.progress-stat-in-progress {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stat-dot.completed {
    background: var(--success);
}

.stat-dot.in-progress {
    background: var(--warning);
}

/* --------------------------------------------
   Пустые состояния (из обоих файлов)
   -------------------------------------------- */

/* Из первого файла */
.empty-spaces-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--text-tertiary);
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.empty-spaces-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.3;
    color: var(--text-disabled);
}

.empty-spaces-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.empty-spaces-description {
    font-size: 0.85rem;
    max-width: 300px;
    margin: 0 auto var(--space-md);
    line-height: 1.6;
}

/* Из второго файла */
.empty-state-block {
    background: linear-gradient(135deg, var(--background) 0%, var(--background-alt) 100%);
    border-radius: var(--radius);
    padding: var(--space-2xl) var(--space-xl);
    margin: var(--space-xl) 0;
    text-align: center;
    border: 2px dashed var(--border);
    position: relative;
    overflow: hidden;
}

.empty-state-decor {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.decor-1 {
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
}

.decor-2 {
    bottom: -30px;
    left: -30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--success), #059669);
}

.empty-state-content {
    position: relative;
    z-index: 2;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    /* background: var(--gradient-primary); */
    background: #d4e4ff;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xl);
    padding-bottom: 0.6rem;
    box-shadow: var(--shadow-md);
    color: white;
    font-size: 2rem;
}

.empty-state-title {
    margin: 0 0 var(--space-md);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.empty-state-description {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto var(--space-xl);
}

.empty-state-quick-start {
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-xl);
    margin: var(--space-xl) auto var(--space-md);
    max-width: 500px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.quick-start-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.quick-start-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.quick-start-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.quick-start-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.quick-start-metric {
    text-align: center;
}

.quick-metric-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.quick-metric-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-weight .quick-metric-value {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-volume .quick-metric-value {
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-pieces .quick-metric-value {
    background: linear-gradient(135deg, #10B981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quick-start-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.empty-state-actions {
    margin-top: var(--space-xl);
}

.actions-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.action-buttons-space {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn-space {
    padding: var(--space-md) var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.action-btn-space:hover {
    background: var(--background);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.btn-icon-space {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.btn-standard .btn-icon-space {
    background: var(--primary);
}

.btn-split .btn-icon-space {
    background: var(--success);
}

.btn-templates .btn-icon-space {
    background: var(--warning);
}

.empty-state-tips {
    margin-top: var(--space-xl);
    padding: var(--space-md);
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.tips-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.tips-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.tips-text {
    flex: 1;
}

.tips-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.tips-list {
    margin: 0;
    padding-left: var(--space-lg);
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.5;
}

.tips-list li {
    margin-bottom: var(--space-xs);
}

.empty-state-progress {
    margin-top: var(--space-2xl);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-progress .progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.empty-state-progress .progress-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-muted);
}

.empty-state-progress .progress-percent {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.empty-state-progress .progress-bar-track {
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.empty-state-progress .progress-bar-fill {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-hint {
    font-size: var(--text-xs);
    color: var(--text-light);
    text-align: center;
    margin-top: var(--space-sm);
}

/* --------------------------------------------
   Список грузовых мест (из второго файла)
   -------------------------------------------- */

.spaces-list-container {
    margin-top: var(--space-xl);
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.spaces-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: var(--space-md);
}

.spaces-list-container-list {
    /* margin: var(--space-sm); */
}

.spaces-list-title {
    font-weight: var(--font-medium);
    font-size: var(--text-lg);
    color: var(--text);
}

.spaces-list {
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------
   Формы добавления/редактирования (из обоих файлов)
   -------------------------------------------- */

/* Базовая форма (из первого файла) */
.form-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xxs);
}

.form-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    padding: 0 0 0 15px;
    margin: 0;
    line-height: 1.2;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

.form-input {
    font-family: 'Nunito', sans-serif;
    width: 100%;
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--surface);
    color: var(--text);
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-disabled);
    opacity: 1;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-input:hover:not(:focus):not(:disabled) {
    border-color: var(--border-dark);
}

.form-input:disabled {
    background: var(--background-alt);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Сводка (из первого файла) */
.cargo-space-summary {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-top: var(--space-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.summary-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-sm);
}

.summary-item {
    text-align: center;
    padding: var(--space-sm);
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-xxs);
    font-feature-settings: "tnum";
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Детальная форма (из второго файла) */
.cargo-space-form {
    background: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: var(--space-xl);
    position: relative;
    transition: all var(--transition);
}

.cargo-space-form:focus-within {
    border-color: var(--primary);
    /* box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15); */
    outline: none;
}

.cargo-space-form:hover:not(:focus-within) {
    border-color: var(--border-dark);
    /* box-shadow: var(--shadow-md); */
}

.cargo-space-form.active {
    border-left: 4px solid var(--primary);
    padding-left: calc(var(--space-xl) - 3px);
}

.cargo-space-form h3,
.cargo-space-form .form-title {
    color: var(--text);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-xs);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-light);
}

.cargo-space-form.filled {
    background: linear-gradient(to right, var(--surface) 99.5%, var(--success) 0.5%);
}

@keyframes form-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(var(--primary-rgb), 0);
    }

    100% {
        box-shadow: var(--shadow);
    }
}

.cargo-space-form.highlight {
    animation: form-pulse 1.5s ease;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.form-header-main {
    display: flex;
    gap: var(--space-sm);
}

.form-header-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.form-title {
    margin: 0;
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.form-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-templates {
    position: relative;
}

.templates-btn {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--transition);
    padding: var(--space-xs) var(--space-sm);
}

.templates-btn:hover {
    background: var(--background-alt);
}

.form-quick-stats {
    display: flex;
    justify-content: space-around;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--background);
    border-radius: var(--radius);
    font-size: var(--text-xs);
}

.quick-stat {
    text-align: center;
}

.quick-stat-label {
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.quick-stat-value {
    font-weight: var(--font-semibold);
    color: var(--text);
}

.quick-stat-diff-value {
    font-weight: var(--font-semibold);
    color: var(--warning);
}

/* .form-section {
    margin-bottom: var(--space-lg);
} */

.form-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.section-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.form-section-dimensions .section-icon {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
}

.form-section-weight .section-icon {
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
}

.section-title-space {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
    /* margin-bottom: var(--space-md); */
}

.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    background: var(--background);
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.weight-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-md);
    background: var(--background);
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.form-field {
    position: relative;
}

.field-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.field-input-with-unit {
    position: relative;
}

.field-input-with-unit .form-input {
    padding-right: 2.5rem;
}

.field-unit {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.field-badge {
    margin-left: var(--space-xxs);
    /* background: var(--info-light); */
    color: var(--info);
    /* padding: var(--space-xxs) var(--space-xs); */
    /* border-radius: var(--radius); */
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.form-preview {
    margin-top: var(--space-xs);
    padding: var(--space-md);
    color: var(--text);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.volume-preview {
    padding: var(--space-xs);
    background: var(--background);
    border-radius: var(--radius-lg);
    border-left: 4px solid #8B5CF6;
    margin-bottom: 1.5rem;
}

.total-preview {
    padding: var(--space-xs);
    background: var(--background);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    margin-bottom: 1.5rem;
}

.preview-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-text {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.preview-label {
    font-size: var(--text-xs);
    opacity: 0.9;
    white-space: nowrap;
}

.preview-value {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.preview-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.btn {
    font-size: 0.85rem;
    padding: 0.5rem 1.3rem;
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border-radius: var(--radius-lg);
}

.btn-secondary {
    background: var(--background);
    border: 1px solid var(--border-lg);
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--background-alt);
}

.btn-clear {
    flex: 1;
}

.btn-submit {
    flex: 2;
}

.btn-submit .btn-icon {
    /* font-size: var(--text-lg); */
}

.form-tips {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    color: var(--warning);
}

.form-tips .tips-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.form-tips .tips-icon {
    font-size: var(--text-lg);
}

.form-tips .tips-text {
    flex: 1;
}

.form-tips .tips-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-xs);
}

/* --------------------------------------------
   Модальные окна (из второго файла)
   -------------------------------------------- */

.edit-space-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-color, rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal, 1000);
    animation: fadeIn var(--transition) ease;
    box-shadow: var(--shadow-lg);
}

.modal-content-add-space {
    width: 90%;
    max-width: 620px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn var(--transition) ease;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-space-modal-content {
    width: 90%;
    max-width: 620px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn var(--transition) ease;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-xl) var(--space-md);
    /* border-bottom: 1px solid var(--border-light); */
    position: sticky;
    top: 0;
    /* background: var(--background-alt); */
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 10;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: white;
    /* background: var(--gradient-primary); */
    background: #d4e4ff;
}

.modal-title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text);
}

.modal-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xxs);
}

.modal-quick-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin: var(--space-md);
    padding: var(--space-md);
    background: var(--background);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.modal-quick-stats .quick-stat {
    flex: 1;
    text-align: center;
}

.edit-modal-body {
    padding: var(--space-xl);
}

.edit-form-section {
    margin-bottom: var(--space-xl);
}

.edit-form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-warning {
    display: flex;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--warning);
}

.warning-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.warning-icon {
    font-size: var(--text-lg);
}

.warning-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--warning);
}

/* --------------------------------------------
   Утилитарные классы (из обоих файлов)
   -------------------------------------------- */

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Отступы */
.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.gap-xl {
    gap: var(--space-xl);
}

.mt-xs {
    margin-top: var(--space-xs);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mb-xs {
    margin-bottom: var(--space-xs);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

/* Цвета текста */
.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.text-disabled {
    color: var(--text-disabled);
}

/* Фоны */
.bg-surface-elevated {
    background: var(--surface-elevated);
}

/* Статусные классы для карточек */
.space-card-success {
    border-left-color: var(--success);
}

.space-card-warning {
    border-left-color: var(--warning);
}

.space-card-error {
    border-left-color: var(--error);
}

/* Состояния загрузки */
.skeleton {
    background: linear-gradient(90deg, var(--background) 25%, var(--border) 50%, var(--background) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
}

.loading-state {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

/* --------------------------------------------
   Анимации
   -------------------------------------------- */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Задержки для анимации карточек */
.cargo-space-card:nth-child(2) {
    animation-delay: 0.05s;
}

.cargo-space-card:nth-child(3) {
    animation-delay: 0.1s;
}

.cargo-space-card:nth-child(4) {
    animation-delay: 0.15s;
}

.cargo-space-card:nth-child(5) {
    animation-delay: 0.2s;
}

/* --------------------------------------------
   Адаптивность
   -------------------------------------------- */

@media (max-width: 768px) {
    .cargo-spaces-container {
        padding: var(--space-md);
        border-radius: var(--radius);
    }

    .cargo-space-details {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cargo-space-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .cargo-space-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .analytics-metrics-grid {
        grid-template-columns: 1fr;
    }

    .dimensions-grid {
        grid-template-columns: 1fr;
    }

    .weight-grid {
        grid-template-columns: 1fr;
    }

    .space-card-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .metrics-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .metrics-header-left {
        margin-right: 0;
    }

    .progress-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .progress-group-title {
        margin-right: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-clear,
    .btn-submit {
        width: 100%;
    }

    .edit-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .modal-quick-stats {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .cargo-space-form {
        padding: var(--space-md);
    }

    .form-actions {
        flex-direction: column;
    }

    .cargo-space-actions {
        flex-wrap: wrap;
    }

    .space-card-metrics {
        grid-template-columns: 1fr;
    }

    .progress-card {
        width: 100%;
        margin-right: 0;
    }

    .action-buttons-space {
        flex-direction: column;
        align-items: stretch;
    }

    .action-btn-space {
        justify-content: center;
    }

    .modal-header-content {
        flex-direction: column;
        text-align: center;
    }

    .space-card-actions {
        opacity: 1;
    }
}

/* Сдвигаем содержимое карточки, чтобы освободить место для селектора */
.cargo-spaces-container.selection-mode .cargo-space-card {
    padding-left: 40px;
}

/* Приглушаем кнопки действий */
.cargo-spaces-container.selection-mode .cargo-space-card .space-card-actions {
    opacity: 0.3;
    transition: opacity 0.2s;
}

.cargo-spaces-container.selection-mode .cargo-space-card:hover .space-card-actions {
    opacity: 1;
}

/* Панель действий */
.space-action-bar {
    margin-right: 1rem;
}

.space-action-bar .action-bar-content-space {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.space-action-bar .selected-count {
    font-size: 1rem;
    color: var(--text, #0f172a);
}

.space-action-bar .selected-count span {
    font-weight: 700;
    color: var(--primary, #2563eb);
    font-size: 1.2rem;
    margin-left: 0.25rem;
    margin-right: 0.5rem;
}



.space-action-bar .btn-danger:disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    background: var(--border, #e2e8f0);
    color: var(--text-muted, #64748b);
}

.space-action-bar .btn-danger:not(:disabled):hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}


/* --------------------------------------------
   Кнопки (дополнение к существующим)
   -------------------------------------------- */
.btn-primary {
    /* Градиент и оформление */
    background: linear-gradient(135deg, var(--primary), #587fff);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.5rem 1.3rem;

    /* Flex-центрирование */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    cursor: pointer;

    /* Равномерная чёрная тень */
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2), 0 0 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1),
        box-shadow 0.25s ease,
        background 0.2s ease;
    will-change: transform;
    backface-visibility: hidden;
}

.btn-primary:hover:not(:disabled) {
    transform: scale(1.01);
    background: linear-gradient(135deg, var(--primary-dark), #3b6eff);
    /* Усиленная чёрная тень при наведении */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25), 0 0 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:active:not(:disabled) {
    transform: scale(1.02);
    transition: transform 0.05s ease;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    /* Базовое оформление */
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1.3rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;

    /* Flex-центрирование */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;

    /* Равномерная чёрная тень (более лёгкая) */
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.1), 0 0 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1),
        box-shadow 0.25s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
    will-change: transform;
    backface-visibility: hidden;
}

.btn-outline:hover:not(:disabled) {
    background: var(--background-alt);
    border-color: var(--primary);
    color: var(--primary);
    /* Усиленная чёрная тень при наведении */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15), 0 0 8px rgba(0, 0, 0, 0.05);
}

.btn-outline:active:not(:disabled) {
    transform: scale(0.98);
    background: var(--background);
    border-color: var(--border-dark);
    transition: transform 0.05s ease;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-disabled);
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.action-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.action-text {
    line-height: 1;
}

/* Индикатор загрузки (спиннер) */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Прогресс-индикаторы для карточек метрик (используются в renderCargoSpacesModal) */
.progress-indicator {
    width: 100%;
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    margin: var(--space-xs) 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition);
}


/* --------------------------------------------
   Модальное окно подтверждения удаления грузового места
   -------------------------------------------- */

#deleteSpaceConfirmModal.modal {
    align-items: center;
    justify-content: center;
}

#deleteSpaceConfirmModal .modal-content {
    max-width: 480px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    animation: modalSlideIn var(--transition) ease;
}

#deleteSpaceConfirmModal .modal-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl) var(--space-xl) var(--space-md);
    /* background: var(--background-alt); */
    /* border-bottom: 1px solid var(--border-light); */
}

#deleteSpaceConfirmModal .modal-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: white;
    background: var(--gradient-error);
}

#deleteSpaceConfirmModal .modal-title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text);
}

#deleteSpaceConfirmModal .modal-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xxs);
}

/* Детали удаляемого места */
#deleteSpaceConfirmModal .space-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-md);
    padding: var(--space-xl);
    background: var(--surface);
}

#deleteSpaceConfirmModal .detail-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--surface-elevated);
    border-radius: var(--radius);
}

#deleteSpaceConfirmModal .detail-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

#deleteSpaceConfirmModal .detail-value {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-sm);
    word-break: break-word;
}

#deleteSpaceConfirmModal .detail-row-total {
    grid-column: span 2;
    background: var(--warning-light);
    border-color: var(--warning);
}

#deleteSpaceConfirmModal .detail-row-total .detail-label {
    color: var(--warning);
}

#deleteSpaceConfirmModal .detail-row-total .detail-value {
    color: var(--warning);
    font-weight: 700;
}

/* Кнопки */
#deleteSpaceConfirmModal .modal-actions {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-xl);
    background: var(--background-alt);
    border-top: 1px solid var(--border-light);
}

#deleteSpaceConfirmModal .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border: none;
}

#deleteSpaceConfirmModal .btn-cancel {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

#deleteSpaceConfirmModal .btn-cancel:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--border-dark);
    color: var(--text);
}

#deleteSpaceConfirmModal .btn-delete {
    background: var(--gradient-error);
    color: white;
    box-shadow: var(--shadow-sm);
}

#deleteSpaceConfirmModal .btn-delete:hover:not(:disabled) {
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
    transform: translateY(-1px);
}

#deleteSpaceConfirmModal .btn-delete:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Адаптивность */
@media (max-width: 480px) {
    #deleteSpaceConfirmModal .modal-content {
        max-width: calc(100% - var(--space-xl));
        margin: var(--space-md);
    }

    #deleteSpaceConfirmModal .space-details-grid {
        grid-template-columns: 1fr;
    }

    #deleteSpaceConfirmModal .detail-row-total {
        grid-column: span 1;
    }

    #deleteSpaceConfirmModal .modal-actions {
        flex-direction: column;
    }
}

/* --------------------------------------------
   Доработки для модального окна удаления
   -------------------------------------------- */

/* Заголовок предупреждения внутри деталей */
#deleteSpaceConfirmModal .warning-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--warning);
    margin-bottom: var(--space-xxs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Альтернативный футер с классом modal-footer delete-modal-footer */
#deleteSpaceConfirmModal .modal-footer.delete-modal-footer {
    display: flex;
    justify-content: end;
    gap: var(--space-md);
    /* padding: var(--space-xl); */
}

/* Если внутри футера используются кнопки с теми же классами, они уже определены ранее */
#deleteSpaceConfirmModal .modal-footer.delete-modal-footer .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border: none;
    background-color: #047857;
}

/* --------------------------------------------
   Модальное окно подтверждения разделения поровну
   -------------------------------------------- */

#splitEvenlyConfirmModal.modal {
    align-items: center;
    justify-content: center;
}

#splitEvenlyConfirmModal .modal-content {
    max-width: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn var(--transition) ease;
}

#splitEvenlyConfirmModal .modal-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl) var(--space-xl) var(--space-md);
    /* background: var(--background-alt); */
    /* border-bottom: 1px solid var(--border-light); */
}

#splitEvenlyConfirmModal .modal-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: white;
    background: linear-gradient(135deg, #10B981, #059669);
    /* зелёный градиент для разделения */
}

#splitEvenlyConfirmModal .modal-title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text);
}

#splitEvenlyConfirmModal .modal-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xxs);
}

/* Детали разделения */
#splitEvenlyConfirmModal .split-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-md);
    padding: var(--space-xl);
    background: var(--surface);
}

#splitEvenlyConfirmModal .detail-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--surface-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

#splitEvenlyConfirmModal .detail-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

#splitEvenlyConfirmModal .detail-value {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-sm);
    word-break: break-word;
}

#splitEvenlyConfirmModal .detail-row-total {
    grid-column: span 2;
    background: rgba(16, 185, 129, 0.1);
    /* светло-зелёный фон */
}

#splitEvenlyConfirmModal .detail-row-total .detail-label {
    color: #059669;
}

#splitEvenlyConfirmModal .detail-row-total .detail-value {
    color: #047857;
    font-weight: 700;
}

/* Количество мест (выделено крупно) */
#splitEvenlyConfirmModal .pieces-highlight {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10B981;
    text-align: center;
    margin: var(--space-md) 0;
}

/* Футер модалки разделения */
#splitEvenlyConfirmModal .modal-footer {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-xl);
    /* background: var(--background-alt); */
    /* border-top: 1px solid var(--border-light); */
}

#splitEvenlyConfirmModal .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border: none;
}

#splitEvenlyConfirmModal .btn-cancel {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

#splitEvenlyConfirmModal .btn-cancel:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--border-dark);
    color: var(--text);
}

#splitEvenlyConfirmModal .btn-split {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: var(--shadow-sm);
}

#splitEvenlyConfirmModal .btn-split:hover:not(:disabled) {
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
    transform: translateY(-1px);
}

#splitEvenlyConfirmModal .btn-split:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Адаптивность для модалки разделения */
@media (max-width: 480px) {
    #splitEvenlyConfirmModal .modal-content {
        max-width: calc(100% - var(--space-xl));
        margin: var(--space-md);
    }

    #splitEvenlyConfirmModal .split-details-grid {
        grid-template-columns: 1fr;
    }

    #splitEvenlyConfirmModal .detail-row-total {
        grid-column: span 1;
    }

    #splitEvenlyConfirmModal .modal-footer {
        flex-direction: column;
    }
}

/* --------------------------------------------
   Блоки предупреждений в модальных окнах
   (удаление и разделение поровну)
   -------------------------------------------- */

.delete-warning,
.split-warning,
.split-info {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin: var(--space-md) var(--space-xl);
}

.delete-warning .warning-header,
.split-warning .warning-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.delete-warning .warning-icon,
.split-warning .warning-icon {
    font-size: 1.25rem;
    line-height: 1;
    color: var(--warning);
}

.delete-warning .warning-title,
.split-warning .warning-title {
    font-weight: var(--font-semibold);
    color: var(--warning);
    font-size: var(--text-sm);
    margin: 0;
}

.delete-warning .warning-text,
.split-warning .warning-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --------------------------------------------
   Информационный блок для разделения поровну
   -------------------------------------------- */

.split-info {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3B82F6;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin: var(--space-md) var(--space-xl);
}

.split-info .info-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.split-info .info-icon {
    font-size: 1.25rem;
    line-height: 1;
    color: #3B82F6;
}

.split-info .info-title {
    font-weight: var(--font-semibold);
    color: #1E40AF;
    font-size: var(--text-sm);
    margin: 0;
}

.split-info .info-text {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
    padding-left: calc(1.25rem + var(--space-sm));
    /* выравнивание под иконку */
}

.split-info .info-text span {
    font-weight: 700;
    color: #3B82F6;
    font-size: 1.1rem;
}

/* --------------------------------------------
   Модальное окно подтверждения удаления нескольких мест
   -------------------------------------------- */

#deleteMultipleSpacesConfirmModal .modal {
    align-items: center;
    justify-content: center;
}

#deleteMultipleSpacesConfirmModal .modal-content {
    max-width: 480px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn var(--transition) ease;
}

/* Альтернативный футер с классом modal-footer delete-modal-footer */
#deleteMultipleSpacesConfirmModal .modal-footer.delete-modal-footer {
    display: flex;
    justify-content: end;
    gap: var(--space-md);
}

/* Если внутри футера используются кнопки с теми же классами, они уже определены ранее */
#deleteMultipleSpacesConfirmModal .modal-footer.delete-modal-footer .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border: none;
}

.space-select-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text, #1F2937);
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: center;
}

.space-select-toggle-btn:hover {
    background: var(--background-alt, #F1F5F9);
    border-color: #F59E0B;
}

.space-select-toggle-btn.active {
    background: #F59E0B;
    border-color: #F59E0B;
    color: white;
}

.space-select-toggle-btn.active .btn-icon {
    transform: rotate(0);
}

.space-select-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text, #1F2937);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.space-select-all-btn:hover {
    background: var(--background-alt, #F1F5F9);
    border-color: #F59E0B;
}


.cargo-space-card.selected {
    background: rgba(37, 99, 235, 0.15) !important;
    border: 2px solid #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3) !important;
}

.split-modal-body {
    overflow-y: auto;
}

#bulkCargoSpacesWarningModal .modal-content {
    max-width: 500px;
}

#bulkCargoSpacesWarningModal .modal-footer {
    padding: 1rem 1.5rem;
    /* border-top: 1px solid var(--border-light, #e5e7eb); */
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.space-metric-pallet-cost {
    display: flex;
    gap: 0.5rem;
}