/* ============================================================ */
/* РАЗДЕЛ 0: БАЗОВЫЕ ПЕРЕМЕННЫЕ И СБРОС */
/* ============================================================ */
* {
    box-sizing: border-box;
}

/* ============================================================ */
/* РАЗДЕЛ 16: ПРЕМИАЛЬНАЯ ЛОГИСТИЧЕСКАЯ ТЕМА */
/* ============================================================ */
:root {
    --ui-font: "Manrope", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --bg-main: #e9f0ed;
    --bg-accent: #f8fbf9;
    --panel: rgba(255, 255, 255, 0.58);
    --panel-strong: rgba(255, 255, 255, 0.78);
    --panel-solid: #ffffff;
    --panel-border: rgba(215, 226, 221, 0.72);
    --glass-line: rgba(255, 255, 255, 0.74);
    --text-main: #182231;
    --text-soft: #657287;
    --text-muted: #9aa7b8;
    --brand: #192435;
    --brand-soft: rgba(25, 36, 53, 0.08);
    --brand-line: rgba(208, 222, 215, 0.78);
    --accent: #146bff;
    --accent-strong: #071b49;
    --accent-warm: #2f80ff;
    --accent-blue: #2f80ff;
    --success: #17a86b;
    --danger: #d33d3d;
    --shadow-soft: 0 34px 90px rgba(92, 113, 103, 0.18);
    --shadow-card: 0 18px 48px rgba(93, 111, 103, 0.12);
    --shadow-control: 0 16px 34px rgba(24, 34, 49, 0.12);
    --radius-xl: 36px;
    --radius-lg: 26px;
    --radius-md: 18px;
    --motion-fast: 160ms cubic-bezier(.2, .8, .2, 1);
    --motion-normal: 260ms cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
    --bg-main: #070a0f;
    --bg-accent: #0d1420;
    --panel: rgba(18, 25, 36, 0.58);
    --panel-strong: rgba(22, 30, 43, 0.76);
    --panel-solid: #121a27;
    --panel-border: rgba(127, 151, 177, 0.18);
    --glass-line: rgba(255, 255, 255, 0.12);
    --text-main: #eef4fb;
    --text-soft: #aab7c8;
    --text-muted: #758397;
    --brand: #f4f8ff;
    --brand-soft: rgba(255, 255, 255, 0.08);
    --brand-line: rgba(148, 163, 184, 0.22);
    --accent: #2f80ff;
    --accent-strong: #74a9ff;
    --accent-warm: #e8f1ff;
    --accent-blue: #74a9ff;
    --success: #42d895;
    --danger: #ff7b7b;
    --shadow-soft: 0 40px 110px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.32);
    --shadow-control: 0 18px 42px rgba(0, 0, 0, 0.42);
}

html,
body {
    font-family: var(--ui-font);
    background: var(--bg-main);
}

body {
    position: relative;
    overflow-x: hidden;
    color: var(--text-main);
    background:
        radial-gradient(circle at 12% 10%, rgba(96, 203, 195, 0.34), transparent 24%),
        radial-gradient(circle at 88% 2%, rgba(93, 141, 247, 0.25), transparent 28%),
        radial-gradient(circle at 16% 92%, rgba(243, 165, 59, 0.18), transparent 26%),
        linear-gradient(135deg, var(--bg-main) 0%, var(--bg-accent) 46%, #dfe8e4 100%);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 10% 8%, rgba(49, 209, 195, 0.18), transparent 28%),
        radial-gradient(circle at 84% 4%, rgba(93, 141, 247, 0.16), transparent 30%),
        radial-gradient(circle at 16% 92%, rgba(255, 184, 90, 0.11), transparent 26%),
        linear-gradient(135deg, #06080d 0%, #0c1522 45%, #101822 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: 0;
    background:
        linear-gradient(120deg, transparent 0 34%, rgba(255, 255, 255, 0.38) 34.2% 34.7%, transparent 35% 100%),
        linear-gradient(146deg, transparent 0 58%, rgba(15, 155, 142, 0.15) 58.2% 58.6%, transparent 59% 100%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0 1px, transparent 1px 120px);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
}

body::after {
    z-index: 0;
    background:
        radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.5), transparent 12%),
        radial-gradient(circle at 74% 72%, rgba(255, 255, 255, 0.22), transparent 18%);
    filter: blur(18px);
    opacity: 0.75;
    animation: logisticsAmbient 14s ease-in-out infinite alternate;
}

html[data-theme="dark"] body::before {
    background:
        linear-gradient(120deg, transparent 0 34%, rgba(255, 255, 255, 0.07) 34.2% 34.7%, transparent 35% 100%),
        linear-gradient(146deg, transparent 0 58%, rgba(49, 209, 195, 0.13) 58.2% 58.6%, transparent 59% 100%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 120px);
}

html[data-theme="dark"] body::after {
    opacity: 0.42;
}

@keyframes logisticsAmbient {
    from {
        transform: translate3d(-1.5%, -1%, 0) scale(1);
    }
    to {
        transform: translate3d(1.5%, 1%, 0) scale(1.04);
    }
}

@keyframes surfaceRise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-shell {
    position: relative;
    z-index: 1;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    gap: 22px;
    padding: 22px;
}

.app-sidebar,
.app-surface,
.main-form,
.table-wrapper,
.total-card,
.manager-report-card,
.modal-window,
.sidebar-meta-card,
.route-restrictions-map-shell,
.route-restrictions-match,
.route-restrictions-summary-item {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46)),
        var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(24px) saturate(138%);
    -webkit-backdrop-filter: blur(24px) saturate(138%);
}

html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .app-surface,
html[data-theme="dark"] .main-form,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .total-card,
html[data-theme="dark"] .manager-report-card,
html[data-theme="dark"] .modal-window,
html[data-theme="dark"] .sidebar-meta-card,
html[data-theme="dark"] .route-restrictions-map-shell,
html[data-theme="dark"] .route-restrictions-match,
html[data-theme="dark"] .route-restrictions-summary-item {
    background:
        linear-gradient(145deg, rgba(26, 36, 52, 0.82), rgba(14, 21, 32, 0.58)),
        var(--panel);
}

.app-sidebar {
    top: 22px;
    min-height: calc(100vh - 44px);
    padding: 20px 16px;
    border-radius: 34px;
    overflow: hidden;
    animation: surfaceRise 520ms var(--motion-normal) both;
}

.app-sidebar::before {
    content: "";
    position: absolute;
    inset: auto -44px -54px 24px;
    height: 160px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 155, 142, 0.24), transparent 68%);
}

.sidebar-brand {
    position: relative;
    padding: 10px 10px 20px;
}

.sidebar-brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.52)),
        radial-gradient(circle at 30% 18%, rgba(49, 209, 195, 0.2), transparent 54%);
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow-control);
}

html[data-theme="dark"] .sidebar-brand-mark {
    background:
        linear-gradient(145deg, rgba(31, 43, 61, 0.96), rgba(17, 24, 36, 0.72)),
        radial-gradient(circle at 30% 18%, rgba(49, 209, 195, 0.2), transparent 54%);
}

.sidebar-brand-text strong {
    font-size: 16px;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    gap: 9px;
}

.sidebar-nav-item {
    min-height: 48px;
    border-radius: 18px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 720;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    transition:
        background var(--motion-fast),
        border-color var(--motion-fast),
        color var(--motion-fast),
        transform var(--motion-fast),
        box-shadow var(--motion-fast);
}

.sidebar-nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.48);
    border-color: var(--glass-line);
    transform: translateX(3px);
}

html[data-theme="dark"] .sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav-item-active {
    color: var(--text-main);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58));
    border-color: var(--glass-line);
    box-shadow: 0 16px 38px rgba(24, 34, 49, 0.11);
}

html[data-theme="dark"] .sidebar-nav-item-active {
    background:
        linear-gradient(135deg, rgba(49, 209, 195, 0.16), rgba(255, 255, 255, 0.07));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.sidebar-meta-card {
    border-radius: 22px;
    padding: 15px;
}

.sidebar-meta-label,
.summary-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.app-main {
    padding: 4px 0 32px;
}

.container {
    max-width: 1460px;
}

.app-surface {
    position: relative;
    overflow: hidden;
    padding: clamp(18px, 2vw, 30px);
    border-radius: 42px;
    box-shadow: var(--shadow-soft);
    animation: surfaceRise 620ms var(--motion-normal) 90ms both;
}

.app-surface::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background:
        radial-gradient(circle at 86% 8%, rgba(93, 141, 247, 0.16), transparent 30%),
        radial-gradient(circle at 10% 86%, rgba(15, 155, 142, 0.13), transparent 28%);
}

.page-header {
    align-items: center;
    margin-bottom: 22px;
    padding: 4px 4px 18px;
    border-bottom: 1px solid var(--brand-line);
}

.page-header h1 {
    color: var(--text-main);
    font-size: clamp(30px, 3.2vw, 48px);
    font-weight: 850;
    letter-spacing: -0.055em;
}

.page-subtitle {
    max-width: 780px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.55;
}

.page-header-actions,
.results-toolbar-actions,
.manager-report-header-actions {
    align-items: center;
    justify-content: center;
    gap: 12px;
}

button,
.secondary-button,
.settings-primary-action {
    min-height: 46px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.012em;
    transition:
        background var(--motion-fast),
        border-color var(--motion-fast),
        color var(--motion-fast),
        transform var(--motion-fast),
        box-shadow var(--motion-fast),
        opacity var(--motion-fast);
}

