/* Custom Overrides for Safari Internal App */
:root {
    --bs-primary: #0d6efd;
    --primary-soft: #e3f2fd;
    --primary-hover: #0b5ed7;
}

body {
    background-color: #e3f2fd; /* Light blue background */
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    color: #2c3e50;
}

/* Login Specific Styles */
.login-body {
    background-color: #f0f4f8; /* Very light blue/gray background */
    /* Alternatively, a subtle gradient: */
    background: linear-gradient(135deg, #f0f4f8 0%, #eef2f7 100%);
}

.login-card-wrapper {
    width: 100%;
    max-width: 480px; /* Slightly wider card as per image */
}

.login-card {
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 10px 40px rgba(0,0,0,0.06); /* Soft, large shadow */
}

.login-title {
    color: var(--bs-primary); /* Blue instead of Red */
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
}

.custom-input {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border-color: #dee2e6;
    font-size: 0.95rem;
}

.custom-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15); /* Soft blue glow */
    border-color: var(--bs-primary);
}

.input-group-text {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.form-control.border-end-0 {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-btn {
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    font-size: 1rem;
    /* transition: all 0.3s; */
}

.copyright-text {
    font-size: 0.75rem;
    color: #adb5bd;
}

/* Dashboard Updates */
.card-dashboard {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: none;
    transition: transform 0.2s;
}

.card-dashboard:hover {
    transform: translateY(-3px);
}

.header-brand {
    font-weight: 700;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

/* Modern Sidebar & Layout Styles */
:root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
    --sidebar-bg: #ffffff; /* Premium white background */
    --sidebar-hover-bg: #f8fafc;
    --sidebar-text: #64748b;
    --sidebar-text-active: #3b82f6;
    --bs-primary: #0d6efd;
    --primary-soft: #e3f2fd;
    --primary-hover: #0b5ed7;
}

body {
    background-color: #f8fafc !important; /* Premium off-white background */
    font-family: 'Poppins', sans-serif;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: row !important;
    overflow-x: hidden;
}

/* Global Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.spinner-custom {
    width: 3rem;
    height: 3rem;
}

/* Floating Sidebar Container (lowered below the full header) */
.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - 110px);
    background-color: transparent; /* transparent parent to let capsules float */
    border: none;
    box-shadow: none;
    position: fixed;
    left: 12px;
    top: 90px; /* lowered below the 70px header with 20px gap */
    bottom: 12px;
    z-index: 1040;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px; /* space between separate capsules */
    overflow: visible;
}

/* Sidebar Floating Capsules */
.sidebar-capsule {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: border-radius 0.3s ease, padding 0.3s ease;
}

.sidebar-capsule-theme {
    flex-shrink: 0;
    padding: 10px;
}

.sidebar-capsule-menu {
    flex-grow: 1;
    align-items: stretch;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-capsule-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-capsule-menu::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.4);
    border-radius: 10px;
}
.sidebar-capsule-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.8);
}
body.dark-theme .sidebar-capsule-menu::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.4);
}
body.dark-theme .sidebar-capsule-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.8);
}

.sidebar-capsule-bottom {
    flex-shrink: 0;
    align-items: stretch;
    padding: 10px;
}

.sidebar-nav {
    gap: 4px;
    width: 100%;
}

