body {
    background: #f5f6f8;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-link {
    color: white !important;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.15) !important;
    border-radius: 6px;
}

main {
    min-height: calc(100vh - 120px);
}
    /* ===== ХЕДЕР ===== */
    .main-header {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
        box-shadow: 0 2px 20px rgba(0,0,0,0.4);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
    }

    /* Логотип */
    .brand-block {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
    }
    .brand-logo {
        height: 44px;
        width: auto;
    }
    .brand-text h5 {
        margin: 0;
        font-weight: 700;
        color: #fff;
        font-size: 15px;
        line-height: 1.2;
    }
    .brand-text small {
        color: rgba(255,255,255,0.6);
        font-size: 11px;
    }

    /* Кнопка бургера */
    .burger-btn {
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 10px;
        color: white;
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        cursor: pointer;
        transition: background 0.2s;
    }
    .burger-btn:hover {
        background: rgba(255,255,255,0.2);
    }

    /* Десктоп: правая часть */
    .header-right {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    /* Навигация десктоп */
    .desktop-nav .nav-link {
        color: rgba(255,255,255,0.75) !important;
        border-radius: 8px;
        padding: 6px 14px !important;
        font-size: 14px;
        transition: all 0.2s;
    }
    .desktop-nav .nav-link:hover {
        color: #fff !important;
        background: rgba(255,255,255,0.1);
    }
    .desktop-nav .nav-link.active {
        background: #0d6efd !important;
        color: #fff !important;
    }

    /* Дата/время */
    .datetime-block {
        text-align: right;
        color: white;
    }
    .datetime-block .city {
        font-size: 13px;
        font-weight: 600;
    }
    .datetime-block small {
        font-size: 11px;
        opacity: 0.65;
    }

    /* Пользователь */
    .user-block .dropdown-toggle {
        color: white;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .user-block .username {
        font-size: 13px;
        font-weight: 600;
        color: white;
    }
    .user-block .fullname {
        font-size: 11px;
        opacity: 0.65;
        color: white;
        display: block;
    }

    /* ===== МОБИЛЬНОЕ МЕНЮ ===== */
    .mobile-menu {
        display: none;
        background: #16213e;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding: 12px 16px 16px;
        animation: slideDown 0.2s ease;
    }
    .mobile-menu.open {
        display: block;
    }
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Навигация в мобильном меню */
    .mobile-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 14px;
    }
    .mobile-nav-link {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border-radius: 10px;
        background: rgba(255,255,255,0.07);
        color: rgba(255,255,255,0.8) !important;
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        transition: all 0.2s;
        border: 1px solid rgba(255,255,255,0.08);
    }
    .mobile-nav-link:hover {
        background: rgba(255,255,255,0.13);
        color: #fff !important;
    }
    .mobile-nav-link.active {
        background: #0d6efd;
        color: #fff !important;
        border-color: #0d6efd;
    }
    .mobile-nav-link i {
        font-size: 16px;
        opacity: 0.85;
    }

    /* Нижняя часть мобильного меню */
    .mobile-footer {
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .mobile-user {
        display: flex;
        align-items: center;
        gap: 10px;
        color: white;
    }
    .mobile-user i {
        font-size: 28px;
        opacity: 0.8;
    }
    .mobile-user .name {
        font-size: 13px;
        font-weight: 600;
    }
    .mobile-user .role {
        font-size: 11px;
        opacity: 0.6;
    }
    .mobile-datetime {
        color: rgba(255,255,255,0.6);
        font-size: 11px;
        text-align: right;
    }

    /* ===== АДАПТИВ ===== */
    @media (max-width: 768px) {
        .desktop-nav  { display: none !important; }
        .datetime-block { display: none !important; }
        .desktop-user { display: none !important; }
        .burger-btn   { display: flex !important; }
    }
    @media (min-width: 769px) {
        .burger-btn   { display: none !important; }
        .mobile-menu  { display: none !important; }
    }/* ========== ГЛАВНАЯ СТРАНИЦА ========== */

/* Герой */
.home-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
    min-height: 280px;
    display: flex;
    align-items: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #0d6efd 100%);
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 48px 48px;
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 13px;
    margin-bottom: 16px;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-size: 38px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 14px;
}

.hero-name {
    background: linear-gradient(90deg, #74b9ff, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
 
.hero-sub {
    color: rgba(255,255,255,0.65);
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.hero-btn-main {
    background: white;
    color: #0f3460;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.hero-btn-main:hover {
    background: #e8f0ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    color: #0f3460;
}

/* Статистика */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 10px;
}

.stat-num {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

/* Карточки разделов */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.section-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,110,253,0.02), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.1);
    border-color: #d0d0d0;
}

.section-card:hover::before {
    opacity: 1;
}

.section-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    flex-shrink: 0;
}

.section-card-body {
    flex: 1;
}

.section-card-body h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.section-card-body p {
    font-size: 13px;
    color: #777;
    margin-bottom: 8px;
    line-height: 1.4;
}

.section-card-count {
    display: inline-block;
    background: #f0f4ff;
    color: #0d6efd;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
}

.section-card-arrow {
    font-size: 20px;
    color: #ccc;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.section-card:hover .section-card-arrow {
    transform: translateX(4px);
    color: #0d6efd;
}

