/* --- COMPLETE SOFT UI TRANSFORMATION (FINAL POLISH) --- */

:root {
    --soft-ui-radius: 1rem;
    --soft-ui-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
}

/* 1. GLOBAL THEME VARIABLES (Bulletproof Light Mode) */
:root,
html[data-bs-theme="light"],
body[data-bs-theme="light"],
html[data-theme="light"],
body[data-theme="light"],
body:not([data-bs-theme="dark"]):not([data-theme="dark"]) {
    --soft-body-bg: #f8f9fa;       
    --soft-card-bg: #ffffff;       
    --soft-card-border: rgba(0, 0, 0, 0.05);
    --soft-text-main: #252f40;     
    --soft-text-muted: #67748e;    
    --soft-input-bg: #ffffff;
  	--soft-dropdown-bg: #ffffff;
    
    /* GLASSMORPHISM - Light Mode Navigation */
    --soft-nav-bg: rgba(255, 255, 255, 0.65); 
    --soft-nav-text: #67748e; 
    --soft-nav-text-active: #252f40; 
    --soft-nav-icon-bg: #ffffff;
    --soft-nav-icon-color: #252f40;
    --soft-nav-border: rgba(255, 255, 255, 0.9); 
    --soft-nav-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.04); 
}

/* Dark Mode Variables */
html[data-bs-theme="dark"],
body[data-bs-theme="dark"],
html[data-theme="dark"],
body[data-theme="dark"] {
    --soft-body-bg: #111c26;       
    --soft-card-bg: rgba(27, 37, 49, 0.6); 
    --soft-card-border: rgba(255, 255, 255, 0.05);
    --soft-text-main: #ffffff;     
    --soft-text-muted: #a0aec0;    
    --soft-input-bg: rgba(0, 0, 0, 0.2);
  	--soft-dropdown-bg: #1b2531;
    
    /* GLASSMORPHISM - Dark Mode Navigation */
    --soft-nav-bg: rgba(27, 37, 49, 0.65);
    --soft-nav-text: rgba(255, 255, 255, 0.7);
    --soft-nav-text-active: #ffffff;
    --soft-nav-icon-bg: rgba(0,0,0,0.25);
    --soft-nav-icon-color: #ffffff;
    --soft-nav-border: rgba(255, 255, 255, 0.05);
    --soft-nav-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.15);
}

/* 2. APPLY BODY BACKGROUND */
body, 
.page-wrapper, 
#main {
    background-color: var(--soft-body-bg) !important;
}

/* =========================================
   3. THEME-AWARE FLOATING SIDEBAR 
========================================= */
.navbar-vertical, 
aside.navbar-vertical,
.navbar-vertical.navbar-dark {
    background-color: var(--soft-nav-bg) !important; 
    
    backdrop-filter: blur(12px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(200%) !important;
    
    background-image: none !important;
    border: 1px solid var(--soft-nav-border) !important;
    border-radius: 1rem !important;
    box-shadow: var(--soft-nav-shadow) !important; 
    
    margin: 1rem 0 1rem 1rem !important; 
    
    min-height: calc(100vh - 2rem) !important; 
    height: auto !important; 
    overflow-y: auto !important; 
    overflow-x: hidden !important;
    z-index: 1040 !important; /* Stack above background elements */
}

.navbar-vertical::-webkit-scrollbar { width: 4px; }
.navbar-vertical::-webkit-scrollbar-track { background: transparent; }
.navbar-vertical::-webkit-scrollbar-thumb { background: rgba(103, 116, 142, 0.2); border-radius: 10px; }
html[data-bs-theme="dark"] .navbar-vertical::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

.navbar-vertical .navbar-brand,
.navbar-brand span,
.navbar-brand-text,
.navbar-brand b {
    color: var(--soft-nav-text-active) !important;
}

.navbar-vertical .nav-item {
    margin: 4px 15px !important;
}

.navbar-vertical .nav-link,
.navbar-dark .navbar-nav .nav-link {
    border-radius: 0.75rem !important;
    padding: 10px 15px !important;
    font-weight: 500 !important;
    color: var(--soft-nav-text) !important;
    transition: all 0.2s ease;
}

.navbar-vertical .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--soft-nav-text-active) !important;
    background-color: rgba(203, 12, 159, 0.05) !important; 
}

