/* ==========================================================================
   1. CORE VARIABLES (Cleaned & Consolidated)
   ========================================================================== */
:root {
    /* Dynamic Theme Variables - Initial Defaults */
    --main-color: #ff8c42;
    --btn-accent: #28a745;
    --heading-color: #212529;
    
    /* Legacy Variables for Backward Compatibility */
    --main-theme-color: var(--main-color);
    --orange: var(--main-color);
    
    /* Static UI Variables */
    --bg-gray: #f8f9fc;
    --sidebar-width: 270px;
    --transition: all 0.3s ease;
    
    /* Gradients */
    --navy-gradient: linear-gradient(45deg, #343391, #4e4cb8);
    --teal-gradient: linear-gradient(45deg, #11a9a2, #17cbc2);
    --blue-gradient: linear-gradient(45deg, #00a2ff, #4dbfff);
}

/* ==========================================================================
   2. GLOBAL STYLES & TYPOGRAPHY
   ========================================================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-gray);
    overflow-x: hidden;
}

/* Headings: JS Variable se connect kiya gaya hai */
h1, h2, h3, h4, h5, h6, .dynamic-theme-text {
    color: var(--heading-color) !important;
    transition: color 0.3s ease;
}

/* Theme Color Utilities */
.text-navy, .text-orange { color: var(--main-color) !important; }
.bg-orange { background: var(--main-color) !important; }
.bg-sidebar { background: var(--sidebar-color) !important; }
/* ==========================================================================
   3. LAYOUT (SIDEBAR & CONTENT)
   ========================================================================== */
#wrapper { display: flex; width: 100%; }

#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    background-color: white;
    border-right: 1px solid #e0e0e0;
    transition: var(--transition);
}

#page-content-wrapper {
    width: 100%;
    margin-left: var(--sidebar-width); 
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

/* Sidebar Toggle Logic (Desktop) */
#wrapper.toggled #sidebar-wrapper { margin-left: calc(var(--sidebar-width) * -1); }
#wrapper.toggled #page-content-wrapper { margin-left: 0; }

.navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: white !important;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ==========================================================================
   4. NAVIGATION LINKS
   ========================================================================== */
.list-group-item {
    font-size: 0.95rem;
    color: #6c757d;
    padding: 12px 24px;
    border: none !important;
    display: flex;
    align-items: center;
    background: transparent;
    transition: all 0.2s;
}

/* Active State: Variable based highlight */
#sidebar-wrapper .list-group-item.active-link {
    background-color: #fff !important;
    color: var(--main-color) !important;
    border-right: 4px solid var(--main-color) !important;
    font-weight: 600;
}

#sidebar-wrapper .list-group-item:hover {
    color: var(--main-color);
    background-color: #f8f9fa;
}

/* ==========================================================================
   5. BUTTONS & UI ELEMENTS
   ========================================================================== */
.btn-orange {
    background-color: var(--btn-accent) !important;
    border: 1px solid var(--btn-accent) !important;
    color: white !important;
    font-weight: 500;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.15);
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px;
    padding: 5px 15px;
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   6. THEME CUSTOMIZER (Right Side)
   ========================================================================== */
.theme-customizer {
    position: fixed;
    top: 0;
    right: -310px; /* Initially hidden */
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 2050;
    transition: right 0.3s cubic-bezier(0.7, 0, 0.3, 1);
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

.theme-customizer.show { right: 0; }

.customizer-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--main-color);
    color: white;
    padding: 12px 15px;
    border-radius: 15px 0 0 15px;
    cursor: pointer;
    z-index: 2040;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid #f0f0f0;
    transition: 0.2s;
}

.color-dot.active { border-color: #333; transform: scale(1.1); }

/* ==========================================================================
   7. RESPONSIVE (MOBILE FIX)
   ========================================================================== */
@media (max-width: 991.98px) {
    #sidebar-wrapper { margin-left: calc(var(--sidebar-width) * -1); }
    #page-content-wrapper { margin-left: 0 !important; }
    #wrapper.toggled #sidebar-wrapper { margin-left: 0; }
    
    #wrapper.toggled #page-content-wrapper {
        opacity: 0.5;
        pointer-events: none;
    }
}
/* Action Buttons Styling */
.action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px; /* Square with slight roundness */
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* Specific colors connection with your theme */
.btn-primary { background-color: var(--main-color) !important; border-color: var(--main-color) !important; }
.btn-info { background-color: #17a2b8 !important; }
.btn-danger { background-color: #dc3545 !important; }

/* Tooltip alignment fix */
[title] { cursor: pointer; }

/* Modal Improvements */
.modal-content { overflow: hidden; }
.bg-soft-orange { background: #fff3e0; color: #ff8c42; }
.text-navy { color: #343391; }

.modal-body strong {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
}

.modal-body span {
    font-size: 0.95rem;
    color: #333;
}

/* Rounded Profile in Modal */
#modalContent img {
    border: 3px solid #f8f9fc;
}


    /* Professional Dropdown Styling */
    .icon-circle {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
    }
    
    .bg-soft-primary { background-color: #e7f1ff; }
    .bg-soft-danger { background-color: #fff5f5; }

    .dropdown-item {
        transition: all 0.2s ease;
        border-radius: 8px;
        margin: 0 8px;
        width: calc(100% - 16px);
    }

    .dropdown-item:hover {
        background-color: #f8f9fa;
        transform: translateX(3px);
    }

    /* Animation */
    .animate.slideIn {
        animation-duration: 0.3s;
        animation-fill-mode: both;
        animation-name: slideIn;
    }

    @keyframes slideIn {
        0% { transform: translateY(1rem); opacity: 0; }
        100% { transform: translateY(0rem); opacity: 1; }
    }