button,
.file-input-button,
.settings-primary-action {
    background:
        linear-gradient(135deg, #202b3c, #121b2a);
    color: #ffffff;
    box-shadow: var(--shadow-control);
}

button:hover,
.settings-primary-action:hover {
    background:
        linear-gradient(135deg, #101927, #070d16);
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(24, 34, 49, 0.18);
}

html[data-theme="dark"] button,
html[data-theme="dark"] .file-input-button,
html[data-theme="dark"] .settings-primary-action {
    background:
        linear-gradient(135deg, rgba(49, 209, 195, 0.96), rgba(39, 107, 148, 0.92));
    color: #061014;
}

.secondary-button,
.toolbar-button,
.column-picker-button {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48));
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    box-shadow: 0 12px 30px rgba(93, 111, 103, 0.09);
}

.secondary-button:hover,
.secondary-button:focus,
.toolbar-button:hover,
.toolbar-button:focus,
.column-picker-button:hover,
.column-picker-button:focus {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.66));
    border-color: var(--glass-line);
    color: var(--text-main);
    box-shadow: 0 18px 42px rgba(93, 111, 103, 0.14);
    transform: translateY(-2px);
    text-decoration: none;
}

html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .toolbar-button,
html[data-theme="dark"] .column-picker-button {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
    color: var(--text-main);
}

html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .secondary-button:focus,
html[data-theme="dark"] .toolbar-button:hover,
html[data-theme="dark"] .toolbar-button:focus,
html[data-theme="dark"] .column-picker-button:hover,
html[data-theme="dark"] .column-picker-button:focus {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.07));
}

.toolbar-button,
.results-toolbar-actions .secondary-button,
.results-toolbar-actions .column-picker-button {
    min-height: 48px;
    padding: 0 22px;
    border-radius: 20px;
    font-size: 14px;
}

.theme-toggle-button {
    min-width: 150px;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(15, 155, 142, 0.12);
    color: var(--accent-strong);
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.52));
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    box-shadow: 0 12px 28px rgba(93, 111, 103, 0.11);
}

.icon-button:hover {
    background: var(--panel-solid);
    transform: translateY(-1px);
}

html[data-theme="dark"] .icon-button {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055));
}

button:focus-visible,
.secondary-button:focus-visible,
.settings-primary-action:focus-visible,
.file-input-shell:focus-within,
input:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(49, 209, 195, 0.16),
        0 18px 42px rgba(31, 41, 55, 0.14);
}

.main-form {
    padding: clamp(16px, 1.5vw, 24px);
    border-radius: 30px;
}

label {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

textarea,
input[type="text"],
input[type="number"],
input[type="file"],
input[type="month"],
select {
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--text-main);
    font-family: var(--ui-font);
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="file"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] select {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

textarea::placeholder,
input::placeholder {
    color: var(--text-muted);
}

.file-input-shell,
.vehicle-filter,
.history-month-filter,
.column-picker-panel,
.route-restrictions-checkbox {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.46));
    border-color: var(--panel-border);
    box-shadow: 0 12px 30px rgba(93, 111, 103, 0.08);
}

html[data-theme="dark"] .file-input-shell,
html[data-theme="dark"] .vehicle-filter,
html[data-theme="dark"] .history-month-filter,
html[data-theme="dark"] .column-picker-panel,
html[data-theme="dark"] .route-restrictions-checkbox {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
}

.section-heading h2,
.manager-report-card h2,
.modal-header h2 {
    color: var(--text-main);
    font-weight: 850;
    letter-spacing: -0.035em;
}

.alert {
    border-radius: 20px;
    backdrop-filter: blur(16px);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.26);
}

.alert-info {
    background: rgba(93, 141, 247, 0.12);
    color: var(--accent-blue);
    border-color: rgba(93, 141, 247, 0.24);
}

.alert-error {
    background: rgba(211, 61, 61, 0.12);
    color: var(--danger);
    border-color: rgba(211, 61, 61, 0.24);
}

.totals {
    gap: 14px;
}

.total-card {
    border-radius: 28px;
    text-align: left;
}

.total-title {
    color: var(--text-soft);
    font-weight: 760;
}

.total-value {
    color: var(--text-main);
    font-size: clamp(22px, 1.9vw, 30px);
    letter-spacing: -0.035em;
}

.results-toolbar {
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] .results-toolbar {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.08);
}

.results-toolbar-title {
    color: var(--text-main);
    font-size: 14px;
}

.table-wrapper,
.manager-report-table-wrapper {
    border-radius: 32px;
    padding: 14px;
}

table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

thead th,
.manager-report-table th {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.015em;
    background: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] thead th,
html[data-theme="dark"] .manager-report-table th {
    background: rgba(255, 255, 255, 0.055);
}

tbody td,
.manager-report-table td {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.32);
    border-bottom: 1px solid rgba(215, 226, 221, 0.4);
}

html[data-theme="dark"] tbody td,
html[data-theme="dark"] .manager-report-table td {
    background: rgba(255, 255, 255, 0.04);
    border-top-color: rgba(255, 255, 255, 0.06);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

tbody tr td:first-child,
.manager-report-table tr td:first-child {
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
}

tbody tr td:last-child,
.manager-report-table tr td:last-child {
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
}

.modal-overlay {
    z-index: 1000;
    background:
        radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.36), transparent 24%),
        rgba(40, 49, 48, 0.38);
    backdrop-filter: blur(16px) saturate(112%);
    -webkit-backdrop-filter: blur(16px) saturate(112%);
}

html[data-theme="dark"] .modal-overlay {
    background:
        radial-gradient(circle at 50% 40%, rgba(49, 209, 195, 0.12), transparent 26%),
        rgba(0, 0, 0, 0.58);
}

.modal-window {
    border-radius: 34px;
    border: 1px solid var(--glass-line);
    box-shadow: 0 44px 120px rgba(24, 34, 49, 0.28);
}

html[data-theme="dark"] .modal-window {
    box-shadow: 0 48px 130px rgba(0, 0, 0, 0.58);
}

.system-confirm-window {
    width: min(92vw, 620px);
    padding: 22px;
    border-radius: 30px;
}

.system-confirm-icon {
    background:
        radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.82), transparent 36%),
        linear-gradient(145deg, rgba(255, 245, 218, 0.95), rgba(255, 236, 184, 0.72));
    border-color: rgba(243, 165, 59, 0.42);
    color: #9a4b12;
    box-shadow: 0 18px 40px rgba(243, 165, 59, 0.16);
}

html[data-theme="dark"] .system-confirm-icon {
    background:
        radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.16), transparent 36%),
        linear-gradient(145deg, rgba(255, 184, 90, 0.2), rgba(255, 184, 90, 0.08));
    color: var(--accent-warm);
}

.system-confirm-header h2 {
    font-size: clamp(22px, 2vw, 29px);
}

.system-confirm-actions {
    margin-inline: auto;
    gap: 12px;
    padding: 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid var(--panel-border);
}

html[data-theme="dark"] .system-confirm-actions {
    background: rgba(255, 255, 255, 0.055);
}

.system-confirm-actions button {
    min-height: 44px;
    border-radius: 18px;
}

.result-track-modal-window,
.settings-modal-window {
    border-radius: 34px;
}

.result-track-map-shell,
.service-base-map,
.result-track-map,
.route-restrictions-map-shell {
    border-radius: 28px;
}

.leaflet-container {
    background: #dbe7e2;
}

html[data-theme="dark"] .leaflet-container {
    background: #111827;
}

.footer-actions .secondary-button {
    min-width: 190px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .app-sidebar {
        position: static;
        min-height: auto;
        border-radius: 28px;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header-actions {
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 10px;
    }

    .app-surface,
    .modal-window,
    .main-form,
    .table-wrapper {
        border-radius: 24px;
    }

    .page-header h1 {
        font-size: 30px;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .page-header-actions,
    .results-toolbar-actions,
    .manager-report-header-actions {
        justify-content: stretch;
    }

    .toolbar-button,
    .theme-toggle-button,
    .results-toolbar-actions .secondary-button,
    .results-toolbar-actions .column-picker-button {
        width: 100%;
    }

    .system-confirm-window {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .system-confirm-actions {
        grid-template-columns: 1fr;
    }
}

.system-confirm-overlay {
    z-index: 1200;
}

.system-confirm-overlay {
    z-index: 1200;
}

/* ============================================================ */
/* РАЗДЕЛ 15: КАРТА ОГРАНИЧЕНИЙ */
/* ============================================================ */
.route-restrictions-layout {
    display: grid;
    grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.route-restrictions-panel {
    min-width: 0;
}

.route-restrictions-form {
    margin-bottom: 16px;
}

.route-restrictions-report-form {
    margin-bottom: 16px;
    border-color: rgba(31, 111, 235, 0.24);
}

.route-restrictions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-restrictions-subheading {
    margin-top: 16px;
}

.route-restrictions-actions {
    align-items: center;
}

.route-restrictions-status {
    min-height: 22px;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
}

.route-restrictions-status-error {
    color: #b91c1c;
    font-weight: 700;
}

.route-restrictions-click-hint {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(31, 111, 235, 0.08);
    border: 1px solid rgba(31, 111, 235, 0.16);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.route-restrictions-active-button {
    border-color: rgba(31, 111, 235, 0.42) !important;
    color: #1f6feb !important;
    background: rgba(31, 111, 235, 0.08) !important;
}

.route-restrictions-map-shell {
    min-height: 720px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(214, 228, 220, 0.9);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: var(--shadow-card);
}

.route-restrictions-map {
    width: 100%;
    height: 100%;
    min-height: 720px;
}

.route-restrictions-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.route-restrictions-summary-item {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(214, 228, 220, 0.9);
}

.route-restrictions-summary-item strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
}

.route-restrictions-list {
    display: grid;
    gap: 10px;
}

.route-restrictions-empty {
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(214, 228, 220, 0.9);
    color: var(--text-soft);
}

.route-restrictions-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(214, 228, 220, 0.9);
    box-shadow: var(--shadow-card);
}

.route-restrictions-match h3 {
    margin: 7px 0 5px;
    font-size: 16px;
    line-height: 1.25;
}

.route-restrictions-match p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
}

.route-restrictions-match-blocking {
    border-color: rgba(185, 28, 28, 0.35);
}

.route-restrictions-match-warning {
    border-color: rgba(217, 119, 6, 0.35);
}

.route-restrictions-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.08);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
}

