/* ==========================================================================
   1. GLOBAL RESET & BASE TYPOGRAPHY
   ========================================================================== */
* { box-sizing: border-box; }

html, body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
    background: url('../images/bg.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
    color: #2C2C2C;
}

/* ==========================================================================
   2. SIDEBAR (Pinned Left - Modern Hot Pink Theme with Forced Specificity)
   ========================================================================== */
nav#sidebarMenu.sidebar { 
    width: 309px !important; 
    background: linear-gradient(135deg, #FF69B4, #FF1493) !important; 
    height: 100vh; 
    position: fixed; 
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease; 
    box-shadow: 4px 0 15px rgba(255, 105, 180, 0.2);
}

nav#sidebarMenu.sidebar .nav-link { 
    color: #FFFFFF !important; 
    padding: 15px 20px; 
    display: block; 
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

nav#sidebarMenu.sidebar .nav-link:hover { 
    background-color: #D81B60 !important; 
    color: #FFFFFF !important;
}

nav#sidebarMenu.sidebar .sidebar-heading {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* --- Sub-menu Fixes for Sidebar --- */
nav#sidebarMenu.sidebar .nav-second-level {
    padding-left: 0 !important;
    list-style: none;
    background-color: rgba(0, 0, 0, 0.1);
}

nav#sidebarMenu.sidebar .nav-second-level li a {
    padding: 12px 15px 12px 40px !important;
    display: block;
    font-size: 0.9em;
    color: #FFF0F5 !important;
    white-space: nowrap;
}

/* ==========================================================================
   3. HEADER (Sticky Top, Profile Right)
   ========================================================================== */
.header-section, .navbar {
    position: fixed;
    top: 0;
    left: 309px;
    right: 0;
    height: 70px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: left 0.3s ease, width 0.3s ease;
    color: #2C2C2C;
}

.header-left, .navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #D81B60 !important;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

button#showLeftPlan,
button#showLeftPush { 
    position: relative;
    z-index: 1100;
    pointer-events: auto;
    border: none; 
    background: none; 
    font-size: 1.5em; 
    color: #D81B60; 
    cursor: pointer; 
}

/* ==========================================================================
   4. CONTENT WRAPPER & SOLID BACKGROUND OVERLAY
   ========================================================================== */
#page-wrapper, main[role="main"] {
    margin-left: 309px;
    margin-top: 70px;
    margin-bottom: 60px;
    min-height: calc(100vh - 130px);
    background: rgba(255, 245, 247, 0.85); 
    backdrop-filter: blur(5px);
    padding: 25px;
    color: #2C2C2C;
    transition: margin-left 0.3s ease;
}

#page-wrapper h1, 
#page-wrapper h2, 
#page-wrapper h3, 
#page-wrapper h4, 
#page-wrapper h5,
main[role="main"] h1 {
    color: #880E4F; 
    font-weight: 700;
}

#page-wrapper .card,
#page-wrapper .panel,
#page-wrapper .content-block,
main[role="main"] .card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    color: #2C2C2C;
    box-shadow: 0 8px 25px rgba(216, 27, 96, 0.12);
    border: 1px solid rgba(255, 182, 193, 0.4);
}

/* ==========================================================================
   5. FOOTER (Sticky Bottom)
   ========================================================================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 309px;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #5A5A5A;
    font-size: 0.9em;
    box-shadow: 0 -2px 10px rgba(255, 105, 180, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: left 0.3s ease;
}

/* ==========================================================================
   6. UI COMPONENTS & RESPONSIVE TOGGLES
   ========================================================================== */
.user-name { 
    display: block; 
    color: #2C2C2C; 
    font-weight: 500;
}

body.sidebar-is-closed .sidebar {
    left: -309px !important;
}

body.sidebar-is-closed .header-section,
body.sidebar-is-closed .navbar,
body.sidebar-is-closed .footer {
    left: 0 !important;
}

body.sidebar-is-closed #page-wrapper,
body.sidebar-is-closed main[role="main"] {
    margin-left: 0 !important;
}

.table-responsive {
    background: #FFFFFF;
    padding: 10px;
    border-radius: 10px;
}

.table thead tr th {
    background-color: #FFF0F5; 
    color: #D81B60; 
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    padding: 15px !important;
    border-bottom: 2px solid #FFCCE5;
}

.table tbody tr td {
    padding: 15px !important;
    vertical-align: middle !important;
    color: #333333;
}

.btn-primary {
    background-color: #FF69B4 !important;
    border-color: #FF1493 !important;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(255, 105, 180, 0.3);
}

.btn-primary:hover {
    background-color: #D81B60 !important;
    border-color: #C2185B !important;
}

@media (max-width: 768px) {
    .sidebar {
        left: -309px;
    }
    .header-section, .navbar, .footer {
        left: 0 !important;
    }
    #page-wrapper, main[role="main"] {
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   7. REDUCED SIDEBAR ICON SIZES & FORCED INVERSION
   ========================================================================== */
.sidebar-icon,
.sidebar-logout-icon {
    object-fit: contain;
    width: 14px;  
    height: 14px; 
    margin-right: 0.4rem;
}

.sidebar-icon {
    filter: brightness(0) invert(1) !important;
}