/* =========================================
   Base / Global Styles
========================================= */
html, body {
    height: 100%;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    padding: 0;
    color: #000;
}

    body .navbar,
    body .sidebar,
    body .menu-text {
        font-family: 'Montserrat', Arial, sans-serif;
    }

.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
    font-family: 'Montserrat', Arial, sans-serif;
}

/* =========================================
   Popups
========================================= */
.swarco-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1050;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
}

    .swarco-popup.d-none {
        display: none !important;
    }

    .swarco-popup > .popup-card {
        background-color: #fff;
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        padding: 2rem;
        max-width: 400px;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        box-sizing: border-box;
    }

    .swarco-popup .form-control,
    .swarco-popup .btn {
        width: 100%;
    }

/* =========================================
   Utilities
========================================= */
.cursor-pointer {
    cursor: pointer;
}

.mt-3 {
    margin-top: 1rem !important;
}

.w-100 {
    width: 100% !important;
}

/* =========================================
   Navbar
========================================= */
.navbar {
    background-color: #ffffff;
    border-radius: 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0 !important;
    height: 58px;
    padding-right: 15px;
}

.navbar-logo-wrapper {
    height: 56px;
    width: 56px;
    padding: 8px;
    border-right: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-logo {
    max-height: 40px;
    width: auto;
}

.desktop-links > li {
    display: inline-block;
    margin-left: 15px;
}

    .desktop-links > li > a {
        padding: 18px 10px;
        line-height: 20px;
    }

/* =========================================
   App Body / Layout
========================================= */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* =========================================
   Desktop Sidebar
========================================= */
.desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 270px;
    height: calc(100vh - 58px);
    background-color: #fff;
    border-right: 1px solid #ddd;
    transition: width 0.4s ease-in-out;
    box-sizing: border-box;
}

    .desktop-sidebar.collapsed {
        width: 57px;
    }

.sidebar-menu-wrapper {
    scroll-padding-top: 20px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow-y: auto;
    box-sizing: border-box;
}

.menu-group-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #485156;
}

.menu-items {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    gap: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    padding-left: 18px;
}

    .menu-item:hover {
        background-color: #E7F2F9;
        text-decoration: none;
    }

    .menu-item:active {
        background-color: #BEDCEF;
        text-decoration: none;
    }

    .menu-item.isActive {
        background-color: #E7F2F9;
    }

.menu-icon {
    width: 56px;
    height: 56px;
    text-align: center;
    align-content: center;
    flex-shrink: 0;
    font-size: 24px;
    color: #006BAC;
}

.menu-text {
    flex: 1;
    color: #485156;
}

/* =========================================
   Collapsed Sidebar
========================================= */
.desktop-sidebar.collapsed .menu-text {
    display: none;
}

.desktop-sidebar.collapsed .menu-item {
    justify-content: center;
}

.desktop-sidebar.collapsed .menu-items {
    display: none;
}

.desktop-sidebar.collapsed .menu-group-header {
    display: none;
}

/* Collapse Button at Bottom */
.sidebar-collapse-btn {
    flex-shrink: 0;
    margin-top: auto;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-top: 1px solid #ddd;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

    .sidebar-collapse-btn button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .sidebar-collapse-btn .collapse-content {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .sidebar-collapse-btn i {
        transition: transform 0.3s ease;
    }

.desktop-sidebar.collapsed .sidebar-collapse-btn .git-info {
    display: none;
}

/* =========================================
   Collapsed group icons
========================================= */
.menu-group-collapsed {
    display: none;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    position: relative;
    height: 56px;
    color: #006BAC;
}

.desktop-sidebar.collapsed .menu-group-collapsed {
    display: block;
}

/* =========================================
   Collapsed submenus (generic class for all groups)
========================================= */
.collapsed-submenu {
    display: none;
    position: fixed;
    top: 58px;
    left: 57px;
    min-width: 250px;
    max-height: 80vh;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    padding: 10px 0;
    box-sizing: border-box;
}

    .collapsed-submenu .menu-item {
        display: flex;
        align-items: center;
        /*gap: 10px;*/
        padding: 8px 15px;
        color: #333;
        text-decoration: none;
    }

        .collapsed-submenu .menu-item:hover {
            background-color: #E7F2F9BF;
            text-decoration: none;
        }

        .collapsed-submenu .menu-item:active {
            background-color: #BEDCEF;
            text-decoration: none;
        }

    .collapsed-submenu .menu-text {
        display: block;
    }

/* =========================================
   Main Content
========================================= */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
    margin-left: 0;
}

/* =========================================
   Mobile Sidebar
========================================= */
.mobile-sidebar {
    display: none;
    position: fixed;
    top: 50px;
    left: -250px;
    width: 250px;
    height: calc(100% - 50px);
    background-color: #f5f5f5;
    border-right: 1px solid #ddd;
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
}

    .mobile-sidebar.show {
        left: 0;
    }

    .mobile-sidebar .mobile-footer {
        position: absolute;
        bottom: 0;
        width: 100%;
    }

/* =========================================
   Buttons
========================================= */
.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 4px;
    border: none;
    padding: 8px 16px;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

    .sw-btn.sw-btn-primary {
        color: white !important;
        background: #006BAC !important;
    }

        .sw-btn.sw-btn-primary:hover {
            background-color: #1785CA !important
        }

        .sw-btn.sw-btn-primary:active {
            background-color: #6CB0DA !important;
            color: #1D1D1B !important;
        }

    .sw-btn.sw-btn-secondary {
        background: #fff !important;
        color: #006BAC !important;
        border: 2px solid #006BAC !important;
    }

        .sw-btn.sw-btn-secondary:hover {
            color: #1785CA !important;
            border: 2px solid #1785CA !important;
        }

        .sw-btn.sw-btn-secondary:active {
            color: #6CB0DA !important;
            border: 2px solid #6CB0DA !important;
        }

    .sw-btn:disabled,
    .sw-btn.sw-btn-disabled {
        cursor: not-allowed !important;
        pointer-events: none !important;
    }

    .sw-btn.sw-btn-primary:disabled {
        background-color: #E6E9EA !important;
        color: #5F6B72 !important;
    }

    .sw-btn.sw-btn-secondary:disabled {
        background-color: #FFFFFF !important;
        color: #5F6B72 !important;
        border: 2px solid #E6E9EA !important;
    }

    .sw-btn.sw-btn-sm {
        height: 32px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

/* =========================================
   jQuery UI widget override
========================================= */
.ui-widget, .ui-widget button {
    font-family: inherit !important;
    font-size: inherit !important;
}

/* =========================================
   Responsive
========================================= */
@media (max-width: 767px) {
    .desktop-sidebar {
        display: none;
    }

    .desktop-links {
        display: none;
    }

    .app-body {
        flex-direction: column;
    }

    .content {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    .mobile-sidebar {
        display: none;
    }
}