.route-restrictions-conflict {
    margin-top: 6px !important;
    color: #b91c1c !important;
    font-weight: 700;
}

.route-restrictions-source {
    margin-top: 7px !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    line-height: 1.35;
}

.route-restrictions-popup-type {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.route-restrictions-popup-description {
    margin: 8px 0 0;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.4;
}

.route-restrictions-popup-details {
    display: grid;
    gap: 4px;
    margin: 10px 0 0;
}

.route-restrictions-popup-details div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
}

.route-restrictions-popup-details dt {
    color: var(--text-muted);
    font-size: 12px;
}

.route-restrictions-popup-details dd {
    margin: 0;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
}

.route-restrictions-tags {
    margin: 8px 0 0 !important;
    color: var(--text-muted) !important;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px !important;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.route-restrictions-match-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    color: var(--text-soft);
    font-size: 12px;
    text-align: right;
}

.route-restrictions-match-meta strong {
    color: var(--text-main);
    font-size: 18px;
}

.route-restrictions-toggle {
    justify-content: flex-start;
}

.route-restrictions-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(214, 228, 220, 0.9);
    cursor: pointer;
}

.route-restrictions-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.route-restrictions-checkbox span {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .route-restrictions-layout {
        grid-template-columns: 1fr;
    }

    .route-restrictions-map-shell,
    .route-restrictions-map {
        min-height: 480px;
    }
}

@media (max-width: 720px) {
    .route-restrictions-grid,
    .route-restrictions-summary {
        grid-template-columns: 1fr;
    }

    .route-restrictions-match {
        grid-template-columns: 1fr;
    }

    .route-restrictions-match-meta {
        align-items: flex-start;
        text-align: left;
    }

    .system-confirm-window {
        grid-template-columns: 1fr;
    }

    .system-confirm-actions {
        grid-template-columns: 1fr;
    }
}

:root {
    --ui-scale: 1;
    --viewport-height: 100vh;
    --bg-main: #eef5ef;
    --bg-accent: #f8fbf6;
    --panel: rgba(255, 255, 255, 0.72);
    --panel-strong: rgba(255, 255, 255, 0.9);
    --panel-border: rgba(201, 214, 208, 0.8);
    --text-main: #1f2937;
    --text-soft: #6b7280;
    --text-muted: #94a3b8;
    --shadow-soft: 0 14px 40px rgba(136, 156, 145, 0.12);
    --shadow-card: 0 8px 24px rgba(116, 136, 126, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --brand: #1f2937;
    --brand-soft: #edf2ef;
    --brand-line: #d8e4dd;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at bottom left, rgba(229, 238, 174, 0.45), transparent 26%),
        radial-gradient(circle at top left, rgba(207, 238, 245, 0.8), transparent 28%),
        linear-gradient(180deg, #eef7f6 0%, #f8faf8 100%);
    color: var(--text-main);
    min-height: 100vh;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    zoom: var(--ui-scale);
}

body.loading-active,
body.modal-open {
    overflow: hidden;
}

/* ============================================================ */
/* РАЗДЕЛ 1: ОСНОВНАЯ СЕТКА И САЙДБАР */
/* ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    min-height: 100vh;
    padding: 18px;
}

.app-sidebar {
    position: sticky;
    top: 18px;
    align-self: start;
    min-height: calc(100vh - 36px);
    padding: 18px 14px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(241, 250, 248, 0.78), rgba(241, 248, 233, 0.62));
    border: 1px solid rgba(214, 228, 220, 0.9);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
}

.sidebar-brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(214, 228, 220, 0.9);
    font-weight: 700;
    color: var(--brand);
    box-shadow: var(--shadow-card);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    display: block;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-brand-text strong {
    font-size: 15px;
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-size: 12px;
    color: var(--text-soft);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 15px;
    background: transparent;
    transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

#manualInputSection,
#excelImportSection,
#resultsSection,
#errorsSection {
    scroll-margin-top: 34px;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(2px);
}

.sidebar-nav-item-active {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(214, 228, 220, 0.95);
    box-shadow: var(--shadow-card);
    font-weight: 700;
}

.sidebar-meta {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.sidebar-meta-card {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(214, 228, 220, 0.9);
    box-shadow: var(--shadow-card);
}

.sidebar-meta-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.sidebar-meta-card strong {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-meta-subtext {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-soft);
    line-height: 1.45;
}

.app-main {
    min-width: 0;
    padding: 6px 0 28px;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0;
}

.app-surface {
    padding: 22px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(214, 228, 220, 0.9);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
}

/* ============================================================ */
/* РАЗДЕЛ 2: ШАПКА, КНОПКИ, ФОРМЫ */
/* ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding: 6px 4px 14px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.toolbar-button {
    min-height: 48px;
    padding: 0 20px;
    border-radius: 18px;
    font-weight: 600;
}

button,
.secondary-button,
.settings-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    appearance: none;
}

button {
    padding: 11px 18px;
    border-radius: 14px;
    border: none;
    background: #1f2937;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(31, 41, 55, 0.14);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

button:hover {
    background: #111827;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.18);
}

.secondary-button {
    background: rgba(248, 250, 249, 0.95);
    color: var(--text-main);
    border: 1px solid var(--brand-line);
    box-shadow: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.secondary-button:hover,
.secondary-button:focus {
    background: #ffffff;
    color: var(--text-main);
    border-color: rgba(188, 205, 195, 0.95);
    text-decoration: none;
}

button:focus-visible,
.secondary-button:focus-visible,
.settings-primary-action:focus-visible,
.file-input-shell:focus-within {
    outline: none;
    box-shadow: 0 0 0 4px rgba(216, 228, 221, 0.72), 0 12px 28px rgba(116, 136, 126, 0.12);
}

button:disabled,
.secondary-button[aria-disabled="true"] {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.icon-button {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #111827;
    padding: 6px 10px;
    border-radius: 8px;
}

.icon-button:hover {
    background: #f3f4f6;
    transform: none;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.main-form {
    background: var(--panel-strong);
    padding: 20px;
    border-radius: 22px;
    margin-bottom: 18px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-card);
}

.modal-form.main-form {
    margin-bottom: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #334155;
    font-size: 13px;
}

textarea,
input[type="text"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #d7e1db;
    margin-bottom: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-main);
}

.file-input-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}

.file-input-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid #d7e1db;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.file-input-shell:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: #bccdc3;
    box-shadow: 0 0 0 4px rgba(216, 228, 221, 0.45);
}

.file-input-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    background: #1f2937;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.file-input-name {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #bccdc3;
    box-shadow: 0 0 0 4px rgba(216, 228, 221, 0.7);
}

textarea {
    resize: vertical;
    min-height: 220px;
}

.compact-manual-form {
    padding-top: 16px;
    padding-bottom: 16px;
}

.compact-manual-form textarea {
    min-height: 150px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-heading p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================================ */
/* РАЗДЕЛ 3: ОПОВЕЩЕНИЯ И ТОТАЛЫ */
/* ============================================================ */
.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    box-shadow: var(--shadow-card);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #e0f2fe;
    color: #0f4c81;
    border: 1px solid #bae6fd;
}

.totals {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.total-card {
    background: var(--panel-strong);
    padding: 22px;
    border-radius: 22px;
    flex: 1;
    text-align: center;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-card);
}

.total-title {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
}

.total-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

/* ============================================================ */
/* РАЗДЕЛ 4: ТАБЛИЦА РЕЗУЛЬТАТОВ */
/* ============================================================ */
.table-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 20px;
    z-index: 1;
    isolation: isolate;
    background: var(--panel-strong);
    border-radius: 24px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-card);
    padding: 10px;
}

.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    padding: 6px 4px;
    position: relative;
    z-index: 1400;
    isolation: isolate;
    overflow: visible;
}

.results-toolbar-title {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}