.sidebar .nav-link-custom {
    font-weight: 500;
    color: var(--sidebar-text) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar .nav-link-custom:hover {
    color: #0f172a !important;
    background-color: var(--sidebar-hover-bg);
}

.sidebar .nav-link-custom.active {
    color: var(--sidebar-text-active) !important;
    font-weight: 600;
    background-color: rgba(59, 130, 246, 0.08);
}

.sidebar .nav-link-custom:not(.collapsed) .toggle-chevron {
    transform: rotate(180deg);
}

.sidebar .toggle-chevron {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.sidebar .sub-nav .sub-link-custom {
    font-weight: 500;
    color: var(--sidebar-text) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar .sub-nav .sub-link-custom:hover {
    color: #0f172a !important;
    background-color: var(--sidebar-hover-bg);
}

.sidebar .sub-nav .sub-link-custom.active {
    color: var(--sidebar-text-active) !important;
    font-weight: 600;
    background-color: rgba(59, 130, 246, 0.05);
}

/* Sidebar Theme Toggle Switcher Details */
.theme-vertical-pill {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px;
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

.theme-vertical-pill button {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    padding: 0;
    transition: all 0.2s ease;
}

.theme-vertical-pill button.btn-active-theme {
    background-color: #ffffff;
    color: #f59e0b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sidebar-bottom-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Main Content Wrapper - Floating layout offset */
.main-wrapper {
    flex-grow: 1;
    margin-left: 94px; /* Permanent minimized sidebar offset: left 12px + collapsed width 70px + gap 12px */
    margin-top: 70px; /* space for full-width header */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 70px);
    width: calc(100% - 94px);
    padding-right: 12px;
    padding-top: 20px;
}

/* Force container wrapper to act like container-fluid to maximize width */
.main-wrapper .container {
    max-width: 100% !important;
    width: 100% !important;
}

/* Sidebar Permanent Minimized State (on desktop) */
@media (min-width: 992px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
        align-items: center;
    }
    
    .sidebar .sidebar-capsule {
        border-radius: 40px;
        padding: 10px 5px;
    }
    
    .sidebar .sidebar-capsule-menu {
        padding: 1rem 0;
        overflow: visible !important; /* Ensure tooltips are not clipped */
    }

    .sidebar .menu-text {
        display: none !important;
    }
    .sidebar .toggle-chevron {
        display: none !important;
    }
    .sidebar .nav-link-custom {
        justify-content: center !important;
        padding: 0.5rem 0 !important;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        margin: 0 auto 6px auto;
    }
    .sidebar .nav-link-custom span {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    .sidebar .nav-link-custom span i {
        margin-right: 0 !important;
        margin-inline-end: 0 !important;
        font-size: 1.2rem;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    /* Minimized Active Icon - Capsule Dark Backing style */
    .sidebar .nav-link-custom.active {
        background-color: transparent !important;
    }
    .sidebar .nav-link-custom.active span i {
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    }
    
    .sidebar .sub-nav {
        display: none !important;
    }
    .sidebar .collapse {
        display: none !important;
    }
}

/* Sidebar Tooltip Hint Style */
.sidebar .nav-item {
    position: relative;
}

.sidebar .nav-link-custom {
    position: relative;
}

.sidebar .nav-link-custom::after {
    content: attr(data-hint);
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background-color: #1e293b;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1090;
    pointer-events: none;
}

body.dark-theme .sidebar .nav-link-custom::after {
    background-color: #334155;
    color: #f8fafc;
    border: 1px solid #475569;
}

.sidebar .nav-link-custom:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Floating Header Container & Capsule layout */
.header-floating-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 15px 12px 10px 12px;
    background-color: transparent;
    height: 85px;
    display: flex;
    align-items: center;
}

.header-capsule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

.header-capsule {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border-radius: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.header-capsule-brand {
    flex-shrink: 0;
}

.header-capsule-nav {
    flex-grow: 0;
}

.header-capsule-user {
    flex-shrink: 0;
}

/* Nav Pill Item inside Header Center Capsule */
.nav-pill-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    padding: 8px 18px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    letter-spacing: -0.1px;
}

.nav-pill-item:hover {
    color: #0f172a;
    background-color: #f1f5f9;
}

.nav-pill-item.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.user-avatar {
    width: 36px !important;
    height: 36px !important;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    border: 1px solid rgba(13, 110, 253, 0.15);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.2);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-body {
    flex-grow: 1;
    padding: 1.5rem 0;
}

/* Mobile adaptation */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        top: 0;
        bottom: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        border-radius: 0;
        border: none;
        border-right: 1px solid #e2e8f0;
        gap: 0;
        z-index: 1060;
        background-color: #ffffff !important;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    }
    .sidebar-capsule {
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background-color: transparent !important;
        width: 100%;
        align-items: stretch !important;
    }
    .sidebar-capsule-theme {
        display: none !important; /* Hide vertical theme toggle on mobile */
    }
    .sidebar-capsule-bottom {
        padding-top: 15px;
        border-top: 1px solid #e2e8f0;
        background-color: #ffffff !important;
    }
    .main-wrapper {
        margin-left: 0 !important;
        width: 100%;
        padding-right: 0;
    }
    .header-floating-container {
        padding: 10px 15px;
    }
    .header-capsule-nav {
        display: none !important;
    }
}


/* Modern Footer Styles */
.footer-modern {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    margin-top: 1.5rem;
}

.footer-brand-icon {
    width: 24px;
    height: 24px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* User Dropdown Styles */
.user-dropdown-toggle {
    cursor: pointer;
    transition: opacity 0.2s;
}

.user-dropdown-toggle:hover {
    opacity: 0.8;
}

.dropdown-menu-custom {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    margin-top: 1rem !important;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.text-danger:hover {
    background-color: #fff1f2;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #f1f5f9;
}

/* Premium Form Controls */
.form-control-premium, .form-select-premium {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.925rem !important;
    color: #1e293b !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-control-premium:focus, .form-select-premium:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.12) !important;
    color: #0f172a !important;
    outline: none !important;
}

.form-control-premium-sm, .form-select-premium-sm {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.85rem !important;
    color: #1e293b !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-control-premium-sm:focus, .form-select-premium-sm:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

/* Autocomplete Dropdown List */
.autocomplete-dropdown {
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    background-color: #ffffff !important;
    z-index: 1050;
}

.autocomplete-item {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background-color 0.15s ease !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none !important;
    color: inherit !important;
}

.autocomplete-item:hover {
    background-color: #f8fafc !important;
}

.autocomplete-item:last-child {
    border-bottom: none !important;
}

/* Premium Card Overrides */
.card-premium {
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    background-color: #ffffff !important;
    margin-bottom: 1.5rem;
}

.card-premium .card-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 1.25rem 1.5rem !important;
}

.card-premium .card-body {
    padding: 1.5rem !important;
}

/* Selected Product Chips */
.selected-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
    transition: all 0.2s ease;
}

.selected-product-row:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.02);
}

.selected-product-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff1f2;
    color: #f43f5e !important;
    border: none;
    transition: all 0.2s ease;
}

.selected-product-delete-btn:hover {
    background-color: #ffe4e6;
    color: #e11d48 !important;
    transform: scale(1.1);
}

/* Card Accent Borders & Soft Icon Badges */
.card-premium-primary {
    border-left: 4px solid #3b82f6 !important; /* Premium Blue */
}
.card-premium-success {
    border-left: 4px solid #10b981 !important; /* Premium Emerald/Teal */
}
.card-premium-warning {
    border-left: 4px solid #f59e0b !important; /* Premium Amber */
}
.card-premium-info {
    border-left: 4px solid #8b5cf6 !important; /* Premium Violet */
}
.card-premium-secondary {
    border-left: 4px solid #64748b !important; /* Premium Slate */
}

.icon-badge-soft {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.icon-badge-soft-primary {
    background-color: rgba(59, 130, 246, 0.08) !important;
    color: #3b82f6 !important;
}
.icon-badge-soft-success {
    background-color: rgba(16, 185, 129, 0.08) !important;
    color: #10b981 !important;
}
.icon-badge-soft-warning {
    background-color: rgba(245, 158, 11, 0.08) !important;
    color: #f59e0b !important;
}
.icon-badge-soft-info {
    background-color: rgba(139, 92, 246, 0.08) !important;
    color: #8b5cf6 !important;
}
.icon-badge-soft-secondary {
    background-color: rgba(100, 116, 139, 0.08) !important;
    color: #64748b !important;
}

/* Selected Product Badge Container */
.product-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

/* Spreadsheet-Style Inputs for Tiers Table */
.tier-input-premium {
    background-color: #f8fafc !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.85rem !important;
    color: #1e293b !important;
    transition: all 0.15s ease !important;
}

.tier-input-premium:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 0.15rem rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.tier-select-premium {
    background-color: #f8fafc !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    padding: 0.35rem 1.5rem 0.35rem 0.6rem !important;
    font-size: 0.85rem !important;
    color: #1e293b !important;
    transition: all 0.15s ease !important;
}

.tier-select-premium:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 0.15rem rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

/* Custom design for Segmented Toggle Switch */
.btn-check:checked + .btn-outline-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
}

.btn-check:checked + .btn-outline-danger {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25) !important;
}

