/* ===========================================================
   PREMIUM THEME FOR PERFEX – FULL CSS
   (Customer portal only)
=========================================================== */

:root {
    --clt-primary: #3f51b5;
    --clt-body-bg: #f3f4f6;
    --clt-content-bg: #ffffff;
    --clt-sidebar-bg: #263238;
    --clt-sidebar-hover-bg: #1b2836;
    --clt-sidebar-profile-bg: #1f2a33;
    --clt-sidebar-profile-text: var(--clt-sidebar-text);
    --clt-sidebar-logout-bg: #e53935;
    --clt-sidebar-text: #eceff1;
    --clt-footer-bg: #263238;
    --clt-footer-text: #ffffff;

    /* Header links colour for top navbar */
    --clt-header-links: #ffffff;

    /* Back to Top default offsets (can be overridden by CSS vars from PHP) */
    --clt-backtotop-bottom: 24px;
    --clt-backtotop-right: 24px;
}

/* ==========================================
   BASE BODY STYLING
========================================== */

body.customers {
    padding-top: 0 !important;
    background: var(--clt-body-bg);
}

/* ==========================================
   HEADER & NAV BAR (CUSTOMERS)
========================================== */

/* Default header background (can be overridden by dynamic CSS) */
body.customers .navbar.header,
body.customers .navbar.navbar-default.header {
    background: var(--ptp-floating-icon-bg, var(--clt-primary));
    border-color: transparent;
}

/* Main nav links + brand */
body.customers .navbar.header .navbar-nav > li > a,
body.customers .navbar.header .navbar-nav > li > a:focus,
body.customers .navbar.header .navbar-nav > li > a:hover,
body.customers .navbar.header .navbar-brand,
body.customers .navbar.header .navbar-brand:focus,
body.customers .navbar.header .navbar-brand:hover {
    color: var(--clt-header-links, #ffffff) !important;
}

/* ==========================================
   WRAPPER LAYOUT (DESKTOP)
========================================== */

@media (min-width: 768px) {
    body.customers #wrapper {
        margin-left: 230px !important;
        padding-top: 0 !important;
        padding-bottom: 70px !important;
        transition: margin-left 0.25s ease;
        background: transparent !important;
    }

    body.customers.client-sidebar-collapsed #wrapper {
        margin-left: 0 !important;
    }

    body.customers #wrapper #content,
    body.customers #content {
        padding-left: 25px !important;
        padding-right: 25px !important;
        background: var(--clt-content-bg) !important;
    }
}

/* ==========================================
   LEFT SIDEBAR CONTAINER
========================================== */

body.customers #client-sidebar {
    position: fixed !important;
    left: 0 !important;

    top: 0;
    bottom: 0;

    width: 230px !important;
    height: auto !important;

    background: var(--clt-sidebar-bg) !important;
    color: var(--clt-sidebar-text) !important;

    z-index: 998 !important;
    overflow-y: auto !important;

    display: none;
    transform: translateX(0);
    transition: transform 0.25s ease;
}

/* Collapsed */
@media (min-width: 768px) {
    body.customers.client-sidebar-collapsed #client-sidebar {
        transform: translateX(-230px);
    }
}

/* Sidebar menu list */
body.customers #client-sidebar .client-sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Sidebar links */
body.customers #client-sidebar .client-sidebar-menu > li > a {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    line-height: 20px;
    color: var(--clt-sidebar-text) !important;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, color 0.2s ease;
}

body.customers #client-sidebar .client-sidebar-menu > li > a:hover,
body.customers #client-sidebar .client-sidebar-menu > li.active > a {
    background: var(--clt-sidebar-hover-bg) !important;
    color: #ffffff !important;
}

/* Profile row */
body.customers #client-sidebar .client-sidebar-menu > li.customers-nav-item-profile {
    background: var(--clt-sidebar-profile-bg) !important;
    padding: 10px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

body.customers #client-sidebar .customers-nav-item-profile {
    color: var(--clt-sidebar-profile-text) !important;
}

body.customers #client-sidebar .customers-nav-item-profile > a {
    color: var(--clt-sidebar-profile-text) !important;
    display: flex;
    align-items: center;
}

body.customers #client-sidebar img.client-profile-image-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Logout row */
body.customers #client-sidebar .customers-nav-item-logout > a {
    background: var(--clt-sidebar-logout-bg) !important;
    color: #ffffff !important;
    border-bottom: none !important;
}

/* ==========================================
   HAMBURGER TOGGLE
========================================== */

body.customers #client-sidebar-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    width: 36px;
    height: 26px;

    margin-left: 6px;
    padding: 0;

    border: none;
    background: transparent;
    cursor: pointer;
}

body.customers #client-sidebar-toggle .bar {
    width: 22px;
    height: 2px;
    border-radius: 2px;
    margin: 3px 0;
    background: #ffffff;
}

/* ==========================================
   FOOTER – FULL WIDTH & ABOVE-SIDEBAR
========================================== */

@media (min-width: 768px) {
    body.customers footer.footer,
    body.customers footer,
    body.customers .footer {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        z-index: 900 !important;
        background: var(--clt-footer-bg) !important;
        color: var(--clt-footer-text) !important;
        padding: 12px 0 !important;
        text-align: center !important;
    }

    body.customers footer a,
    body.customers .footer a {
        color: var(--clt-footer-text) !important;
    }

    body.customers #client-sidebar {
        bottom: 60px;
    }
}

/* ==========================================
   BACK TO TOP BUTTON – CUSTOMERS
   Position via CSS vars, with max height cap
========================================== */

body.customers .ptp-back-to-top {
    position: fixed;
    display: none;
    /* Clamp bottom between 0px and 200px */
    bottom: max(0px, min(var(--clt-backtotop-bottom, 24px), 200px));
    right: var(--clt-backtotop-right, 24px);
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--ptp-floating-icon-bg, var(--clt-primary));
    color: var(--ptp-floating-icon-fg, #ffffff);
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Visible state (toggle .ptp-visible in JS) */
body.customers .ptp-back-to-top.ptp-visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   MOBILE – Let Perfex handle layout
========================================== */

@media (max-width: 767px) {
    body.customers #wrapper {
        margin-left: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body.customers #client-sidebar,
    body.customers #client-sidebar-toggle {
        display: none !important;
    }

    body.customers .navbar.header .navbar-toggle,
    body.customers .navbar.header .navbar-toggle.collapsed {
        display: block !important;
    }
}