.results-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.results-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.results-toolbar-actions .secondary-button,
.results-toolbar-actions .column-picker-button {
    min-height: 50px;
    padding: 0 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(214, 228, 220, 0.95);
    box-shadow: 0 10px 24px rgba(116, 136, 126, 0.08);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.results-toolbar-actions .secondary-button:hover,
.results-toolbar-actions .secondary-button:focus,
.results-toolbar-actions .column-picker-button:hover,
.results-toolbar-actions .column-picker-button:focus {
    background: #ffffff;
    border-color: rgba(188, 205, 195, 0.95);
    box-shadow: 0 14px 30px rgba(116, 136, 126, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
}

.manager-report-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    text-decoration: none;
    white-space: nowrap;
}

.manager-report-link-button:hover,
.manager-report-link-button:focus {
    text-decoration: none;
}

.vehicle-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 6px 8px 6px 14px;
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    background: rgba(248, 250, 249, 0.95);
}

.vehicle-filter span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.vehicle-filter input {
    width: 170px;
    min-height: 28px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
}

.vehicle-filter input:focus {
    outline: none;
    box-shadow: none;
}

.vehicle-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--text-muted);
    border: 1px solid var(--brand-line);
    box-shadow: none;
    line-height: 1;
}

.vehicle-filter-clear:hover {
    background: #f8faf9;
    color: var(--text-main);
    transform: none;
    box-shadow: none;
}

.history-filter-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.history-month-filter input {
    width: 120px;
}

.results-filter-summary {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}

.empty-filter-row {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 700;
}

.error-correction-status {
    min-height: 20px;
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.error-correction-status.is-success {
    color: #166534;
}

.error-correction-status.is-error {
    color: #b91c1c;
}

.error-correction-action {
    display: grid;
    gap: 8px;
    min-width: 220px;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.35;
}

.error-correction-button {
    justify-self: start;
    min-height: 36px;
    padding: 7px 12px;
    white-space: nowrap;
}

.column-picker {
    position: relative;
    z-index: 2200;
    overflow: visible;
}

.column-picker-button {
    min-width: 160px;
    min-height: 46px;
}

.column-picker-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 2600;
    width: 280px;
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dde7e1;
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(106, 126, 116, 0.14);
    backdrop-filter: blur(16px);
    padding: 14px;
    display: none;
}

.column-picker.is-open .column-picker-panel {
    display: block;
}

.column-picker-panel.hidden {
    display: none !important;
}

.column-picker-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.manager-report-card {
    background: var(--panel-strong);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 18px;
    margin: 0 0 24px;
}

.manager-report-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.manager-report-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.manager-report-header p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.45;
}

.manager-report-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.manager-report-table-wrapper {
    overflow-x: auto;
}

.manager-report-table {
    min-width: 1380px;
}

.column-picker-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.column-picker-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    margin: 0;
}

.column-picker-option input {
    width: auto;
    margin: 0;
}

.column-hidden {
    display: none;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: none;
}

th {
    background: rgba(243, 247, 244, 0.95);
    color: #475569;
    padding: 13px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #dde7e1;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 0 rgba(221, 231, 225, 0.95);
}

td {
    padding: 14px 12px;
    border-top: 1px solid #edf2ef;
    border-bottom: 1px solid #edf2ef;
    font-size: 13px;
    vertical-align: top;
    background: rgba(255, 255, 255, 0.9);
}

tr:hover td {
    background: #fbfcfb;
}