.btn-group-segmented {
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.btn-group-segmented .btn {
    border: none !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    transition: all 0.2s ease !important;
}

/* --- Interactive Dark Theme Styles --- */
body.dark-theme {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* Header Dark Mode overrides */
body.dark-theme .header-floating-container {
    background-color: transparent;
}

body.dark-theme .header-capsule {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body.dark-theme .header-capsule-brand span,
body.dark-theme .header-capsule-brand i,
body.dark-theme .header-capsule-user span,
body.dark-theme .header-capsule-user i {
    color: #f8fafc !important;
}

body.dark-theme .header-capsule-actions i {
    color: #94a3b8 !important;
}

body.dark-theme .header-capsule-actions a:hover i {
    color: #f8fafc !important;
}

body.dark-theme .nav-pill-item {
    color: #94a3b8;
}

body.dark-theme .nav-pill-item:hover {
    color: #f8fafc;
    background-color: #334155;
}

body.dark-theme .nav-pill-item.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Sidebar Dark Mode overrides */
body.dark-theme .sidebar-capsule {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-theme .sidebar .nav-link-custom {
    color: #94a3b8 !important;
}

body.dark-theme .sidebar .nav-link-custom:hover {
    color: #f8fafc !important;
    background-color: #334155;
}

body.dark-theme .sidebar .nav-link-custom.active {
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.08);
}

body.dark-theme .sidebar .sub-nav .sub-link-custom {
    color: #94a3b8 !important;
}

body.dark-theme .sidebar .sub-nav .sub-link-custom:hover {
    color: #f8fafc !important;
    background-color: #334155;
}

body.dark-theme .sidebar .sub-nav .sub-link-custom.active {
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.05);
}

/* Minimized sidebar active state in Dark Mode */
@media (min-width: 992px) {
    body.dark-theme.sidebar-minimized .sidebar:not(:hover) .nav-link-custom.active span i {
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }
}

/* Theme switcher capsule dark mode */
body.dark-theme .theme-vertical-pill {
    background-color: #0f172a;
    border-color: #334155;
}

body.dark-theme .theme-vertical-pill button {
    color: #94a3b8;
}

body.dark-theme .theme-vertical-pill button.btn-active-theme {
    background-color: #1e293b;
    color: #38bdf8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Mobile Dark Sidebar overrides */
body.dark-theme .sidebar {
    background-color: #1e293b !important;
    border-right-color: #334155 !important;
}

@media (min-width: 992px) {
    body.dark-theme .sidebar {
        background-color: transparent !important;
        border-right: none !important;
    }
}


body.dark-theme .sidebar-capsule-bottom {
    background-color: #1e293b !important;
    border-top-color: #334155 !important;
}

/* Cards & Content Dark Mode overrides */
body.dark-theme .card-premium {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

body.dark-theme .card-premium .card-header {
    background-color: #1e293b !important;
    border-bottom-color: #334155 !important;
}

body.dark-theme .card-premium .card-header h5,
body.dark-theme .card-premium .card-header h6,
body.dark-theme .card-premium .card-header span,
body.dark-theme .card-premium .card-header th,
body.dark-theme .card-premium .card-header td {
    color: #f8fafc !important;
}

body.dark-theme .card-premium .card-body {
    color: #e2e8f0 !important;
}

body.dark-theme .text-dark,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
    color: #f8fafc !important;
}

body.dark-theme .text-muted {
    color: #94a3b8 !important;
}

body.dark-theme .table {
    color: #e2e8f0 !important;
}

body.dark-theme .table,
body.dark-theme .table-bordered,
body.dark-theme .table-bordered > :not(caption) > *,
body.dark-theme .table-bordered > :not(caption) > * > *,
body.dark-theme .table > :not(caption) > * > * {
    border-color: #334155 !important;
}

body.dark-theme .table th {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

body.dark-theme .table td {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark-theme .form-control-premium,
body.dark-theme .form-select-premium,
body.dark-theme .form-control-premium-sm,
body.dark-theme .form-select-premium-sm {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .form-control-premium:focus,
body.dark-theme .form-select-premium:focus,
body.dark-theme .form-control-premium-sm:focus,
body.dark-theme .form-select-premium-sm:focus {
    background-color: #1e293b !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.15) !important;
}

/* User dropdown customized for dark mode */
body.dark-theme .dropdown-menu-custom {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .dropdown-item {
    color: #e2e8f0 !important;
}

body.dark-theme .dropdown-item:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

body.dark-theme .dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

body.dark-theme .dropdown-divider {
    border-color: #334155 !important;
}

/* Footer in dark theme */
body.dark-theme .footer-modern {
    background-color: #1e293b !important;
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .footer-brand-icon {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

/* Comprehensive Dark Mode Page, Cards, Font, Modal, Accordion, Table and Pagination Fixes */
body.dark-theme .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    color: #f8fafc !important;
}

body.dark-theme .card-header, 
body.dark-theme .card-footer {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .bg-white {
    background-color: #1e293b !important;
}

body.dark-theme .bg-light {
    background-color: #0f172a !important; /* Slate 900 for nested panels */
}

body.dark-theme .text-secondary {
    color: #94a3b8 !important;
}

body.dark-theme .text-black-50 {
    color: #94a3b8 !important;
}

body.dark-theme .form-label {
    color: #cbd5e1 !important;
}

body.dark-theme .border,
body.dark-theme .border-top,
body.dark-theme .border-bottom,
body.dark-theme .border-start,
body.dark-theme .border-end {
    border-color: #334155 !important;
}

/* Tables styling in dark mode */
body.dark-theme .table-light {
    background-color: #334155 !important;
    color: #f8fafc !important;
}
body.dark-theme .table-light th,
body.dark-theme .table-light td {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: #f8fafc !important;
}

/* Modals in dark mode */
body.dark-theme .modal-content {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .modal-header,
body.dark-theme .modal-footer {
    border-color: #334155 !important;
}

body.dark-theme .modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

/* Accordions in dark mode */
body.dark-theme .accordion-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .accordion-button {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme .accordion-button:not(.collapsed) {
    background-color: #334155 !important;
    color: #38bdf8 !important;
}

body.dark-theme .accordion-button::after {
    filter: invert(1) grayscale(1) brightness(2);
}

/* Form inputs styling in dark mode */
body.dark-theme .form-control,
body.dark-theme .form-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    background-color: #1e293b !important;
    border-color: #38bdf8 !important;
    color: #f8fafc !important;
}

body.dark-theme .form-control::placeholder {
    color: #64748b !important;
}

body.dark-theme select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Autocomplete/List Groups in dark mode */
body.dark-theme .autocomplete-dropdown {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .autocomplete-item {
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .autocomplete-item:hover {
    background-color: #334155 !important;
}

body.dark-theme .list-group-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Nav Tabs in dark mode */
body.dark-theme .nav-tabs {
    border-color: #334155 !important;
}

body.dark-theme .nav-tabs .nav-link:hover,
body.dark-theme .nav-tabs .nav-link:focus {
    border-color: #334155 #334155 #1e293b !important;
    background-color: #334155 !important;
}

body.dark-theme .nav-tabs .nav-link.active {
    background-color: #1e293b !important;
    color: #38bdf8 !important;
    border-color: #334155 #334155 #1e293b !important;
}

/* Pagination in dark mode */
body.dark-theme .page-link {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

body.dark-theme .page-item.active .page-link {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

body.dark-theme .page-item.disabled .page-link {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #475569 !important;
}

/* Subtle contextual background alerts */
body.dark-theme .bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #2ec4b6 !important;
}

body.dark-theme .bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #ff5e62 !important;
}

body.dark-theme .bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #ffb703 !important;
}

body.dark-theme .bg-info-subtle {
    background-color: rgba(13, 202, 240, 0.2) !important;
    color: #00b4d8 !important;
}

body.dark-theme .bg-secondary-subtle {
    background-color: rgba(108, 117, 125, 0.2) !important;
    color: #cbd5e1 !important;
}


/* Sidebar Submenu Transitions */
.submenu-capsule-wrapper {
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
    overflow: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-color: transparent !important;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu-capsule-wrapper.show {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
    border-top-width: 1px !important;
    border-bottom-width: 1px !important;
    border-color: #e2e8f0 !important;
}

body.dark-theme .submenu-capsule-wrapper.show {
    border-color: #334155 !important;
}

/* Status Pulse Animation for Header Indicators */
@keyframes status-pulse-animation {
    0% {
        transform: scale(0.6);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Interactive Status Indicator Hover Style */
.status-indicator {
    position: relative;
    transition: transform 0.2s ease, filter 0.2s ease !important;
}
.status-indicator:hover {
    transform: scale(1.1) !important;
    filter: brightness(1.08) !important;
}

/* Custom CSS Hover Tooltips for Status Indicators */
.status-indicator::after {
    content: attr(data-hint);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: #1e293b;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1090;
    pointer-events: none;
}

body.dark-theme .status-indicator::after {
    background-color: #334155;
    color: #f8fafc;
    border: 1px solid #475569;
}

.status-indicator:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Custom Global Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.35); /* Tailwind Blue-500 with opacity */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.75); /* Darker blue on hover */
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Dark mode overrides for scrollbars */
body.dark-theme ::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35); /* Sky-400 with opacity */
    border: 2px solid transparent;
    background-clip: padding-box;
}
body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.75); /* Brighter sky blue on hover */
    border: 2px solid transparent;
    background-clip: padding-box;
}