.navbar-vertical .nav-link-icon,
.navbar-vertical .nav-link i,
.navbar-dark .navbar-nav .nav-link i {
    background: var(--soft-nav-icon-bg) !important; 
    color: var(--soft-nav-icon-color) !important;
    width: 32px;
    height: 32px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    margin-right: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.navbar-vertical .nav-item.active > .nav-link,
.navbar-dark .navbar-nav .show > .nav-link,
.navbar-dark .navbar-nav .active > .nav-link {
    background-color: var(--soft-card-bg) !important; 
    color: var(--soft-nav-text-active) !important;
    font-weight: 700 !important;
    box-shadow: var(--soft-ui-shadow) !important; 
}

.navbar-vertical .nav-item.active .nav-link-icon,
.navbar-vertical .nav-item.active .nav-link i {
    background: linear-gradient(310deg, var(--primary-color, #cb0c9f), var(--secondary-color, #7928ca)) !important;
    color: #fff !important;
    box-shadow: 0 4px 6px -1px rgba(203, 12, 159, 0.2) !important;
}

/* =========================================
   4. THEME-AWARE FLOATING TOP NAVBAR 
========================================= */
header.navbar, 
.page-header, 
.navbar-custom,
header.navbar.navbar-dark,
.navbar.sticky-top {
    background-color: var(--soft-nav-bg) !important; 
    
    backdrop-filter: blur(12px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(200%) !important;
    
    border-radius: 1rem !important; 
    border: 1px solid var(--soft-nav-border) !important;
    box-shadow: var(--soft-nav-shadow) !important; 
    
    margin: 1rem 1.5rem 1.5rem 1.5rem !important; 
    padding: 0.5rem 1.5rem !important;
    width: auto !important;
    
    /* FIX: Force Navbar to stay visually above the page content */
    position: relative !important;
    z-index: 1050 !important; 
}

.page-title,
.navbar .navbar-brand {
    color: var(--soft-nav-text-active) !important;
    font-weight: 700 !important;
    font-size: 1.15rem !important;
    letter-spacing: -0.025rem;
}

.breadcrumb-item, 
.breadcrumb-item a,
.breadcrumb-item::before,
.breadcrumb-item i,
.breadcrumb-item svg,
.breadcrumb i,
.breadcrumb svg {
    color: var(--soft-nav-text) !important;
    font-size: 0.85rem !important;
    font-weight: 500;
    text-decoration: none;
    fill: currentColor; 
}

.breadcrumb-item.active {
    color: var(--soft-nav-text-active) !important;
    font-weight: 700 !important;
}

header.navbar input[type="search"],
header.navbar input[type="text"],
header.navbar .form-control {
    border-radius: 2rem !important; 
    background-color: var(--soft-card-bg) !important; 
    border: 1px solid var(--soft-card-border) !important;
    color: var(--soft-nav-text-active) !important;
    padding: 0.5rem 1.25rem 0.5rem 2.5rem !important; 
    height: 40px !important;
    font-size: 0.85rem !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important; 
}

header.navbar input::placeholder {
    color: var(--soft-nav-text) !important;
    opacity: 0.8 !important;
}

header.navbar input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(203, 12, 159, 0.25) !important;
}

header.navbar .btn {
    border-radius: 2rem !important; 
    font-weight: 600 !important;
    background-color: var(--soft-card-bg) !important;
    color: var(--soft-nav-text-active) !important;
    border: 1px solid var(--soft-card-border) !important;
}

header.navbar .btn i,
header.navbar .btn svg {
    color: var(--soft-nav-text-active) !important;
    fill: none !important; 
    stroke: currentColor !important;
}

header.navbar .input-group-text,
header.navbar .input-icon-addon,
header.navbar .search-input-wrapper span {
    background-color: transparent !important;
    border: none !important;
}

header.navbar kbd, 
header.navbar .badge.bg-muted,
.input-icon-addon kbd {
    display: inline-flex !important;
    background-color: var(--soft-body-bg) !important; 
    color: var(--soft-nav-text-active) !important;
    border: 1px solid var(--soft-card-border) !important;
    border-radius: 1rem !important; 
    padding: 0.25rem 0.6rem !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

header.navbar .nav-link,
header.navbar .nav-link i {
    color: var(--soft-nav-text) !important;
    transition: color 0.2s ease;
    border: none !important;
}

header.navbar .nav-link:hover,
header.navbar .nav-link:hover i {
    color: var(--primary-color) !important;
}

header.navbar .nav-link div,
header.navbar .nav-link span,
header.navbar .nav-link small,
header.navbar .nav-link .text-muted {
    color: var(--soft-nav-text) !important; 
}

header.navbar .nav-link > div > div:first-child {
    color: var(--soft-nav-text-active) !important;
    font-weight: 600 !important;
}

header.navbar .avatar {
    border-radius: 50% !important; 
    border: 2px solid var(--soft-card-border) !important;
}

header.navbar .dropdown-toggle::after {
    display: none !important;
}

header.navbar .navbar-toggler,
header.navbar .navbar-toggler i,
header.navbar .navbar-toggler svg,
header.navbar .menu-toggle svg {
    color: var(--soft-nav-text-active) !important;
}

/* =========================================
   5. DASHBOARD CARDS & STAT WIDGETS
========================================= */
.card {
    background-color: var(--soft-card-bg); 
    backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid var(--soft-card-border);
    border-radius: 1rem !important;
    box-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.1) !important;
}

.card .card-header {
    background: transparent !important;
    border-bottom: none !important;
    padding: 1.25rem 1.25rem 0 !important;
}

.card .card-header h6, 
.card .card-header .card-title,
.card-header > div > h4 { 
    font-weight: 700 !important;
    color: var(--soft-text-main) !important;
    margin-bottom: 0.5rem;
    font-size: 1rem !important;
    letter-spacing: -0.025rem;
}

.card .card-header p {
    font-size: 0.875rem !important;
    color: var(--soft-text-muted) !important;
}

/* =========================================
   6. SLEEK SOFT UI TABLES & PROJECT CARDS 
========================================= */
.table thead th {
    background: transparent !important;
    border-bottom: 1px solid var(--soft-card-border) !important;
    color: var(--soft-text-muted) !important;
    text-transform: uppercase;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05rem;
    padding: 0.75rem 1.25rem !important;
    opacity: 0.7;
}

.table tbody tr td {
    padding: 0.75rem 1.25rem !important;
    vertical-align: middle;
    border-bottom: 1px solid var(--soft-card-border) !important;
    font-size: 0.875rem !important;
    color: var(--soft-text-main) !important;
}

.table tbody tr td a, 
.table tbody tr td .font-weight-bold {
    font-weight: 600 !important;
    color: var(--soft-text-main) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.table tbody tr td a:hover {
    color: var(--primary-color) !important;
}

.avatar, .avatar-sm, .table img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    border: 2px solid var(--soft-card-bg);
    margin-left: -10px; 
    transition: all 0.2s ease;
}

.avatar:first-child, .table img:first-child { margin-left: 0; }
.avatar:hover, .table img:hover { z-index: 10; transform: scale(1.1); }

.table tbody tr:last-child td { border-bottom: none !important; }

/* =========================================
   7. CHARTS CONTAINERS 
========================================= */
.bg-gradient-dark-chart {
    background: linear-gradient(310deg, #141727 0%, #3a416f 100%) !important;
    border-radius: 1rem !important;
    padding: 1rem;
}

#chartjs-tooltip {
    background: var(--soft-card-bg) !important;
    backdrop-filter: blur(5px);
    border-radius: 8px;
    color: var(--soft-text-main);
    box-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
}

/* =========================================
   8. SETTINGS PAGE REDESIGN (SOFT UI)
========================================= */
.list-group-item, 
.nav-pills .nav-link,
.settings-nav .nav-link {
    border-radius: 0.75rem !important;
    margin-bottom: 0.35rem !important;
    color: var(--soft-text-muted) !important;
    border: none !important;
    background-color: transparent !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.25rem !important;
    transition: all 0.2s ease;
}

.list-group-item.active, 
.nav-pills .nav-link.active,
.settings-nav .nav-link.active {
    background-color: var(--soft-card-bg) !important;
    color: var(--soft-text-main) !important;
    font-weight: 700 !important;
    box-shadow: var(--soft-ui-shadow) !important;
}

.list-group-item:not(.active):hover, 
.nav-pills .nav-link:not(.active):hover {
    background-color: rgba(203, 12, 159, 0.05) !important;
    color: var(--primary-color, #cb0c9f) !important;
}

.image-box .preview-image-wrapper {
    border-radius: 1rem !important;
    border: 1px dashed var(--soft-card-border) !important;
    background-color: var(--soft-body-bg) !important;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.image-box .preview-image-wrapper:hover {
    border-color: var(--primary-color, #cb0c9f) !important;
    background-color: var(--soft-card-bg) !important;
}

.image-box .btn-remove {
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary, 
.card button[type="submit"] {
    background: linear-gradient(310deg, var(--primary-color, #cb0c9f), var(--secondary-color, #7928ca)) !important;
    border: none !important;
    border-radius: 2rem !important; 
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease;
    color: #fff !important;
}

.btn-primary:hover, 
.card button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08) !important;
}

select.form-select,
select.form-control,
.form-control {
    border-radius: 0.75rem !important;
    border: 1px solid var(--soft-card-border) !important;
    background-color: var(--soft-input-bg) !important;
    color: var(--soft-text-main) !important;
}

select.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color, #cb0c9f) !important;
    box-shadow: 0 0 0 0.2rem rgba(203, 12, 159, 0.25) !important;
}

/* =========================================
   9. DROPDOWN MENUS (Profile & Sidebar Sub-menus)
========================================= */
.dropdown-menu {
    /* FIX: Use the solid dropdown variable instead of the transparent card background */
    background-color: var(--soft-dropdown-bg) !important;
    
    border: 1px solid var(--soft-card-border) !important;
    border-radius: 1rem !important;
    box-shadow: 0 8px 26px -4px rgba(0, 0, 0, 0.15) !important;
    padding: 0.5rem !important;
    
    /* FIX: Make sure the dropdown itself stays above the page */
    z-index: 1060 !important; 
}

/* Clear form margins if Logout is inside a form */
.dropdown-menu form {
    margin: 0 !important;
    padding: 0 !important;
}

.dropdown-item,
.dropdown-menu form button,
.dropdown-menu a.text-danger {
    color: var(--soft-text-main) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease;
    font-size: 0.875rem !important;
    display: flex !important;
    align-items: center;
    width: 100% !important;
    text-align: left !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.dropdown-item:hover, 
.dropdown-item:focus,
.dropdown-menu form button:hover,
.dropdown-menu form button:focus,
.dropdown-menu a.text-danger:hover {
    background-color: rgba(203, 12, 159, 0.05) !important;
    color: var(--primary-color, #cb0c9f) !important;
    transform: none !important;
    box-shadow: none !important;
}

.navbar-vertical .collapse .nav-link,
.navbar-vertical .nav-item .collapse .nav-link,
.navbar-vertical .sub-menu .nav-link {
    color: var(--soft-nav-text) !important;
}

.navbar-vertical .collapse .nav-link:hover,
.navbar-vertical .nav-item .collapse .nav-link:hover,
.navbar-vertical .sub-menu .nav-link:hover {
    color: var(--soft-nav-text-active) !important;
    background-color: transparent !important; 
}


/* =========================================
   10. OFFCANVAS & NOTIFICATION PANEL FIX
========================================= */
/* Forces the notification slide-out to render ABOVE the floating navbar */
.offcanvas,
.offcanvas-end,
.offcanvas-start,
.offcanvas-top,
.offcanvas-bottom {
    z-index: 1070 !important; 
}

/* Ensures the dark backdrop overlay also covers the navbar */
.offcanvas-backdrop {
    z-index: 1065 !important;
}
.table-actions .btn-primary, .table-actions .btn-danger { color: #ffffff !important; --tblr-btn-color-text: #ffffff !important; } .table-actions .btn-primary svg, .table-actions .btn-danger svg, .table-actions .btn-primary i, .table-actions .btn-danger i { color: #ffffff !important; }

/* FIX FOR MOBILE NAVBAR HEIGHT */
@media (min-width: 992px) {
    .navbar-vertical,
    aside.navbar-vertical,
    .navbar-vertical.navbar-dark {
        margin: 1rem 0 1rem 1rem !important;
        min-height: calc(100vh - 2rem) !important;
    }
}
@media (max-width: 991.98px) {
    .navbar-vertical,
    aside.navbar-vertical,
    .navbar-vertical.navbar-dark {
        margin: 1rem !important;
        min-height: auto !important;
    }
}