tbody tr td:first-child {
    border-left: 1px solid #edf2ef;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

tbody tr td:last-child {
    border-right: 1px solid #edf2ef;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

.route-cell {
    min-width: 280px;
}

.route-cell-title {
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 4px;
}

.route-cell-meta {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

.row-number-cell {
    min-width: 52px;
    text-align: center;
    font-weight: 700;
    color: #475569;
}

.result-row-indicator {
    display: inline-flex;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.row-indicator-green {
    background: #16a34a;
    border-color: #15803d;
}

.row-indicator-yellow {
    background: #f59e0b;
    border-color: #d97706;
}

.row-indicator-red {
    background: #dc2626;
    border-color: #b91c1c;
}

.result-track-button {
    white-space: nowrap;
}

/* ============================================================ */
/* РАЗДЕЛ 5: НАСТРОЙКИ И МОДАЛЬНЫЕ ОКНА */
/* ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
    align-items: stretch;
    align-content: start;
    grid-column: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: 100%;
    padding: 2px 8px 10px 0;
}

.field-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    min-height: 0;
    padding: 10px 14px;
    border-radius: 18px;
    background: rgba(250, 252, 251, 0.9);
    border: 1px solid rgba(220, 228, 223, 0.95);
    box-shadow: 0 8px 20px rgba(127, 141, 133, 0.06);
}

.field-group-wide {
    grid-column: span 2;
    min-height: 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(29, 41, 34, 0.22);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 20px;
    backdrop-filter: blur(12px);
}

.modal-window {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    padding: 22px;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(218, 228, 222, 0.95);
    box-shadow: 0 24px 64px rgba(92, 110, 101, 0.16);
    backdrop-filter: blur(18px);
}

.modal-window-wide {
    width: 960px;
    max-width: calc(100vw - 40px);
}

.settings-modal-window {
    width: min(99vw, 1680px);
    max-height: min(98vh, calc(var(--viewport-height) - 8px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 16px;
}

.settings-modal-window .modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.settings-form-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(480px, 0.92fr);
    align-items: start;
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding-right: 0;
    padding-bottom: 0;
    height: min(70vh, calc(var(--viewport-height) - 220px));
}

#omnicommAuthModal {
    z-index: 1002;
}

.auth-modal-window {
    width: min(92vw, 760px);
}

.auth-settings-grid {
    margin-top: 0;
}

.system-confirm-overlay {
    z-index: 1200;
}

.system-confirm-window {
    width: min(92vw, 620px);
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
    padding: 22px;
    overflow: visible;
}

.system-confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 36%),
        linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1px solid rgba(245, 158, 11, 0.34);
    color: #92400e;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 14px 32px rgba(146, 64, 14, 0.12);
}

.system-confirm-content {
    min-width: 0;
}

.system-confirm-header {
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.system-confirm-header h2 {
    margin-top: 4px;
    font-size: clamp(24px, 2.15vw, 30px);
    line-height: 1.12;
}

.system-confirm-header .icon-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(220, 228, 223, 0.78);
    box-shadow: 0 10px 24px rgba(116, 136, 126, 0.08);
    font-size: 24px;
}

.system-confirm-message {
    max-width: 500px;
    margin: 0 0 18px;
    color: var(--text-main);
    font-size: clamp(15px, 1.25vw, 17px);
    line-height: 1.48;
    letter-spacing: -0.01em;
}

.system-confirm-actions {
    width: min(100%, 500px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
}

.system-confirm-actions button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(220, 228, 223, 0.95);
}

.settings-modal-header-actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0 0 4px;
    font-size: 32px;
    letter-spacing: -0.03em;
}

.modal-subtitle {
    margin: 0;
    color: #70808f;
    font-size: 14px;
    line-height: 1.45;
}

.modal-actions {
    margin-top: 18px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(250, 252, 251, 0.92);
    border: 1px solid rgba(220, 228, 223, 0.95);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(127, 141, 133, 0.06);
}

.settings-primary-action {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 16px;
    background: #1f2937;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(31, 41, 55, 0.16);
    border: none;
}

.settings-modal-actions {
    position: static;
    z-index: 4;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(220, 228, 223, 0.95);
}

.result-track-modal-window {
    width: min(99vw, 1920px);
    max-height: min(98vh, calc(var(--viewport-height) - 8px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-track-header-meta {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
    gap: 14px;
    margin: -4px 0 14px;
}

.result-track-header-card {
    background: rgba(251, 253, 252, 0.92);
    border: 1px solid rgba(222, 231, 225, 0.95);
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-card);
}

.result-track-header-card strong {
    font-size: 17px;
    line-height: 1.45;
    color: #111827;
}

.result-track-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.74fr) minmax(760px, 1.02fr);
    gap: 14px;
    align-items: start;
    flex: 1 1 auto;
    height: min(74vh, calc(var(--viewport-height) - 240px));
    min-height: 0;
    overflow: hidden;
}

.result-track-map-panel {
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 0;
    padding: 8px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(220, 228, 223, 0.9);
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    max-height: none;
    overflow: hidden;
}

.result-track-map-shell {
    position: relative;
}

.result-track-map-overlay {
    position: absolute;
    left: 14px;
    top: 14px;
    right: 92px;
    z-index: 500;
    display: grid;
    grid-template-columns: repeat(4, minmax(116px, 156px));
    gap: 8px;
    pointer-events: none;
}

.result-track-summary-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-width: 0;
    pointer-events: auto;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    text-align: center;
}

.result-track-summary-item strong {
    font-size: 11px;
    line-height: 1.3;
    word-break: break-word;
}

.result-track-summary-item-main strong {
    font-size: 12px;
}

.summary-label {
    font-size: 10px;
    color: #6b7280;
}

.result-track-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #243024;
    color: #ffffff;
    border-radius: 999px;
    padding: 10px 14px;
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 14px 30px rgba(33, 42, 36, 0.2);
}

.result-track-map-footer,
.result-track-map-legend,
.result-track-map-legend .legend-item,
.result-track-map-legend .legend-dot {
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.result-track-map-footer {
    background: #ffffff !important;
}

.result-track-map-legend {
    background: #243024 !important;
    color: #ffffff !important;
}

.result-track-map-footer {
    position: static;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    background: #ffffff;
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 18px;
    padding: 4px 6px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    opacity: 1;
}

.legend-dot-load {
    background: #2563eb;
}

.legend-dot-route {
    background: #e3342f;
}

.legend-dot-empty-route {
    background: #0ea5e9;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.legend-dot-empty-start-suggestion {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.legend-dot-intermediate {
    background: #f97316;
}

.legend-dot-extra-load {
    background: #0ea5a4;
}

.legend-dot-candidate-load {
    background: #0f766e;
}

.legend-dot-candidate-unload {
    background: #ea580c;
}

.legend-dot-unload {
    background: #1d4ed8;
}

.result-track-side-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    height: 100%;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 12px 24px 0;
    scroll-padding-bottom: 120px;
    scrollbar-width: thin;
    scrollbar-color: rgba(150, 170, 160, 0.8) rgba(220, 228, 223, 0.3);
}

.result-track-side-panel::-webkit-scrollbar {
    width: 12px;
}

.result-track-side-panel::-webkit-scrollbar-track {
    background: transparent;
}

.result-track-side-panel::-webkit-scrollbar-thumb {
    background: rgba(150, 170, 160, 0.8);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.result-track-side-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 140, 130, 0.95);
    background-clip: padding-box;
}

.result-track-side-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 249, 0.94));
    border: 1px solid rgba(220, 230, 225, 0.8);
    border-radius: 24px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(100, 120, 110, 0.06);
    transition: all 0.2s ease;
}

.result-track-side-card:hover {
    border-color: rgba(200, 220, 210, 0.9);
    box-shadow: 0 6px 20px rgba(100, 120, 110, 0.1);
}

.result-track-side-card-sticky {
    position: relative;
    z-index: 6;
    padding: 22px;
    margin: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 249, 0.97));
    box-shadow: 0 12px 28px rgba(100, 120, 110, 0.08);
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.result-track-candidate-scroll {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: auto;
    flex: 0 0 auto;
    overflow: visible;
    padding-right: 0;
}

.result-track-side-card strong {
    font-size: 16px;
    line-height: 1.5;
    color: #111827;
    font-weight: 600;
}

.result-track-side-note {
    color: #6b7280;
    line-height: 1.6;
    font-size: 13px;
}

.result-track-side-note-strong {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

.result-track-gap-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 0 0 auto;
    overflow-y: auto;
    padding-right: 8px;
    max-height: min(28vh, 300px);
}

#resultTrackGapCard {
    flex: 0 0 auto;
    min-height: 220px;
    max-height: none;
    overflow: visible;
}

.result-track-gap-item {
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, rgba(249, 250, 251, 0.9) 100%);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(100, 120, 110, 0.04);
}

.result-track-gap-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.result-track-gap-row {
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
}

.result-track-gap-row strong {
    color: #374151;
    font-weight: 600;
}

.result-track-candidate-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-track-candidate-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 0 12px 0;
    margin: 0;
    background: transparent;
    backdrop-filter: none;
}

.result-track-candidate-controls .secondary-button.is-active {
    background: rgba(219, 234, 254, 0.95);
    border-color: #3b82f6;
    color: #1e40af;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
    font-weight: 600;
}

.result-track-candidate-heading {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    padding: 4px 0;
}

.result-track-candidate-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 12px;
}

.result-track-candidate-option {
    width: 100%;
    border: 1px solid rgba(220, 230, 225, 0.7);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 249, 0.96));
    border-radius: 20px;
    display: flex;
    align-items: stretch;
    gap: 14px;
    text-align: left;
    color: #334155;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    padding: 14px 16px;
    scroll-margin-top: 160px;
    justify-content: space-between;
}

.result-track-candidate-option:hover {
    border-color: #bdd3c6;
    box-shadow: 0 12px 26px rgba(127, 141, 133, 0.1);
    transform: translateY(-1px);
}

.result-track-candidate-option.is-active {
    border-color: #2563eb;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.14);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(245, 249, 255, 0.96));
}

.result-track-candidate-select {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
    min-height: auto;
    transform: none;
    justify-content: flex-start;
}

.result-track-candidate-select:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.candidate-option-badge {
    min-width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f0ec;
    color: #1f2937;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}

.result-track-candidate-option.is-active .candidate-option-badge {
    background: #2563eb;
    color: #ffffff;
}

.candidate-option-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding-top: 2px;
}

.candidate-option-body strong {
    font-size: 15px;
    line-height: 1.4;
    color: #111827;
}

.candidate-option-body span {
    font-size: 14px;
    line-height: 1.55;
    color: #4b5563;
}

.candidate-option-body span:last-child {
    color: #64748b;
    font-size: 13px;
}

.candidate-role-swap-button {
    align-self: center;
    border: 1px solid #cfdcd3;
    background: rgba(248, 251, 249, 0.98);
    color: #1f2937;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    box-shadow: none;
    min-height: auto;
}

.candidate-option-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.candidate-order-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.candidate-order-button {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #d6e2dc;
    background: rgba(248, 251, 249, 0.98);
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.candidate-order-button:hover:not(:disabled) {
    background: #eef6f1;
    border-color: #a8c7b2;
    transform: translateY(-1px);
}

.candidate-order-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.candidate-role-swap-button:hover {
    background: #eef6f1;
    border-color: #a8c7b2;
    transform: translateY(-1px);
}

.result-track-empty-note {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    padding: 8px 2px 2px;
}

.result-track-start-warning {
    display: grid;
    gap: 4px;
    margin: 12px 0;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(245, 158, 11, 0.38);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.7));
    color: #92400e;
    font-size: 14px;
    line-height: 1.45;
}

.result-track-start-warning strong {
    color: #78350f;
}

.result-track-start-suggestion {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(255, 255, 255, 0.68);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.result-track-start-suggestion:hover,
.result-track-start-suggestion.is-highlighted {
    border-color: rgba(245, 158, 11, 0.85);
    box-shadow: 0 14px 30px rgba(146, 64, 14, 0.16);
    transform: translateY(-1px);
}

.result-track-start-suggestion-title {
    font-weight: 800;
    color: #7c2d12;
}

.result-track-start-suggestion-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-track-start-button {
    justify-self: start;
    margin-top: 6px;
    min-height: 38px;
    padding: 8px 16px;
}

.track-pin-empty-start {
    background: #0ea5e9;
}

.track-pin-empty-start-suggestion {
    background: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.24), 0 12px 28px rgba(146, 64, 14, 0.34);
    position: relative;
}

.manager-map-button {
    min-height: 42px;
    padding: 10px 18px;
    white-space: nowrap;
}

.result-track-candidate-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 8px 0 0;
    padding: 14px 0 0;
    background: linear-gradient(180deg, rgba(248, 251, 249, 0) 0%, rgba(248, 251, 249, 0.95) 18%, rgba(248, 251, 249, 0.99) 100%);
    border-top: 1px solid rgba(220, 230, 225, 0.72);
    backdrop-filter: blur(10px);
}

.result-track-apply-status {
    font-size: 12px;
    line-height: 1.45;
    color: #4b5563;
}

.result-track-apply-status.is-success {
    color: #166534;
}

.result-track-apply-status.is-error {
    color: #b91c1c;
}

/* ============================================================ */
/* РАЗДЕЛ 6: КАРТА И ГЕО-ЭЛЕМЕНТЫ */
/* ============================================================ */
.map-block {
    margin-top: 0;
    padding: 16px;
    border-radius: 22px;
    background: rgba(250, 252, 251, 0.9);
    border: 1px solid rgba(220, 228, 223, 0.95);
    box-shadow: 0 8px 20px rgba(127, 141, 133, 0.06);
    position: sticky;
    top: 0;
    min-height: 0;
    max-height: 100%;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.map-block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.map-block-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.map-block-header p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
    max-width: 700px;
}

.map-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.service-base-map {
    width: 100%;
    height: auto;
    min-height: clamp(280px, 34vh, 420px);
    border-radius: 10px;
    margin-top: 12px;
    border: 1px solid #d1d5db;
    overflow: hidden;
    background: #eef2f7;
    flex: 1 1 auto;
}

.result-track-map {
    width: 100%;
    height: min(48vh, 500px);
    border-radius: 20px;
    border: 1px solid rgba(217, 226, 220, 0.95);
    overflow: hidden;
    background: #eef2f7;
}

.track-badge-icon,
.track-pin-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.track-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    font-size: 11px;
}

.track-badge-load {
    background: #2563eb;
}

.track-badge-unload {
    background: #1d4ed8;
}

.track-pin-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #f97316;
    border: 2px solid rgba(255, 255, 255, 0.95);
    font-size: 10px;
    letter-spacing: -0.2px;
}

.track-pin-extra-load {
    background: #0ea5a4;
}

.track-pin-extra-unload {
    background: #f97316;
}

.track-pin-candidate-load {
    background: #0f766e;
}

.track-pin-candidate-unload {
    background: #ea580c;
}

.track-pin-candidate-muted {
    opacity: 0.78;
}

.track-pin-candidate-selected {
    opacity: 1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.38);
    transform: scale(1.08);
}

.track-arrow-icon {
    width: 0;
    height: 0;
    border-left: 18px solid #ffe600;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    opacity: 1;
}

.map-note {
    margin-top: 12px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
    padding: 0 2px;
}

.modal-form label {
    margin-bottom: 0;
    line-height: 1.35;
}

.modal-form .secondary-button {
    min-width: 156px;
}

.modal-form button[type="submit"] {
    min-width: 220px;
}

.modal-form .field-group input {
    margin-bottom: 0;
}

.settings-form-body > input[type="hidden"] {
    display: none;
}

.modal-form .field-group:last-child {
    padding-bottom: 10px;
}

.leaflet-top.leaflet-right .leaflet-control {
    margin-top: 12px;
    margin-right: 12px;
}

/* ============================================================ */
/* РАЗДЕЛ 7: ОВЕРЛЕЙ ЗАГРУЗКИ */
/* ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.loading-box {
    background: #ffffff;
    padding: 28px 24px;
    border-radius: 14px;
    text-align: center;
    width: 330px;
    max-width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
}

.loading-text {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.45;
}

.loading-actions {
    margin-top: 16px;
}

.hidden {
    display: none;
}

.loading-overlay.hidden {
    display: none !important;
}

.modal-overlay.hidden {
    display: none !important;
}

/* ============================================================ */
/* РАЗДЕЛ 8: АУТЕНТИФИКАЦИЯ, СОГЛАШЕНИЕ, ПОДДЕРЖКА */
/* ============================================================ */
.auth-body,
.agreement-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(207, 238, 245, 0.78), transparent 28%),
        radial-gradient(circle at bottom left, rgba(229, 238, 174, 0.3), transparent 24%),
        linear-gradient(180deg, #eef7f6 0%, #f8faf8 100%);
}