/* ===== АДАПТИВ ГЛАВНОЙ ===== */
@media (max-width: 768px) {
    .home-hero {
        min-height: 220px;
        border-radius: 14px;
    }

    .hero-content {
        padding: 32px 24px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-sub {
        font-size: 14px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-num {
        font-size: 22px;
    }

    .sections-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .section-card {
        padding: 18px;
    }

    .section-card-icon {
        width: 46px;
        height: 46px;
        font-size: 22px;
    }
}

@media (max-width: 400px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 22px;
    }
}
/* ========== ФУТЕР ========== */
.main-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    margin-top: 60px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 40px;
    flex-wrap: wrap;
}

/* Бренд */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    height: 36px;
    width: auto;
    opacity: 0.9;
}

.footer-brand-name {
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.footer-brand-sub {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    margin-top: 2px;
}

/* Навигация */
.footer-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-nav a:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.footer-nav a i {
    font-size: 13px;
}

/* Мета */
.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.footer-city,
.footer-version {
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Нижняя строка */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-bottom span {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
}

.footer-bottom-right {
    display: flex;
    align-items: center;
}

/* ===== АДАПТИВ ФУТЕРА ===== */
@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 20px;
        gap: 20px;
    }

    .footer-brand {
        flex-direction: column;
        text-align: center;
    }

    .footer-meta {
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 14px 20px;
        gap: 4px;
    }

    .footer-bottom-right {
        justify-content: center;
    }
}
.sticky-header-custom {
    position: sticky;
    top: 64px;
    background: #f8f9fa;
    z-index: 999;
    border-radius: 5px;
    padding: 5px;
}
.wagon-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.wagon-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.wagon-tab:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f0f4ff;
}
.wagon-tab.active {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(13,110,253,0.3);
}
.wagon-tab-count {
    background: rgba(0,0,0,0.12);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
}
.wagon-tab.active .wagon-tab-count {
    background: rgba(255,255,255,0.25);
}
.instr-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 13px;
}
.instr-label {
    color: #888;
    font-style: italic;
    font-size: 12px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 768px) {
    .instr-panel { width: 100%; flex-wrap: wrap; }
    .instr-label { max-width: 100%; }
    .wagon-tab   { padding: 6px 12px; font-size: 12px; }
    .tonnage-btn { padding: 6px 12px; font-size: 13px; }
}
.stat-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.stat-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border-radius: 10px;
    padding: 6px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-size: 13px;
    font-weight: 600;
    color: #444;
    border: 1.5px solid #e0e0e0;
}
.stat-bar-count {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: white;
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 12px;
    font-weight: 700;
}
.tabs-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tabs-search-row .wagon-tabs {
    margin-bottom: 0;
    flex: 1;
}
.table-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 7px 14px;
    min-width: 220px;
    transition: border-color 0.2s;
}
.table-search-wrap:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}
.table-search-wrap i { 
    color: #aaa; 
    font-size: 14px; 
}
.table-search-input { 
    border:none; 
    outline:none; 
    font-size:13px; 
    flex:1; 
    color:#333;
 }
.table-search-clear { 
    background:none;
    border:none; 
    cursor:pointer;
    color:#aaa;
    font-size:12px; 
    padding:0; 
}
.table-search-clear:hover { 
    color: #333; 
}
@media (max-width: 768px) {
    .tabs-search-row { flex-direction: column; align-items: flex-start; }
    .table-search-wrap { width: 100%; }
    .stat-bar-item { font-size: 12px; padding: 5px 10px; }
}
.path-header-group {
    background: #343a40 !important;
    color: white !important;
    text-align: center !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
    white-space: nowrap;
}
.path-header-sub {
    background: #495057 !important;
    color: #ced4da !important;
    text-align: center !important;
    font-size: 11px !important;
    padding: 3px 4px !important;
}
.pol-cell {
    cursor: pointer;
    width: 90px;
    min-width: 90px;
    padding: 3px 5px !important;
    vertical-align: top !important;
    transition: background 0.15s;
    height: 38px;
}
.wagon-pool {
    background: white;
    border: 2px dashed #6c757d;
    border-radius: 12px;
    min-height: 110px;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wagon-item {
    width: 68px;
    height: 25px;
    border: 1px solid #6c757d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #222;
    cursor: grab;
    transition: all 0.2s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    padding: 2px;
}
.wagon-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
}
/* ??? ????? */
.info-pool {
    background: white;
    border: 2px dashed #6c757d;
    border-radius: 12px;
    min-height: 80px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.info-item {
    width: 68px;
    height: 32px;
    border: 1px solid #6c757d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #222;
    cursor: grab;
    transition: all 0.2s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    padding: 2px;
}
.info-item:hover {
    transform: translateY(-3px);
}/* Необязательный блок */
.optional-block {
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}
.optional-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    transition: background 0.2s;
}
.optional-block-header:hover {
    background: #f0f4ff;
    color: #0d6efd;
}
.optional-chevron {
    transition: transform 0.3s ease;
}
#optionalFields.show ~ .optional-block-header .optional-chevron,
.optional-block-header[aria-expanded="true"] .optional-chevron {
    transform: rotate(180deg);
}
.optional-block-body {
    padding: 16px;
    border-top: 1.5px solid #e0e0e0;
}

/* Кнопки тоннажа */
.tonnage-btns {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.tonnage-btn {
    padding: 7px 16px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    font-weight: 700;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}
.tonnage-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}
.tonnage-btn.active {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    border-color: transparent;
    color: white;
    box-shadow: 0 3px 10px rgba(13,110,253,0.3);
}

#addFormChevron { transition: transform 0.3s ease; }
