/* style.css (без стилей для форм добавления/редактирования груза) */

/* Современная цветовая схема */
:root {
    /* Добавить в секцию :root */
    --overlay-color: rgba(0, 0, 0, 0.5);

    /* Основные цвета */
    --primary: #1a62ff;
    --primary-button: #5087ff;
    --primary-filtr: #7696ff;
    --primary-light: #dbeafe;
    --primary-sueprlight: #e4eefa;
    --primary-light-note: #fff7e6;
    --primary-hover: #2d70ff;
    --primary-rgb: 33, 98, 239;
    --outline: #c0c0c0;
    --cargo: #934900;
    /* RGB значения вашего primary цвета */

    /* Статусные цвета */
    --success: #009c1a;
    --success-medium: #4caf50;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --info: #17a2b8;
    --info-light: #d1ecf1;

    /* Фоны и поверхности */
    --surface: #ffffff;
    --surface-expenses: #fff5f5;
    --background: #f8fafc;
    --background-th: #e6f2ff;
    --background-alt: #f1f5f9;

    /* Текст */
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-light-footer: #b1c2db;
    --text-light-logo: #c1d6f2;

    --font-medium: 600;
    --font-bold: 700;

    --text-s: 0.75rem;
    --text-sm: 0.875rem;
    --text-m: 1rem;
    --text-l: 1.2rem;
    --text-xl: 1.25rem;

    /* Границы и тени */
    --border: #e2e8f0;
    --border-light: #e9ecef;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Радиусы скругления */
    --radius-plateau: 25px / 24px;
    --radius-lg: 25px / 24px;
    --radius: 15px / 14px;
    --radius-md: 10px / 9px;
    --radius-sm: 6px / 5px;

    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, var(--primary), #587fff);
    --gradient-primary-button: linear-gradient(135deg, var(--primary-button), #7696ff);
    --gradient-error: linear-gradient(135deg, var(--error), #b91c1c);
    --gradient-success: linear-gradient(135deg, var(--success), #7aae8c);
    --gradient-app: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* --gradient-app: linear-gradient(to bottom, #ccffff, #d1eaff); */

    /* Отступы */
    --space-xxxs: 0.1rem;
    --space-xxs: 0.2rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
}

/* По умолчанию скрываем основной контент и боковое меню */
body:not(.authenticated) .container,
body:not(.authenticated) .mini-drawer {
    display: none;
}

/* Применяем шрифт ко всем китайским текстам на сайте */
html:lang(zh) {
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: normal;
    /* Обычное начертание */
}

/* Модалка авторизации остаётся видимой всегда, когда открыта */

/* Анимации */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expandSection {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulseTranslate {
    0% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.1);
    }

    100% {
        transform: translateY(-50%) scale(1);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes storagePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-app);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    font-weight: 400;
}

.page-haeder {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 0rem;
    padding-right: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Базовые классы для карточек */
.card-base-styles {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

/* Утилитарные классы */
.flex {
    display: flex;
}

.flex-center,
.flex-between,
.flex-start,
.flex-end {
    display: flex;
    align-items: center;
}

.flex-center {
    justify-content: center;
}

.flex-between {
    justify-content: space-between;
}

.flex-start {
    justify-content: flex-start;
}

.flex-end {
    justify-content: flex-end;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.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);
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* Текст */
.text-xs {
    font-size: 0.7rem;
}

.text-sm {
    font-size: 0.8rem;
}

.text-base {
    font-size: 0.85rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.5rem;
}

.text-2xl {
    font-size: 2.25rem;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-info {
    color: var(--info);
}

.text-white {
    color: white;
}

.bg-success {
    background: var(--success-light);
}

.bg-error {
    background: var(--error-light);
}

.bg-warning {
    background: var(--warning-light);
}

.bg-primary {
    background: var(--primary-light);
}

.bg-info {
    background: var(--info-light);
}

.bg-surface {
    background: var(--surface);
}

.bg-background {
    background: var(--background);
}

.bg-background-alt {
    background: var(--background-alt);
}

/* Карточки и контейнеры */
.card-base,
.cargo-card,
.form-section-card,
.detail-item,
.calc-item {
    background: var(--surface);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.card-base {
    box-shadow: var(--shadow);
}

.container {
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Основной контент */
.cargo-section {
    padding: 0.5rem 1rem 1rem 1rem;
    margin: 1rem 0rem 1rem 3.2rem;
    /* border: 1px solid var(--border); */
    border-radius: var(--radius-lg);
    /* box-shadow: var(--shadow); */
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    gap: var(--space-md);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stats,
.clients-stats {
    /* background: var(--success-light); */
    background: var(--primary-light);
    color: var(--primary-hover);
    padding: 0.25rem 1rem;
    margin-left: var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Таблица */
/* Контейнер таблицы должен иметь фиксированную высоту и прокрутку */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    /* margin-bottom: 1.5rem; */
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
}

/* Для корректной работы виртуализации: таблица занимает 100% ширины */
#cargoTable {
    width: 100%;
    border-collapse: collapse;
}

/* #cargoTable tbody tr {
    height: 48px;
} */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 1150px;
}

thead {
    background: var(--background-alt);
    border-bottom: 2px solid var(--border);
}

th {
    padding: 0.6rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

th:hover {
    background: var(--background-th);
}

th.sort-asc::after {
    content: '⬆️';
    font-weight: bold;
    color: var(--primary);
}

th.sort-desc::after {
    content: '⬇️';
    font-weight: bold;
    color: var(--primary);
}

tbody tr {
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.15s ease;
    height: 42px;
}

tbody tr:hover {
    background: var(--background-th);
}

td {
    padding: 0.35rem 0.75rem;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
}

td:last-child {
    width: 140px;
    text-align: center;
}

/* Состояния загрузки и ошибок */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    gap: var(--space-md);
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    /* font-style: italic; */
    /* background: #f9fafb; */
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.error-message {
    text-align: center;
    padding: 0.25rem 0.5rem;
    /* используется в большинстве случаев */
    background: var(--error-light);
    color: var(--error, #EF4444);
    /* fallback на случай, если переменная не определена */
    border-radius: 20px;
    margin-top: 0.25rem;
    display: none;
    font-size: 0.75rem;
}

.success-message {
    background: var(--success-light);
    color: var(--success);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* Модальные окна */
.modal-content.modal-sm {
    width: 650px;
}

.modal-content.modal-md {
    width: 700px;
}

.modal-content.modal-lg {
    width: 1100px;
}

.modal-content.modal-wide {
    width: 1300px;
    /* или оставить как .wide, если нужно */
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    /* По умолчанию скрыты */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
    border: none;
    background: transparent;
}

/* Стиль для нативного бэкдропа тега <dialog> на случай, если он где-то используется напрямую */
.modal[open] {
    display: flex !important;
    /* Важно! Переопределяем display: none */
}

dialog.modal[open] {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

/* Стиль для нативного бэкдропа тега <dialog> */
.modal[open]::backdrop {
    background: var(--overlay-color, rgba(0, 0, 0, 0.5));
    backdrop-filter: blur(4px);
}

/* Для нативных dialog элементов */
dialog.modal {
    display: none;
    background: transparent;
}

#deleteConfirmModal {
    z-index: 1002;
}

#cargoSpacesModal,
#addCargoSpaceModal,
#deleteSpaceConfirmModal,
#splitEvenlyConfirmModal,
#editSpaceModal {
    z-index: 1000;
}

/* Важно! Убедимся, что у всех модалок правильное отображение */
#cargoSpacesModal[open],
#addCargoSpaceModal[open],
#deleteSpaceConfirmModal[open],
#splitEvenlyConfirmModal[open],
#editSpaceModal[open] {
    display: flex !important;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    /* max-height: 90vh; */
    display: flex;
    flex-direction: column;
    width: 1300px;
    max-width: 100%;
    /* animation: modalSlideIn 0.3s ease; */
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

.modal-content.wide {
    width: 1300px;
}

.modal-header {
    padding: var(--space-2xl) var(--space-2xl) var(--space-xl) var(--space-2xl);
    display: flex;
    justify-content: space-between;
    border-radius: var(--radius-plateau) var(--radius-plateau) 0 0;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.modal-body {
    /* padding: var(--space-xl); */
    padding: 0.5rem 1.2rem 1rem 1.2rem;
}

.modal-footer {
    display: flex;
    justify-content: end;
    gap: var(--space-md);
    /* padding: var(--space-xl); */
    padding: 0.5rem 1.2rem 1rem 1.2rem;
}

/* Формы */
.modal-form {
    /* padding: var(--space-2xl); */
    padding: 0.5rem 1.2rem 1rem 1.2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-form::-webkit-scrollbar {
    width: 6px;
}

.modal-form::-webkit-scrollbar-track {
    background: var(--background);
}

.modal-form::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius);
}

.modal-form::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.form-section {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
}

.form-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Детали груза */
.details-content {
    padding: var(--space-xxxs) var(--space-2xl);
    overflow-y: auto;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xs);
}

.cargo-card {
    font-size: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-xxs);
    margin-bottom: var(--space-xxxs);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    animation: fadeIn 0.3s ease;
}

.cargo-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-xxs);
    min-height: 119px;
}

.detail-item {
    background: var(--background);
    padding: var(--space-xs) var(--space-xxs) var(--space-xs) var(--space-xs);
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
    border: 1px solid var(--border-light);
}

.detail-item strong {
    display: block;
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-item .value {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.value-storage {
    color: #00658d;
    font-size: 1.75rem;
}

.value-total-cost {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ff6f00;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Блок общей стоимости */
.total-cost-container {
    background: linear-gradient(135deg, var(--success-light), #d1fae5);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: var(--space-xl);
    text-align: center;
    margin: var(--space-lg) 0;
    animation: pulseGlow 2s infinite;
}

.total-cost-title {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.total-cost-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success);
    margin: var(--space-sm) 0;
}

.total-cost-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Типы данных */
.detail-item.physical {
    background: #f0f9ff;
}

.detail-item.financial {
    background: #f8fff9;
}

.detail-item.calculation {
    background: #f8f9ff;
}

/* ========== БЛОК ХРАНЕНИЯ ========== */
.storage-section {
    background: linear-gradient(135deg, #fff9e6, #fef3c7);
    border: 2px solid var(--warning);
    border-radius: var(--radius);
    padding: var(--space-md);
    transition: all 0.3s ease;
}

.storage-section:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    transform: translateY(0);
}

.storage-days-big {
    font-size: 1.8rem;
    font-weight: 800;
    color: #d97706;
    text-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* ========== МОДАЛЬНОЕ ОКНО ХРАНЕНИЯ ========== */
.storage-content {
    padding: var(--space-2xl);
    overflow-y: auto;
    max-height: 80vh;
}

.storage-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.storage-days-badge {
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.calculation-results {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.calculation-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.calculation-row:hover {
    background-color: var(--background);
}

.calculation-row.total {
    background: linear-gradient(135deg, var(--success-light), #d1fae5);
    border-top: 2px solid var(--success);
}

.calc-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.calc-value {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
    text-align: right;
    padding: 0 var(--space-md);
}

.calculation-row.total .calc-value {
    font-size: 1.1rem;
    color: var(--success);
}

.calc-formula {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    font-style: italic;
}

.option-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.final-calculation {
    background: linear-gradient(135deg, var(--success-light), #d1fae5);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: var(--space-xl);
    animation: pulseGlow 2s infinite;
}

/* Стили для модального окна добавления/редактирования груза в стиле деталей */
/* (эти стили могли быть удалены, но оставим общие части, которые не касаются форм) */

/* Модальное окно в стиле карточек */
.modal-content.edit-modal {
    width: 900px;
    background: var(--background);
    border: 1px solid var(--border);
}

.modal-header.edit-header {
    background: var(--surface);
    border-bottom: 2px solid var(--primary);
    padding: var(--space-xl) var(--space-2xl);
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
}

.modal-header.edit-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

.modal-header.edit-header h3 {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.modal-header.edit-header h3::before {
    content: '📦';
    font-size: 1.8rem;
}

/* Основной контент формы как карточка */
.modal-form.edit-form {
    padding: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: 70vh;
}

/* Специальные поля */
.field-with-icon {
    position: relative;
}

.field-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Кнопки действий формы */
.card-actions {
    /* background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--space-xl);
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-lg);
    border-radius: 0 0 var(--radius) var(--radius); */
}

/* Секция статуса (как в деталях) */
.status-section-card {
    border-left: 3px solid var(--primary);
}

.status-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.timeline-step {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.timeline-step:hover {
    border-color: var(--primary-light);
    transform: translateX(5px);
}

.timeline-step.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.timeline-step.active .step-icon {
    background: var(--primary);
    color: white;
}

.step-info {
    flex: 1;
}

.step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.step-description {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Группа связанных полей */
.field-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-sm);
    align-items: end;
}

.field-group span {
    color: var(--text-muted);
    font-weight: 600;
    padding-bottom: var(--space-md);
    text-align: center;
}

/* Стили для автозаполнения */
.auto-fill-indicator {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    animation: pulse 1.5s infinite;
}

/* Иконки для разных типов полей */
.icon-weight::before {
    content: '⚖️';
}

.icon-dimensions::before {
    content: '📏';
}

.icon-money::before {
    content: '💰';
}

.icon-date::before {
    content: '📅';
}

.icon-location::before {
    content: '📍';
}

.icon-document::before {
    content: '📄';
}

.icon-user::before {
    content: '👤';
}

.icon-phone::before {
    content: '📱';
}

.icon-email::before {
    content: '📧';
}

/* Стили для блока статусов с примечанием */
.status-with-note-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.note-section {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.note-content {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.note-text {
    white-space: pre-wrap;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

.note-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.note-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

/* Стили для подсветки символов примечания */
.note-char-warning {
    color: var(--warning) !important;
}

.note-char-error {
    color: var(--error) !important;
}

/* ========== СТИЛИ ДЛЯ ВЫБОРА МЕТОДА РАСЧЕТА (удалены) ========== */

/* ========== ПРИМЕЧАНИЯ ========== */
.note-container {
    background: #fff7e6;
    border: 1px solid #ffd166;
    border-radius: var(--radius);
    padding: var(--space-md);
    margin: var(--space-lg) 0;
}

.note-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

/* ========== КНОПКИ ДЕЙСТВИЙ ========== */
.action-buttons-details {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin: var(--space-lg) 0;
}

.action-buttons-details .btn-primary {
    padding: 0.5rem 1.3rem;
}

/* 🔥 Специальный стиль для кнопки с примечанием */
.btn-has-note {
    background: linear-gradient(135deg, var(--primary-light-note) 0%, #fff7e6 100%) !important;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    padding: 0.35rem 0.4rem;
    font-size: 0.85rem;
    min-width: auto;
    border-radius: var(--radius-sm);
    color: var(--text);
}

/* Анимация при наведении на кнопку с примечанием */
.btn-has-note:hover {
    background: linear-gradient(135deg, var(--primary-light-note) 0%, #ffd782 100%) !important;
    color: var(--text);
}

/* ========== СПЕЦИАЛЬНЫЕ СТИЛИ ========== */
.storage-cost-highlight {
    color: var(--warning) !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
}

/* Пагинация */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-xs) var(--space-xl) var(--space-xl) var(--space-xl);
    background: var(--surface);
    border-radius: 0 0 var(--radius) var(--radius);
    flex-wrap: wrap;
}

.pagination-right {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: var(--space-lg);
    flex: 1;
}

.pagination-left {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: var(--space-lg);
    flex: 1;
}

.pagination-center {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    /* gap: var(--space-xs); */
}

.pagination-info {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
}

.pagination-stats {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.pagination-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
    min-width: 80px;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--background);
    border-radius: var(--radius-lg);
}

.page-size-selector label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    padding-right: 0.5rem;
}

.page-size-selector {
    position: relative;
    display: inline-block;
}

.page-size-selector select {
    padding: var(--space-xxs) var(--space-xs);
    border: 1px solid var(--border);
    border-radius: 25px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.75rem;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;

    /* Убираем стандартную стрелку */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Добавляем отступ для кастомной стрелки */
    padding-right: 30px;
    /* увеличиваем отступ справа */
}

/* Добавляем кастомную стрелку */
.page-size-selector::after {
    content: '▼';
    font-size: 0.7rem;
    color: var(--text);
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.2s ease;
}

.page-size-selector select:hover {
    border-color: var(--primary);
}

/* Поворот стрелки при открытом селекте */
.page-size-selector select:focus::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Подтверждение удаления - единый блок */
.warning-message {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.warning-icon {
    font-size: 1.5rem;
}

.warning-message h4 {
    color: var(--error);
    margin-bottom: var(--space-lg);
    font-size: 1.25rem;
}

.warning-message p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Статусы в модалке - единый блок */


.status-btn {
    padding: var(--space-md) var(--space-sm);
    border: 1.5px solid #e9ecef;
    border-radius: var(--radius);
    background: white;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.status-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.status-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    animation: pulse 0.3s ease;
}

.status-btn .status-icon {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.status-btn .status-label {
    font-weight: 600;
    font-size: 0.75rem;
}

.status-btn .status-description {
    font-size: 0.65rem;
    opacity: 0.8;
    line-height: 1.2;
}

/* История */
.history-container {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    padding: 0.5rem;
    /* border-bottom: 1px solid var(--border-light); */
    font-size: 0.8rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.history-method-change {
    color: var(--primary);
    font-weight: 600;
}

.rate-comparison {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.rate-old {
    color: var(--text-muted);
    text-decoration: line-through;
}

.rate-new {
    color: var(--success);
    font-weight: 600;
}

.method-switch-notice {
    background: var(--info-light);
    color: var(--info);
    padding: var(--space-md);
    border-radius: var(--radius);
    border-left: 4px solid var(--info);
    margin-top: var(--space-md);
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

.method-switch-notice .notice-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.conversion-suggestion {
    background: var(--warning-light);
    color: var(--warning);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    margin-top: 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--warning);
}

/* Стили для итога по хранению */
.storage-summary-info {
    animation: fadeIn 0.5s ease;
}

/* Подсказка системы */
.system-hint {
    border-left: 4px solid var(--info);
    animation: fadeIn 0.3s ease;
}

.transport-cell-complete {
    color: var(--success);
    font-weight: 600;
}

.transport-cell-partial {
    color: var(--warning);
    font-weight: 500;
}

.transport-cell-empty {
    color: var(--text-muted);
}

/* Дополнительные стили */
.btn-custom-active {
    background: linear-gradient(135deg, var(--warning), #f59e0b) !important;
    border-color: var(--warning) !important;
    color: white !important;
}

.btn-custom-active:hover {
    background: linear-gradient(135deg, #f59e0b, #e68a00) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.custom-calculation-badge {
    display: inline-block;
    background: var(--warning);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.calculation-toggle .btn-outline.active {
    background: #009c1a;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.calculation-toggle .btn-outline.active#useCustomTariffBtn {
    background: #009c1a;
    border-color: var(--warning);
    color: var(--warning);
}

/* Стили для разных типов расчетов */
.calculation-type-individual {
    border-left-color: #f59e0b !important;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05), transparent);
}

.calculation-type-system {
    border-left-color: #3b82f6 !important;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05), transparent);
}

.calculation-type-current {
    border-left-color: var(--success) !important;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.05), transparent);
}

/* Grid-сетка для деталей */
.details-grid-container {
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-template-rows: repeat(4, auto);
    gap: 0.25rem;
    width: 1100px;
}

.grid-item {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.grid-item-1 {
    grid-area: 1 / 1 / 2 / 4;
    min-width: 1000px;
    max-width: 1000px;
    width: 1000px;
    min-height: 118px;
    max-height: 118px;
    height: 118px;
}

.grid-item-2 {
    grid-area: 2 / 1 / 3 / 2;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
}

.grid-item-3 {
    grid-area: 2 / 2 / 3 / 3;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.grid-item-4 {
    grid-area: 2 / 3 / 3 / 4;
    width: 370px;
}

.grid-item-5 {
    grid-area: 3 / 1 / 4 / 2;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
}

.grid-item-6 {
    grid-area: 3 / 2 / 4 / 3;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.grid-item-7 {
    grid-area: 3 / 3 / 4 / 4;
    width: 370px;
}

.grid-item-8 {
    grid-area: 1 / 4 / 5 / 5;
    display: flex;
    width: 230px;
    min-width: 230px;
    max-width: 230px;
}

.grid-item-9 {
    grid-area: 4 / 1 / 5 / 4;
    min-width: 1000px;
    max-width: 1000px;
    width: 1000px;
}

.action-buttons-container {
    grid-column: 1 / -1;
    /* margin-top: 1rem; */
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: start;
    border-bottom: 1px solid var(--border);
    padding-left: var(--space-xs);
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-xxs);
    gap: var(--space-xxs);
}

/* Адаптивность - Общие стили */
@media (max-width: 1150px) {
    .container {
        margin: var(--space-sm);
        min-height: calc(100vh - 1rem);
    }

    .cargo-section {
        padding: var(--space-xl);
    }

    .modal-content.wide {
        /* width: 95vw; */
    }
}

@media (max-width: 992px) {
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .details-grid-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .grid-item-1,
    .grid-item-2,
    .grid-item-3,
    .grid-item-4,
    .grid-item-5,
    .grid-item-6,
    .grid-item-7,
    .grid-item-8,
    .grid-item-9 {
        grid-area: auto;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: var(--space-xl);
    }

    .app-header h1 {
        font-size: 1.1rem;
    }

    .cargo-section {
        padding: var(--space-xl);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-lg);
    }

    .form-grid,
    .search-quick-filters {
        grid-template-columns: 1fr;
    }

    .search-main-row {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .form-actions,
    .search-actions-compact,
    .form-actions.card-actions {
        flex-direction: column;
    }

    .pagination-controls {
        flex-direction: column;
        gap: var(--space-md);
    }

    .pagination-left,
    .pagination-center,
    .pagination-right {
        justify-content: center;
        flex: none;
        width: 100%;
    }

    .pagination-center {
        order: -1;
    }

    .pagination-info {
        order: -1;
    }

    .page-size-selector {
        justify-content: center;
    }

    .pagination-btn {
        min-width: 70px;
        padding: 0.4rem 0.8rem;
    }

    .modal-header {
        padding: var(--space-lg) var(--space-xl);
    }

    .modal-form {
        padding: var(--space-xl);
    }

    .details-content {
        padding: var(--space-lg);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .status-btn {
        padding: 0.6rem 0.5rem;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: var(--space-sm);
    }

    .status-btn .status-icon {
        margin-bottom: 0;
        font-size: 1rem;
    }

    .search-actions-compact {
        justify-content: stretch;
    }

    /* Модальные окна на мобильных */
    .modal-content.edit-modal {
        /* width: 95vw; */
        /* max-height: 95vh; */
        margin: 0.5rem;
    }

    .card-section-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        padding: var(--space-lg);
    }

    .btn-save,
    .btn-cancel {
        width: 100%;
        justify-content: center;
    }

    .modal-form.edit-form {
        max-height: 80vh;
    }

    /* Адаптивность для блока статусов с примечанием */
    .status-with-note-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .note-section {
        position: static;
    }

    .calculation-row {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
        text-align: center;
    }

    .calc-value,
    .calc-formula {
        text-align: center;
    }

    .action-buttons-details {
        flex-direction: column;
        align-items: center;
    }

    .action-buttons-details .btn-primary {
        width: 100%;
    }

    .details-grid-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cargo-section {
        padding: var(--space-lg);
    }

    .app-header {
        padding: var(--space-lg);
        text-align: center;
    }

    .modal-content {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        max-height: 100vh;
    }

    .notification {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .pagination-left,
    .pagination-right {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .page-size-selector {
        flex-direction: column;
        gap: var(--space-xs);
        padding: var(--space-md);
    }

    .pagination-btn {
        min-width: 60px;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .search-toggle {
        padding: 0.6rem 0.8rem;
    }

    .search-panel-collapsible.active {
        padding: var(--space-lg);
    }

    .range-inputs-compact {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .range-inputs-compact span {
        display: none;
    }

    .search-actions-compact {
        flex-direction: column;
    }

    .action-buttons .btn-outline {
        padding: 0.3rem;
        font-size: 0.65rem;
    }

    /* Модальные окна на очень маленьких экранах */
    .modal-header.edit-header {
        padding: var(--space-lg) var(--space-md);
    }

    .modal-header.edit-header h3 {
        font-size: 1.25rem;
    }

    .form-section-card {
        /* margin: 0.75rem; */
    }

    .card-section-header {
        padding: var(--space-md) var(--space-lg);
    }

    .card-section-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .card-section-content {
        padding: var(--space-lg);
    }

    .timeline-step {
        padding: 0.6rem;
        gap: var(--space-md);
    }

    .step-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* Контейнер для двух карточек */
.history-cards-container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    /* rate-history-card занимает 1/4, storage-history-card - 3/4 */
    gap: var(--space-lg);
    width: 100%;
}

/* Карточка истории расчета фрахта (одна колонка внутри) */
.rate-history-card {
    width: 100%;
    max-height: 100px;
    /* Ограничение высоты */
    display: flex;
    flex-direction: column;
}

/* Карточка истории расчетов хранения (две колонки внутри) */
.storage-history-card {
    width: 100%;
    max-height: 100px;
    /* Ограничение высоты */
    display: flex;
    flex-direction: column;
}

/* Область скролла для обеих карточек */
.rate-history-card .history-content-scroll,
.storage-history-card .history-content-scroll {
    overflow-y: auto;
    /* Вертикальный скролл */
    max-height: calc(100px - 20px);
    /* Учитываем высоту заголовка (примерно) */
    padding-right: var(--space-sm);
    /* Отступ для скролла */
}

/* Если заголовок имеет другую высоту, отрегулируйте 60px под ваш header */
.card-header {
    flex-shrink: 0;
    /* Запрещаем сжатие заголовка */
}

/* Внутренний контент для storage-history-card с двумя колонками */
.storage-history-card .history-content-scroll {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Две колонки внутри */
    gap: var(--space-md);
}

/* Контент в rate-history-card в одну колонку */
.rate-history-card .history-content-scroll {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Стилизация скролла (опционально) */
.history-content-scroll::-webkit-scrollbar {
    width: 6px;
}

.history-content-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.history-content-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.history-content-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* action-buttons.css — стили для панели управления грузом */
.cargo-actions {
    display: flex;
    flex-wrap: wrap;
    /* justify-content: space-between; */
    align-items: center;
    gap: 1rem 2rem;
    padding: 1rem 2.5rem 1rem 2.5rem;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.3rem;
    border: none;
    border-radius: 40px;
    /* современные скруглённые кнопки */
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    line-height: 1;
}

/* Основные кнопки (светлые) */
.action-btn-primary {
    background: white;
    color: var(--text-primary, #1e293b);
    border: 1px solid var(--border-color, #e2e8f0);
}

.action-btn-primary:hover {
    background: var(--primary-light, #e0f2fe);
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.15);
}

/* Акцентная кнопка (редактирование) */
.action-btn-secondary {
    background: var(--primary, #3b82f6);
    color: white;
    border: 1px solid var(--primary, #3b82f6);
}

.action-btn-secondary:hover {
    background: var(--primary-dark, #2563eb);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

/* Адаптивность */
@media (max-width: 900px) {
    .cargo-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1.2rem;
    }

    .action-group {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    /* .action-icon {
        font-size: 0.85rem;
    } */

    .action-group {
        gap: 0.5rem;
    }
}

/* Тёмная тема (если используется) */
@media (prefers-color-scheme: dark) {
    .cargo-actions {
        background: #1e293b;
        border-color: #334155;
    }

    .action-btn-primary {
        background: #0f172a;
        color: #e2e8f0;
        border-color: #334155;
    }

    .action-btn-primary:hover {
        background: #1e293b;
        border-color: #3b82f6;
    }
}

/* Шапка модалки деталей */
.modal-header-left {
    flex: 1;
    min-width: 0;
}

.details-breadcrumb {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.breadcrumb-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

.details-cargo-code {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    line-height: 1.2;
    margin: 0;
    word-break: break-word;
}

/* Адаптивность */
@media (max-width: 768px) {
    .details-cargo-code {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .modal-header-left {
        gap: 0.15rem;
    }

    .details-breadcrumb {
        font-size: 0.7rem;
    }

    .details-cargo-code {
        font-size: 1.2rem;
    }
}

/* Строка с дополнительной информацией */
.details-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    padding-bottom: 0.75rem;
    /* border-bottom: solid 1px #dcd5c8; */
    width: 100%;
    /* гарантирует, что займёт всю ширину родителя */
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.meta-label {
    font-weight: 500;
    color: var(--text-light, #94a3b8);
}

.meta-value {
    font-weight: 600;
    color: var(--text, #0f172a);
}

.meta-separator {
    color: var(--border, #e2e8f0);
    font-weight: 300;
    font-size: 1.2rem;
    line-height: 1;
}

/* Статус оплаты */
.payment-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border, #e2e8f0);
    font-size: 0.9rem;
}

.payment-status-label {
    font-weight: 500;
    color: var(--text-muted, #64748b);
}

.payment-status-value {
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: var(--warning-light, #fef3c7);
    color: var(--warning, #d97706);
}

/* Пример для разных статусов (можно добавить позже) */
.payment-status-paid {
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: var(--success-light, #d1fae5);
    color: var(--success, #009c1a);
}

.payment-status-unpaid {
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: var(--warning-light, #fef3c7);
    color: var(--warning, #d97706);
}

.payment-status-overdue {
    background: var(--error-light, #fee2e2);
    color: var(--error, #dc2626);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .details-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .meta-separator {
        display: none;
    }

    .payment-status-row {
        flex-wrap: wrap;
    }
}

select,
select option {
    font-family: 'Nunito', sans-serif !important;
}

/* Подсветка последнего изменённого груза */
tr.highlight-row {
    background-color: #fff3cd !important;
    /* светло-желтый */
    transition: background-color 0.5s ease;
}

tr.highlight-row td {
    background-color: inherit;
}

@keyframes highlight-pulse {
    0% {
        background-color: #fff3cd;
    }

    50% {
        background-color: #ffe69c;
    }

    100% {
        background-color: #fff3cd;
    }
}

tr.highlight-row {
    animation: highlight-pulse 2s infinite;
}

.select-all {
    text-align: center;
    padding-bottom: 5px;
}

/* Контейнеры с полями ввода — курсор-указатель */
.date-range,
.field,
.input-group,
.date-field-container,
.operations-header .date-range:has(input, select, textarea) {
    cursor: pointer;
}

/* Для старых браузеров, не поддерживающих :has, можно добавить класс через JS */
.field:has(select),
.input-group:has(select) {
    cursor: pointer;
}

.company-info {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.company-icon {
    font-size: 0.8rem;
}

.company-name-in-status {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

@media (max-width: 768px) {
    .company-name-in-status {
        max-width: 400px;
    }
}

.checkbox-main {
    margin-left: 3px;
}