.auth-shell,
.agreement-shell {
    width: min(1160px, calc(100vw - 32px));
    margin: 24px auto;
    padding: 28px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(214, 228, 220, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.auth-hero {
    display: grid;
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
}

.auth-logo-wrap {
    width: 120px;
    height: 120px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(214, 228, 220, 0.9);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo,
.agreement-logo {
    width: 76px;
    height: 76px;
    display: block;
}

.auth-topbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.auth-logo-wrap-large {
    width: 152px;
    height: 152px;
    border-radius: 36px;
}

.page-corner-links {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding: 4px 2px 0;
    flex-wrap: wrap;
}

.auth-corner-links {
    margin-top: 22px;
}

.auth-logo-large {
    width: 100px;
    height: 100px;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--brand-line);
    color: var(--text-soft);
    font-size: 12px;
    margin-bottom: 14px;
}

.auth-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-hero-text h1,
.agreement-header h1 {
    margin: 0 0 10px;
    font-size: 42px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.auth-hero-text p,
.agreement-header p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-soft);
    max-width: 760px;
}

.auth-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.auth-card {
    padding: 22px;
    border-radius: 24px;
    background: rgba(250, 252, 251, 0.92);
    border: 1px solid rgba(220, 228, 223, 0.95);
    box-shadow: var(--shadow-card);
}

.auth-card h2 {
    margin: 0 0 6px;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.auth-card-note {
    margin: 0 0 18px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    margin-bottom: 6px;
}

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 12px;
    font-size: 13px;
    color: var(--text-soft);
}

.auth-checkbox input {
    width: auto;
    margin: 2px 0 0;
}

.auth-checkbox a {
    color: #1f2937;
    font-weight: 600;
}

.auth-card-footer {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-soft);
}

.auth-card-footer a {
    color: var(--text-main);
    font-weight: 600;
}

.support-shell {
    width: min(1280px, calc(100vw - 32px));
}

.support-panels {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.support-guide {
    display: grid;
    gap: 14px;
}

.support-guide-item {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(248, 250, 249, 0.88);
    border: 1px solid rgba(214, 228, 220, 0.88);
}

.support-guide-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
}

.support-guide-item p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.agreement-header {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px;
    align-items: center;
    margin-bottom: 26px;
}

.agreement-content {
    display: grid;
    gap: 16px;
}

.agreement-content section {
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(250, 252, 251, 0.92);
    border: 1px solid rgba(220, 228, 223, 0.95);
    box-shadow: var(--shadow-card);
}

.agreement-content h2 {
    margin: 0 0 8px;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.agreement-content p {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.65;
}

/* ============================================================ */
/* РАЗДЕЛ 9: АДМИН-ПАНЕЛЬ И АНАЛИТИКА */
/* ============================================================ */
.admin-shell {
    width: min(1520px, calc(100vw - 28px));
    margin: 18px auto;
    padding: 26px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(214, 228, 220, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.admin-brand {
    padding: 0;
    margin-bottom: 12px;
}

.admin-page-title h1 {
    margin: 0 0 8px;
    font-size: 42px;
    line-height: 1.05;
}

.admin-page-title p {
    margin: 0;
    font-size: 18px;
    color: var(--text-soft);
}

.admin-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-summary-card,
.admin-card {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(214, 228, 220, 0.92);
    box-shadow: var(--shadow-card);
}

.admin-summary-card {
    padding: 18px 20px;
}

.admin-summary-card span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.admin-summary-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.admin-summary-card div {
    font-size: 14px;
    color: var(--text-soft);
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.8fr);
    gap: 16px;
    align-items: start;
}

.admin-grid-top {
    margin-bottom: 16px;
}

.admin-card {
    padding: 18px;
}

.admin-inline-form {
    margin-top: 6px;
}

.admin-filter-form {
    margin-bottom: 14px;
}

.admin-filter-form-inline {
    margin-top: 8px;
}

.admin-filter-grid,
.admin-filter-row {
    display: grid;
    gap: 10px;
}

.admin-filter-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr) auto;
}

.admin-filter-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.admin-filter-form input,
.admin-filter-form select {
    margin-bottom: 0;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.admin-form-grid .field-group-wide {
    grid-column: 1 / -1;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.admin-card-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.admin-card-header p {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.5;
}

.admin-table-wrapper {
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(214, 228, 220, 0.78);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.admin-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.admin-table tr.is-selected {
    background: rgba(231, 244, 239, 0.68);
}

.admin-role-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.admin-role-chip.role-admin {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.admin-role-chip.role-user {
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
}

.admin-role-chip.role-inactive {
    margin-top: 8px;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.admin-table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-table-actions form {
    margin: 0;
}

.admin-small-button {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    min-width: 0;
}

.admin-muted {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-soft);
}

.admin-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 920px;
    overflow: auto;
    padding-right: 4px;
}

.admin-event-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(248, 250, 249, 0.92);
    border: 1px solid rgba(214, 228, 220, 0.88);
}

.admin-event-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
}

.admin-event-main span,
.admin-event-user {
    color: var(--text-soft);
    font-size: 13px;
}

.admin-event-user {
    margin-bottom: 8px;
}

.admin-event-details {
    margin: 0;
    font-family: "Consolas", "SFMono-Regular", monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-main);
}

.admin-empty-state {
    padding: 26px 18px;
    border-radius: 18px;
    text-align: center;
    color: var(--text-soft);
    background: rgba(248, 250, 249, 0.92);
    border: 1px solid rgba(214, 228, 220, 0.88);
}

.admin-support-list {
    display: grid;
    gap: 10px;
}

.admin-support-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(248, 250, 249, 0.92);
    border: 1px solid rgba(214, 228, 220, 0.88);
}

.admin-support-meta {
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

.admin-support-message {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
}

.admin-analytics-list {
    display: grid;
    gap: 10px;
}

.admin-analytics-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(248, 250, 249, 0.92);
    border: 1px solid rgba(214, 228, 220, 0.88);
}

.admin-analytics-row strong {
    font-size: 15px;
}

.admin-analytics-row span {
    font-weight: 700;
    color: var(--text-main);
}

.admin-analytics-support {
    margin-top: 16px;
}

