/* ========================================================================
   1. ГЛОБАЛЬНІ НАЛАШТУВАННЯ ТА STICKY FOOTER
   ======================================================================== */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

/* Основна обгортка для звичайних сторінок */
.wrap {
    padding-top: 70px;
    flex-shrink: 0;
}

/* Прибираємо стандартні контейнери для сторінок з картою */
.map-layout main {
    padding-top: 56px; /* Висота фіксованого NavBar */
    min-height: calc(100vh); /* Віднімаємо висоту футера */
}

/* ========================================================================
   2. ВЕРХНЄ МЕНЮ (NAVBAR)
   ======================================================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    z-index: 1030;
}

/* Прибираємо тінь, якщо потрібно "злити" меню з контентом */
.navbar.shadow-none {
    box-shadow: none !important;
}

/* ========================================================================
   3. САЙДБАР (SIDEBAR)
   ======================================================================== */
#sidebar {
    background-color: #2d353c !important;
    width: 250px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px); /* Мінус навбар та футер */
    position: sticky;
    top: 56px;
    z-index: 1000;
    transition: all 0.2s;
}

/* Основні посилання в сайдбарі */
.side-nav .nav-link {
    color: #a8afb7 !important;
    transition: all 0.2s;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 10px 15px;
}

.side-nav .nav-link:hover, 
.side-nav .nav-item.active > .nav-link {
    background: #242a30;
    color: #fff !important;
}

.side-nav .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

/* Підменю (Submenu) з вертикальною лінією */
.sub-menu {
    background: #1a2229;
    border-left: 2px solid #242a30;
    margin-left: 25px !important;
    list-style: none;
    padding: 0;
}

.sub-menu .nav-link {
    padding: 5px 15px 5px 25px !important;
    font-size: 13px;
    position: relative;
    border-bottom: none;
}

/* Маленькі кружечки перед пунктами підменю (як на скрині) */
.sub-menu .nav-link::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    width: 6px;
    height: 6px;
    background: #4b535a;
    border-radius: 50%;
    transform: translateY(-50%);
}

.sub-menu .nav-item.active .nav-link::before {
    background: #00acac; /* Колір активного пункту */
}

/* Блок з таблицею або інфо внизу сайдбару */
.sidebar-footer-table, #linemessages {
    background: rgba(255, 255, 255, 0.05);
    font-size: 11px;
    margin: 10px;
    border-radius: 4px;
    color: #fff;
}

/* ========================================================================
   4. ГОЛОВНИЙ КОНТЕНТ (MAIN CONTENT)
   ======================================================================== */
.main-content {
    background-color: #fff;
    flex-grow: 1;
    overflow-x: hidden;
}

/* У макеті карти прибираємо внутрішні паддінги, щоб карта була до країв */
.map-layout .main-content > div {
    padding: 0 !important;
}

/* Хлібні крихти */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

/* ========================================================================
   5. КАРТКИ ТА ВІДЖЕТИ (SITE INDEX)
   ======================================================================== */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ========================================================================
   6. ФУТЕР (FOOTER)
   ======================================================================== */
.footer {
    height: 40px;
    line-height: 24px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
    font-size: 0.85rem;
}

/* Стиль темного футера для акценту (якщо використовується bg-dark) */
.footer.bg-dark {
    background-color: #343a40 !important;
    color: #adb5bd;
    border-top: 3px solid #28a745;
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer a:hover {
    color: #28a745;
}

/* ========================================================================
   7. АДАПТИВНІСТЬ
   ======================================================================== */
@media(max-width: 767px) {
    .wrap, .map-layout main {
        padding-top: 60px;
    }
    
    #sidebar {
        position: fixed;
        left: -250px; /* Сховати сайдбар на мобільних */
        height: 100%;
    }

    .footer {
        text-align: center;
        height: auto;
        padding: 10px 0;
    }
}