/* =========================================
   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;
    }

/* =========================================
   Utilities
========================================= */
.cursor-pointer {
    cursor: pointer;
}

.mt-3 {
    margin-top: 1rem !important;
}

.w-100 {
    width: 100% !important;
}

/* =========================================
   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%;
    }

/* =========================================
   Navbar
========================================= */
.navbar {
    background-color: #ffffff;
    border-radius: 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0 !important;
    height: 58px;
    padding-right: 15px;
}

    .navbar.navbar-default,
    .navbar-default .navbar-brand {
        background-color: #fff;
    }

.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;
}

/* =========================================
   Desktop Sidebar
========================================= */
.desktop-sidebar {
    display: flex;
    flex-direction: column; /* menu + collapse button */
    width: 250px;
    height: calc(100vh - 58px);
    position: fixed;
    background-color: #fff;
    border-right: 1px solid #ddd;
}

    .desktop-sidebar.collapsed {
        width: 57px;
    }

/* Scrollable menu area */
.sidebar-menu-wrapper {
    flex: 1 1 auto; /* fills remaining space */
    overflow-y: auto;
}

/* Menu list styling */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .sidebar-menu a {
        display: flex;
        align-items: center;
        padding: 5px 5px;
        color: #333;
        text-decoration: none;
    }

    .sidebar-menu li a:hover {
        background-color: #eaeaea;
    }

    .sidebar-menu li a i {
        margin-right: 10px;
        min-width: 20px;
        text-align: center;
    }

/* Group header */
.menu-group-header {
    padding: 12px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    cursor: default;
}

/* Submenu */
.menu-sub {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .menu-sub li a {
        padding-left: 40px;
        font-size: 14px;
    }

        .menu-sub li a i {
            margin-right: 10px;
            min-width: 16px;
            text-align: center;
        }

        .menu-sub li a:hover {
            background-color: #eaeaea;
        }

/* Collapsed Sidebar Behavior */
.desktop-sidebar.collapsed .menu-group-header {
    display: none;
}

.desktop-sidebar.collapsed .menu-text {
    display: none;
}

.desktop-sidebar.collapsed .sidebar-menu > li > a,
.desktop-sidebar.collapsed .menu-sub a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

    .desktop-sidebar.collapsed .sidebar-menu > li > a i,
    .desktop-sidebar.collapsed .menu-sub a i {
        min-width: 0 !important;
        margin: 0;
    }

/* Collapse button pinned at bottom */
.sidebar-collapse-btn {
    flex-shrink: 0; /* never shrink */
    height: 50px;
    line-height: 50px; /* vertically center text */
    text-align: center;
    border-top: 1px solid #ddd;
    background-color: #fff;
    width: 100%;
    padding-right: 12px;
}

/* =========================================
   Main Content
========================================= */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    transition: all 0.2s ease;
    margin-left: 250px; /* offset for sidebar */
}

.desktop-sidebar.collapsed ~ .content {
    margin-left: 57px;
}

/* =========================================
   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%;
    }


/* =========================================
   Button
========================================= */

/* Base button class */
.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;
        background: #006BAC !important;
    }

        .sw-btn.sw-btn-primary:hover {
            background-color: #1785CA;
        }

        .sw-btn.sw-btn-primary:active {
            background-color: #6CB0DA;
            color: #1D1D1B;
        }

    .sw-btn.sw-btn-secondary {
        background: #fff;
        color: #006BAC;
        border: 2px solid #006BAC !important;
    }

        .sw-btn.sw-btn-secondary:hover {
            background: #fff;
            color: #1785CA;
            border: 2px solid #1785CA;
        }

        .sw-btn.sw-btn-secondary:active {
            background: #fff;
            color: #6CB0DA;
            border: 2px solid #6CB0DA;
        }



    /* Disabled base behavior */
    .sw-btn:disabled,
    .sw-btn.sw-btn-disabled {
        cursor: not-allowed;
        pointer-events: none;
    }

    /* Primary disabled */
    .sw-btn.sw-btn-primary:disabled,
    .sw-btn.sw-btn-primary.sw-btn-disabled {
        background-color: #E6E9EA !important;
        color: #5F6B72 !important;
    }

    /* Secondary disabled */
    .sw-btn.sw-btn-secondary:disabled,
    .sw-btn.sw-btn-secondary.sw-btn-disabled {
        background-color: #FFFFFF !important;
        color: #5F6B72 !important;
        border: 2px solid #E6E9EA !important;
    }


    /* Small button modifier */
    .sw-btn.sw-btn-sm {
        height: 32px;
        padding: 8px 12px;
        font-size: 12px;
    }


/* =========================================
   JQuery ui-widget overrides the default font so lets not do that
========================================= */
.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;
    }
}