/* ============================================================ */
/* РАЗДЕЛ 10: АДАПТИВНАЯ ВЁРСТКА */
/* ============================================================ */
@media (max-width: 900px) {
    body {
        zoom: 1;
    }

    .app-shell {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .admin-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-grid,
    .admin-filter-grid,
    .admin-filter-row,
    .support-panels {
        grid-template-columns: 1fr;
    }

    .admin-page-header {
        flex-direction: column;
    }

    .app-sidebar {
        position: static;
        min-height: auto;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .field-group-wide {
        grid-column: span 1;
    }

    .totals {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-actions {
        justify-content: flex-start;
    }

    .modal-window {
        width: 100%;
    }

    .modal-window-wide {
        width: 100%;
        max-width: 100%;
    }

    .settings-modal-window {
        max-height: 95vh;
        overflow-y: auto;
    }

    .settings-form-body {
        grid-template-columns: 1fr;
        overflow: visible;
        padding-right: 0;
        padding-bottom: 96px;
    }

    .map-block {
        position: static;
        min-height: 0;
    }

    .result-track-summary {
        grid-template-columns: 1fr 1fr;
    }

    .result-track-layout {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .result-track-header-meta {
        grid-template-columns: 1fr;
    }

    .result-track-map-panel {
        position: static;
    }

    .result-track-side-panel {
        max-height: none;
        overflow: visible;
        display: flex;
        flex-direction: column;
        padding-right: 0;
    }

    .result-track-side-card-sticky,
    .result-track-candidate-scroll,
    .result-track-gap-list {
        overflow: visible;
        max-height: none;
    }

    #resultTrackGapCard {
        max-height: none;
    }

    .auth-hero,
    .agreement-header,
    .auth-panels {
        grid-template-columns: 1fr;
    }

    .auth-logo-wrap {
        width: 96px;
        height: 96px;
    }
}

@media (max-width: 640px) {
    body {
        zoom: 1;
    }

    .app-shell {
        padding: 10px;
        gap: 12px;
    }

    .admin-shell {
        width: calc(100vw - 20px);
        margin: 10px auto;
        padding: 18px;
        border-radius: 24px;
    }

    .admin-summary-grid {
        grid-template-columns: 1fr;
    }

    .admin-page-title h1 {
        font-size: 32px;
    }

    .auth-topbar {
        justify-content: stretch;
    }

    .container {
        padding: 0;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .auth-shell,
    .agreement-shell {
        width: calc(100vw - 20px);
        margin: 10px auto;
        padding: 18px;
        border-radius: 24px;
    }

    .auth-hero-text h1,
    .agreement-header h1 {
        font-size: 32px;
    }

    .actions,
    .map-actions,
    .page-header-actions,
    .sidebar-nav {
        flex-direction: column;
    }

    .modal-actions {
        justify-content: stretch;
    }

    .results-toolbar {
        align-items: stretch;
    }

    .results-toolbar-left {
        align-items: stretch;
        flex-direction: column;
    }

    .results-toolbar-actions {
        justify-content: stretch;
    }

    .vehicle-filter,
    .manager-report-link-button {
        width: 100%;
    }

    .vehicle-filter input {
        width: 100%;
    }

    .vehicle-filter-clear {
        flex: 0 0 28px;
        width: 28px;
    }

    .column-picker-button,
    .column-picker-panel {
        width: 100%;
    }

    .manager-report-card {
        padding: 14px;
    }

    button {
        width: 100%;
    }

    .service-base-map {
        height: 280px;
    }

    .result-track-map-overlay {
        position: static;
        grid-template-columns: 1fr 1fr;
        right: auto;
        margin-bottom: 10px;
    }

    .result-track-map-legend {
        position: static;
        margin-top: 10px;
        border-radius: 14px;
    }

    .result-track-map {
        height: 340px;
    }

    .loading-box {
        width: 100%;
    }
}

/* ============================================================ */
/* РАЗДЕЛ 17: ФИНАЛЬНАЯ АКТИВАЦИЯ СВЕТЛОЙ/ТЁМНОЙ UI-ТЕМЫ */
/* ============================================================ */
:root {
    --ui-font: "Manrope", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --bg-main: #e9f0ed;
    --bg-accent: #f8fbf9;
    --panel: rgba(255, 255, 255, 0.58);
    --panel-strong: rgba(255, 255, 255, 0.78);
    --panel-solid: #ffffff;
    --panel-border: rgba(215, 226, 221, 0.72);
    --glass-line: rgba(255, 255, 255, 0.74);
    --text-main: #182231;
    --text-soft: #657287;
    --text-muted: #9aa7b8;
    --brand: #192435;
    --brand-soft: rgba(25, 36, 53, 0.08);
    --brand-line: rgba(208, 222, 215, 0.78);
    --accent: #146bff;
    --accent-strong: #071b49;
    --accent-warm: #2f80ff;
    --accent-blue: #2f80ff;
    --success: #17a86b;
    --danger: #d33d3d;
    --shadow-soft: 0 34px 90px rgba(92, 113, 103, 0.18);
    --shadow-card: 0 18px 48px rgba(93, 111, 103, 0.12);
    --shadow-control: 0 16px 34px rgba(24, 34, 49, 0.12);
    --radius-xl: 36px;
    --radius-lg: 26px;
    --radius-md: 18px;
    --motion-fast: 160ms cubic-bezier(.2, .8, .2, 1);
    --motion-normal: 260ms cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
    --bg-main: #070a0f;
    --bg-accent: #0d1420;
    --panel: rgba(18, 25, 36, 0.58);
    --panel-strong: rgba(22, 30, 43, 0.76);
    --panel-solid: #121a27;
    --panel-border: rgba(127, 151, 177, 0.18);
    --glass-line: rgba(255, 255, 255, 0.12);
    --text-main: #eef4fb;
    --text-soft: #aab7c8;
    --text-muted: #758397;
    --brand: #f4f8ff;
    --brand-soft: rgba(255, 255, 255, 0.08);
    --brand-line: rgba(148, 163, 184, 0.22);
    --accent: #2f80ff;
    --accent-strong: #74a9ff;
    --accent-warm: #e8f1ff;
    --accent-blue: #74a9ff;
    --success: #42d895;
    --danger: #ff7b7b;
    --shadow-soft: 0 40px 110px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.32);
    --shadow-control: 0 18px 42px rgba(0, 0, 0, 0.42);
}

html,
body {
    font-family: var(--ui-font);
    background: var(--bg-main);
}

body {
    position: relative;
    overflow-x: hidden;
    color: var(--text-main);
    background:
        radial-gradient(circle at 12% 10%, rgba(96, 203, 195, 0.34), transparent 24%),
        radial-gradient(circle at 88% 2%, rgba(93, 141, 247, 0.25), transparent 28%),
        radial-gradient(circle at 16% 92%, rgba(243, 165, 59, 0.18), transparent 26%),
        linear-gradient(135deg, var(--bg-main) 0%, var(--bg-accent) 46%, #dfe8e4 100%);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 10% 8%, rgba(49, 209, 195, 0.18), transparent 28%),
        radial-gradient(circle at 84% 4%, rgba(93, 141, 247, 0.16), transparent 30%),
        radial-gradient(circle at 16% 92%, rgba(255, 184, 90, 0.11), transparent 26%),
        linear-gradient(135deg, #06080d 0%, #0c1522 45%, #101822 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: 0;
    background:
        linear-gradient(120deg, transparent 0 34%, rgba(255, 255, 255, 0.38) 34.2% 34.7%, transparent 35% 100%),
        linear-gradient(146deg, transparent 0 58%, rgba(15, 155, 142, 0.15) 58.2% 58.6%, transparent 59% 100%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0 1px, transparent 1px 120px);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
}

body::after {
    z-index: 0;
    background:
        radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.5), transparent 12%),
        radial-gradient(circle at 74% 72%, rgba(255, 255, 255, 0.22), transparent 18%);
    filter: blur(18px);
    opacity: 0.75;
    animation: logisticsAmbient 14s ease-in-out infinite alternate;
}

html[data-theme="dark"] body::before {
    background:
        linear-gradient(120deg, transparent 0 34%, rgba(255, 255, 255, 0.07) 34.2% 34.7%, transparent 35% 100%),
        linear-gradient(146deg, transparent 0 58%, rgba(49, 209, 195, 0.13) 58.2% 58.6%, transparent 59% 100%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 120px);
}

html[data-theme="dark"] body::after {
    opacity: 0.42;
}

.app-shell {
    position: relative;
    z-index: 1;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    gap: 22px;
    padding: 22px;
}

.app-sidebar,
.app-surface,
.main-form,
.table-wrapper,
.total-card,
.manager-report-card,
.modal-window,
.sidebar-meta-card,
.route-restrictions-map-shell,
.route-restrictions-match,
.route-restrictions-summary-item {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46)),
        var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(24px) saturate(138%);
    -webkit-backdrop-filter: blur(24px) saturate(138%);
}

html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .app-surface,
html[data-theme="dark"] .main-form,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .total-card,
html[data-theme="dark"] .manager-report-card,
html[data-theme="dark"] .modal-window,
html[data-theme="dark"] .sidebar-meta-card,
html[data-theme="dark"] .route-restrictions-map-shell,
html[data-theme="dark"] .route-restrictions-match,
html[data-theme="dark"] .route-restrictions-summary-item {
    background:
        linear-gradient(145deg, rgba(26, 36, 52, 0.82), rgba(14, 21, 32, 0.58)),
        var(--panel);
}

.app-sidebar {
    top: 22px;
    min-height: calc(100vh - 44px);
    padding: 20px 16px;
    border-radius: 34px;
    overflow: hidden;
    animation: surfaceRise 520ms var(--motion-normal) both;
}

.app-sidebar::before {
    content: "";
    position: absolute;
    inset: auto -44px -54px 24px;
    height: 160px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 155, 142, 0.24), transparent 68%);
}

.sidebar-brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.52)),
        radial-gradient(circle at 30% 18%, rgba(49, 209, 195, 0.2), transparent 54%);
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow-control);
}

html[data-theme="dark"] .sidebar-brand-mark {
    background:
        linear-gradient(145deg, rgba(31, 43, 61, 0.96), rgba(17, 24, 36, 0.72)),
        radial-gradient(circle at 30% 18%, rgba(49, 209, 195, 0.2), transparent 54%);
}

.sidebar-brand-text strong {
    font-size: 16px;
    letter-spacing: -0.025em;
}

.sidebar-nav-item {
    min-height: 48px;
    border-radius: 18px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 720;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast);
}

.sidebar-nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.48);
    border-color: var(--glass-line);
    transform: translateX(3px);
}

html[data-theme="dark"] .sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav-item-active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58));
    border-color: var(--glass-line);
    box-shadow: 0 16px 38px rgba(24, 34, 49, 0.11);
}

html[data-theme="dark"] .sidebar-nav-item-active {
    background: linear-gradient(135deg, rgba(49, 209, 195, 0.16), rgba(255, 255, 255, 0.07));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.sidebar-meta-card {
    border-radius: 22px;
    padding: 15px;
}

.app-surface {
    position: relative;
    overflow: hidden;
    padding: clamp(18px, 2vw, 30px);
    border-radius: 42px;
    box-shadow: var(--shadow-soft);
    animation: surfaceRise 620ms var(--motion-normal) 90ms both;
}

.app-surface::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background:
        radial-gradient(circle at 86% 8%, rgba(93, 141, 247, 0.16), transparent 30%),
        radial-gradient(circle at 10% 86%, rgba(15, 155, 142, 0.13), transparent 28%);
}

.page-header {
    align-items: center;
    margin-bottom: 22px;
    padding: 4px 4px 18px;
    border-bottom: 1px solid var(--brand-line);
}

.page-header h1 {
    color: var(--text-main);
    font-size: clamp(30px, 3.2vw, 48px);
    font-weight: 850;
    letter-spacing: -0.055em;
}

.page-subtitle {
    max-width: 780px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.55;
}

.page-header-actions,
.results-toolbar-actions,
.manager-report-header-actions {
    align-items: center;
    justify-content: center;
    gap: 12px;
}

button,
.secondary-button,
.settings-primary-action {
    min-height: 46px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.012em;
    transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast), opacity var(--motion-fast);
}

button,
.file-input-button,
.settings-primary-action {
    background: linear-gradient(135deg, #202b3c, #121b2a);
    color: #ffffff;
    box-shadow: var(--shadow-control);
}

button:hover,
.settings-primary-action:hover {
    background: linear-gradient(135deg, #101927, #070d16);
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(24, 34, 49, 0.18);
}

html[data-theme="dark"] button,
html[data-theme="dark"] .file-input-button,
html[data-theme="dark"] .settings-primary-action {
    background: linear-gradient(135deg, rgba(49, 209, 195, 0.96), rgba(39, 107, 148, 0.92));
    color: #061014;
}

.secondary-button,
.toolbar-button,
.column-picker-button {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48));
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    box-shadow: 0 12px 30px rgba(93, 111, 103, 0.09);
}

.secondary-button:hover,
.secondary-button:focus,
.toolbar-button:hover,
.toolbar-button:focus,
.column-picker-button:hover,
.column-picker-button:focus {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.66));
    border-color: var(--glass-line);
    color: var(--text-main);
    box-shadow: 0 18px 42px rgba(93, 111, 103, 0.14);
    transform: translateY(-2px);
    text-decoration: none;
}

html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .toolbar-button,
html[data-theme="dark"] .column-picker-button {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
    color: var(--text-main);
}

html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .secondary-button:focus,
html[data-theme="dark"] .toolbar-button:hover,
html[data-theme="dark"] .toolbar-button:focus,
html[data-theme="dark"] .column-picker-button:hover,
html[data-theme="dark"] .column-picker-button:focus {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.07));
}

.toolbar-button,
.results-toolbar-actions .secondary-button,
.results-toolbar-actions .column-picker-button {
    min-height: 48px;
    padding: 0 22px;
    border-radius: 20px;
    font-size: 14px;
}

.theme-toggle-button {
    min-width: 150px;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(15, 155, 142, 0.12);
    color: var(--accent-strong);
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.52));
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    box-shadow: 0 12px 28px rgba(93, 111, 103, 0.11);
}

.icon-button:hover {
    background: var(--panel-solid);
    transform: translateY(-1px);
}

html[data-theme="dark"] .icon-button {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055));
}

button:focus-visible,
.secondary-button:focus-visible,
.settings-primary-action:focus-visible,
.file-input-shell:focus-within,
input:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(49, 209, 195, 0.16), 0 18px 42px rgba(31, 41, 55, 0.14);
}

.main-form {
    padding: clamp(16px, 1.5vw, 24px);
    border-radius: 30px;
}

label {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

textarea,
input[type="text"],
input[type="number"],
input[type="file"],
input[type="month"],
select {
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--text-main);
    font-family: var(--ui-font);
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="file"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] select {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

textarea::placeholder,
input::placeholder {
    color: var(--text-muted);
}

.file-input-shell,
.vehicle-filter,
.history-month-filter,
.column-picker-panel,
.route-restrictions-checkbox {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.46));
    border-color: var(--panel-border);
    box-shadow: 0 12px 30px rgba(93, 111, 103, 0.08);
}

html[data-theme="dark"] .file-input-shell,
html[data-theme="dark"] .vehicle-filter,
html[data-theme="dark"] .history-month-filter,
html[data-theme="dark"] .column-picker-panel,
html[data-theme="dark"] .route-restrictions-checkbox {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
}

.section-heading h2,
.manager-report-card h2,
.modal-header h2 {
    color: var(--text-main);
    font-weight: 850;
    letter-spacing: -0.035em;
}

.alert {
    border-radius: 20px;
    backdrop-filter: blur(16px);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.26);
}

.alert-info {
    background: rgba(93, 141, 247, 0.12);
    color: var(--accent-blue);
    border-color: rgba(93, 141, 247, 0.24);
}

.alert-error {
    background: rgba(211, 61, 61, 0.12);
    color: var(--danger);
    border-color: rgba(211, 61, 61, 0.24);
}

.total-card {
    border-radius: 28px;
    text-align: left;
}

.total-title {
    color: var(--text-soft);
    font-weight: 760;
}

.total-value {
    color: var(--text-main);
    font-size: clamp(22px, 1.9vw, 30px);
    letter-spacing: -0.035em;
}

.results-toolbar {
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] .results-toolbar {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.08);
}

.results-toolbar-title {
    color: var(--text-main);
    font-size: 14px;
}

.table-wrapper,
.manager-report-table-wrapper {
    border-radius: 32px;
    padding: 14px;
}

table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

thead th,
.manager-report-table th {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.015em;
    background: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] thead th,
html[data-theme="dark"] .manager-report-table th {
    background: rgba(255, 255, 255, 0.055);
}

tbody td,
.manager-report-table td {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.32);
    border-bottom: 1px solid rgba(215, 226, 221, 0.4);
}

html[data-theme="dark"] tbody td,
html[data-theme="dark"] .manager-report-table td {
    background: rgba(255, 255, 255, 0.04);
    border-top-color: rgba(255, 255, 255, 0.06);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

tbody tr td:first-child,
.manager-report-table tr td:first-child {
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
}

tbody tr td:last-child,
.manager-report-table tr td:last-child {
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
}

.modal-overlay {
    z-index: 1000;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.36), transparent 24%), rgba(40, 49, 48, 0.38);
    backdrop-filter: blur(16px) saturate(112%);
    -webkit-backdrop-filter: blur(16px) saturate(112%);
}

.modal-overlay.system-confirm-overlay {
    z-index: 1200;
}

html[data-theme="dark"] .modal-overlay {
    background: radial-gradient(circle at 50% 40%, rgba(49, 209, 195, 0.12), transparent 26%), rgba(0, 0, 0, 0.58);
}

.modal-window {
    border-radius: 34px;
    border: 1px solid var(--glass-line);
    box-shadow: 0 44px 120px rgba(24, 34, 49, 0.28);
}

html[data-theme="dark"] .modal-window {
    box-shadow: 0 48px 130px rgba(0, 0, 0, 0.58);
}

.system-confirm-window {
    width: min(92vw, 620px);
    padding: 22px;
    border-radius: 30px;
}

.system-confirm-icon {
    background: radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.82), transparent 36%), linear-gradient(145deg, rgba(255, 245, 218, 0.95), rgba(255, 236, 184, 0.72));
    border-color: rgba(243, 165, 59, 0.42);
    color: #9a4b12;
    box-shadow: 0 18px 40px rgba(243, 165, 59, 0.16);
}

html[data-theme="dark"] .system-confirm-icon {
    background: radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.16), transparent 36%), linear-gradient(145deg, rgba(255, 184, 90, 0.2), rgba(255, 184, 90, 0.08));
    color: var(--accent-warm);
}

.system-confirm-header h2 {
    font-size: clamp(22px, 2vw, 29px);
}

.system-confirm-actions {
    margin-inline: auto;
    gap: 12px;
    padding: 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid var(--panel-border);
}

html[data-theme="dark"] .system-confirm-actions {
    background: rgba(255, 255, 255, 0.055);
}

.system-confirm-actions button {
    min-height: 44px;
    border-radius: 18px;
}

.result-track-modal-window,
.settings-modal-window {
    border-radius: 34px;
}

.result-track-map-shell,
.service-base-map,
.result-track-map,
.route-restrictions-map-shell {
    border-radius: 28px;
}

.leaflet-container {
    background: #dbe7e2;
}

html[data-theme="dark"] .leaflet-container {
    background: #111827;
}

.footer-actions .secondary-button {
    min-width: 190px;
}

@keyframes logisticsAmbient {
    from {
        transform: translate3d(-1.5%, -1%, 0) scale(1);
    }
    to {
        transform: translate3d(1.5%, 1%, 0) scale(1.04);
    }
}

@keyframes surfaceRise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .app-sidebar {
        position: static;
        min-height: auto;
        border-radius: 28px;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header-actions {
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 10px;
    }

    .app-surface,
    .modal-window,
    .main-form,
    .table-wrapper {
        border-radius: 24px;
    }

    .page-header h1 {
        font-size: 30px;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .page-header-actions,
    .results-toolbar-actions,
    .manager-report-header-actions {
        justify-content: stretch;
    }

    .toolbar-button,
    .theme-toggle-button,
    .results-toolbar-actions .secondary-button,
    .results-toolbar-actions .column-picker-button {
        width: 100%;
    }

    .system-confirm-window {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .system-confirm-actions {
        grid-template-columns: 1fr;
    }
}
