@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Donoride Brand Color System - Charcoal + Traffic Light Accents */
    --brand-primary: #2d2d2d;
    --brand-primary-hover: #1a1a1a;
    --brand-primary-subtle: #f0f0f0;
    --brand-focus: rgba(45, 45, 45, 0.25);
    --brand-red: #E53935;
    --brand-amber: #FFC107;
    --brand-green: #43A047;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #222222;
    /* True dark stark color */
    --gray-900: #000000;
    /* Pure black text for high contrast */

    --status-success: #10b981;
    --status-success-bg: rgba(16, 185, 129, 0.12);
    --status-danger: #ef4444;
    --status-danger-bg: rgba(239, 68, 68, 0.12);
    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.12);

    /* Glassmorphism Semantic Variables - Crisp Black & White */
    --bg-app: #f8f9fa;
    /* Bright white/gray background */
    --bg-content: rgba(255, 255, 255, 0.85);
    --bg-content-solid: #ffffff;
    --glass-border: rgba(0, 0, 0, 0.08);
    /* Darker borders for crisp contrast on white */
    --glass-blur: 24px;
    --sidebar-bg: #000000;
    /* Stark pure black sidebar */
    --sidebar-text: #a1a1aa;
    --sidebar-active-bg: rgba(255, 255, 255, 0.15);

    --header-bg: rgba(255, 255, 255, 0.55);

    --header-height: 70px;
    --sidebar-width: 280px;
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --border-radius-xs: 8px;

    /* Deep Premium Shadows */
    --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.12);
    --shadow-glow: 0 0 20px rgba(229, 57, 53, 0.35), 0 0 60px rgba(229, 57, 53, 0.1);
    --shadow-glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
    --shadow-glow-danger: 0 0 20px rgba(239, 68, 68, 0.3);

    /* Animation Timing */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-standard: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-bs-theme="dark"] {
    --bg-app: #0a0a0f;
    --bg-content: rgba(24, 24, 30, 0.65);
    --bg-content-solid: #18181e;
    --glass-border: rgba(255, 255, 255, 0.08);
    --sidebar-bg: rgba(9, 9, 14, 0.82);
    --header-bg: rgba(18, 18, 24, 0.65);
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --gray-200: #27272a;
    --gray-300: #3f3f46;
    --gray-700: #e4e4e7;
    --gray-800: #f4f4f5;
    --gray-900: #ffffff;
    --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Gray Text Utilities - Theme Aware */
.text-gray-50  { color: var(--gray-50) !important; }
.text-gray-100 { color: var(--gray-100) !important; }
.text-gray-200 { color: var(--gray-200) !important; }
.text-gray-300 { color: var(--gray-300) !important; }
.text-gray-400 { color: var(--gray-400) !important; }
.text-gray-500 { color: var(--gray-500) !important; }
.text-gray-600 { color: var(--gray-600) !important; }
.text-gray-700 { color: var(--gray-700) !important; }
.text-gray-800 { color: var(--gray-800) !important; }
.text-gray-900 { color: var(--gray-900) !important; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--gray-900);
    overflow-x: hidden;
    /* Rich Animated Mesh Gradient Background */
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(229, 57, 53, 0.06) 0px, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(255, 193, 7, 0.06) 0px, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(67, 160, 71, 0.06) 0px, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(245, 158, 11, 0.04) 0px, transparent 40%);
    background-attachment: fixed;
    font-size: 0.9375rem;
    position: relative;
}

/* Floating Aurora Orbs - Brighter Accents */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    /* Brighter opacity */
    z-index: -1;
    animation: floatOrb 20s ease-in-out infinite;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(229, 57, 53, 0.15), transparent 70%);
    top: -100px;
    left: -100px;
}

body::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(67, 160, 71, 0.15), transparent 70%);
    bottom: -80px;
    right: -80px;
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(40px, 30px) scale(1.02);
    }
}

/* --- Premium Typography Overrides --- */
h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.brand-logo,
.stat-card-value {
    font-family: 'Outfit', system-ui, sans-serif !important;
}

/* --- App Layout --- */
#wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar: Frosted Glass --- */
#sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #ffffff;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition-standard);
    display: flex;
    flex-direction: column;
    /* Deep Glassmorphism */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo i {
    color: var(--brand-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.75rem;
}

.nav-label {
    padding: 1rem 0.75rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.05em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    top: 0;
}

/* Hover effect for inactive links */
.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* Active 3D Radiant Button */
.nav-link.active {
    background: linear-gradient(180deg, #ef5350, #c62828);
    color: #ffffff !important;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 0 #8e0000, 0 8px 15px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.nav-link.active:hover {
    background: linear-gradient(180deg, #e53935, #b71c1c);
    top: 2px;
    transform: translateX(0);
    /* override slight movement for 3d effect */
    box-shadow: 0 2px 0 #8e0000, 0 4px 8px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

/* Press effect for all nav links */
.nav-link:active,
.nav-link.active:active {
    top: 5px;
    transform: translateX(0);
    box-shadow: 0 0 0 transparent, inset 0 3px 6px rgba(0, 0, 0, 0.6);
}

.nav-link i {
    font-size: 1.1rem;
}

/* --- Main Content Area --- */
#content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --- Header: Frosted Glass Bar --- */
header.topbar {
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem; /* slightly less padding */
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.03);
}

[data-bs-theme="dark"] header.topbar {
    background-color: var(--header-bg);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.system-status-pill {
    background: rgba(0, 0, 0, 0.04);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

[data-bs-theme="dark"] .system-status-pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    top: 0;
    box-shadow: 0 4px 0 #cbd5e1, 0 4px 6px rgba(0, 0, 0, 0.05);
    /* 3D depth */
    overflow: hidden;
    /* Important for glass reflection */
}

/* Glassy Specular Highlight (Aqua effect) */
.btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10%;
    width: 120%;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.btn-icon:hover {
    background: linear-gradient(180deg, #f9fafb, #e5e7eb);
    color: var(--brand-red);
    border-color: rgba(229, 57, 53, 0.2);
    top: 2px;
    box-shadow: 0 2px 0 #cbd5e1, 0 6px 15px rgba(229, 57, 53, 0.15);
}

.btn-icon:active,
.btn-icon.active {
    top: 4px;
    box-shadow: 0 0 0 transparent, inset 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* --- Main Section --- */
main.content-body {
    padding: 2rem;
    max-width: 1400px;
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* --- Cards: 3D Physical Blocks --- */
.card {
    background: var(--bg-content);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    position: relative;
    top: 0;
    box-shadow: 0 8px 0 #d1d5db, 0 15px 30px rgba(0, 0, 0, 0.08);
    /* 3D depth */
    margin-bottom: 2rem;
    /* Give room for shadow */
    overflow: visible;
    /* Prevent shadow clipping if internal elements overlap */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
}

.card:hover {
    top: 3px;
    box-shadow: 0 5px 0 #cbd5e1, 0 8px 20px rgba(229, 57, 53, 0.08);
    border-color: rgba(229, 57, 53, 0.12);
}

.card.active,
.card:active {
    top: 8px;
    box-shadow: 0 0 0 transparent, inset 0 4px 10px rgba(0, 0, 0, 0.05);
}

.stat-card {
    padding: 1.75rem;
    /* More breathing room */
}

.stat-card-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.75rem;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.stat-card-footer {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.trend-up {
    color: var(--status-success);
}

.trend-down {
    color: var(--status-danger);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    /* Glass icon background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: var(--transition-standard);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-glow);
}

.table-container {
    background: var(--bg-content);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    top: 0;
    box-shadow: 0 6px 0 #cbd5e1, 0 10px 25px rgba(0, 0, 0, 0.05);
    /* Table 3D base */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2rem;
}

.table-container:hover {
    top: 2px;
    box-shadow: 0 4px 0 #cbd5e1, 0 8px 15px rgba(0, 0, 0, 0.04);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: rgba(248, 250, 252, 0.5);
    backdrop-filter: blur(6px);
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    border-bottom: 1px solid var(--glass-border);
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: rgba(229, 57, 53, 0.03);
}

/* --- Badges: Frosted Glass Chips --- */
.badge {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid transparent;
    color: rgb(0, 0, 0);
}

.badge-success,
.badge-soft-success,
.bg-soft-success {
    background: var(--status-success-bg);
    color: var(--status-success);
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-danger,
.badge-soft-danger,
.bg-soft-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.badge-warning,
.badge-soft-warning,
.bg-soft-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-soft-primary,
.bg-soft-primary {
    background: rgba(229, 57, 53, 0.12);
    color: var(--brand-red);
    border-color: rgba(229, 57, 53, 0.2);
}

.bg-soft-info {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.2);
}

/* --- Advanced Functions Drawer: Frosted Glass Panel --- */
.action-drawer {
    position: fixed;
    right: -380px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: var(--bg-content);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
    border-left: 1px solid var(--glass-border);
    z-index: 2000;
    transition: var(--transition-standard);
    padding: 2rem;
}

.action-drawer.open {
    right: 0;
}

/* --- Skeleton & Animations --- */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Quick Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.action-btn {
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.action-btn:hover {
    border-color: rgba(229, 57, 53, 0.3);
    background: rgba(229, 57, 53, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(229, 57, 53, 0.12);
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--brand-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.action-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* --- Preloader --- */
.preloader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-app);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.preloader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* --- Back to Top --- */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: var(--transition-bounce);
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    box-shadow: var(--shadow-glow);
}

#backToTop.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Premium 3D Radiant Buttons --- */
.btn {
    border-radius: var(--border-radius-xs);
    font-weight: 600;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(180deg, #ef5350, #c62828);
    /* Red radiant gradient */
    border: none;
    color: white !important;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 0 #8e0000, 0 10px 20px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:focus,
.btn-primary:hover {
    background: linear-gradient(180deg, #e53935, #b71c1c);
    top: 2px;
    box-shadow: 0 3px 0 #8e0000, 0 6px 15px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:active {
    top: 5px;
    box-shadow: 0 0 0 transparent, 0 2px 4px rgba(229, 57, 53, 0.2), inset 0 3px 8px rgba(0, 0, 0, 0.5);
}

/* 3D Success (Green) */
.btn-success {
    background: linear-gradient(180deg, #66bb6a, #2e7d32);
    border: none;
    color: white !important;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 0 #1b5e20, 0 10px 20px rgba(76, 175, 80, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-success:focus,
.btn-success:hover {
    background: linear-gradient(180deg, #4caf50, #1b5e20);
    top: 2px;
    box-shadow: 0 3px 0 #1b5e20, 0 6px 15px rgba(76, 175, 80, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-success:active {
    top: 5px;
    box-shadow: 0 0 0 #1b5e20, inset 0 3px 8px rgba(0, 0, 0, 0.5);
}

/* 3D Warning (Amber) */
.btn-warning {
    background: linear-gradient(180deg, #fbc02d, #f57f17);
    border: none;
    color: #4e3400 !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
    box-shadow: 0 5px 0 #bc5100, 0 10px 20px rgba(255, 193, 7, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.btn-warning:focus,
.btn-warning:hover {
    background: linear-gradient(180deg, #f9a825, #e65100);
    top: 2px;
    box-shadow: 0 3px 0 #bc5100, 0 6px 15px rgba(255, 193, 7, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.btn-warning:active {
    top: 5px;
    box-shadow: 0 0 0 #bc5100, inset 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* 3D Danger (Deep Red/Darker) */
.btn-danger {
    background: linear-gradient(180deg, #ef5350, #c62828);
    border: none;
    color: white !important;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 0 #8e0000, 0 10px 20px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-danger:focus,
.btn-danger:hover {
    background: linear-gradient(180deg, #e53935, #b71c1c);
    top: 2px;
    box-shadow: 0 3px 0 #8e0000, 0 6px 15px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-danger:active {
    top: 5px;
    box-shadow: 0 0 0 transparent, inset 0 3px 8px rgba(0, 0, 0, 0.5);
}

/* 3D Outline Primary */
.btn-outline-primary {
    background: #ffffff;
    border: 1px solid #e53935;
    color: #e53935 !important;
    box-shadow: 0 4px 0 #e53935, 0 4px 6px rgba(229, 57, 53, 0.1);
}

.btn-outline-primary:focus,
.btn-outline-primary:hover {
    background: #ffebee;
    top: 2px;
    box-shadow: 0 2px 0 #e53935, 0 4px 8px rgba(229, 57, 53, 0.15);
}

.btn-outline-primary:active {
    top: 4px;
    box-shadow: 0 0 0 transparent, inset 0 2px 4px rgba(229, 57, 53, 0.2);
}

/* 3D Outline Danger */
.btn-outline-danger {
    background: #ffffff;
    border: 1px solid #ef4444;
    color: #ef4444 !important;
    box-shadow: 0 4px 0 #ef4444, 0 4px 6px rgba(239, 68, 68, 0.1);
}

.btn-outline-danger:focus,
.btn-outline-danger:hover {
    background: #fef2f2;
    top: 2px;
    box-shadow: 0 2px 0 #ef4444, 0 4px 8px rgba(239, 68, 68, 0.15);
}

.btn-outline-danger:active {
    top: 4px;
    box-shadow: 0 0 0 transparent, inset 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* 3D Light & Secondary Buttons */
.btn-light,
.btn-secondary,
.btn-outline-secondary {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border: 1px solid #e2e8f0;
    color: #1f2937 !important;
    box-shadow: 0 4px 0 #cbd5e1, 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-light:focus,
.btn-light:hover,
.btn-secondary:hover,
.btn-outline-secondary:hover {
    background: linear-gradient(180deg, #f9fafb, #e5e7eb);
    top: 2px;
    box-shadow: 0 2px 0 #cbd5e1, 0 4px 8px rgba(0, 0, 0, 0.06);
}

.btn-light:active,
.btn-secondary:active,
.btn-outline-secondary:active {
    top: 4px;
    box-shadow: 0 0 0 transparent, inset 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* 3D Info (Blue) */
.btn-info {
    background: linear-gradient(180deg, #4fc3f7, #0288d1);
    border: none;
    color: white !important;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 0 #01579b, 0 10px 20px rgba(3, 169, 244, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-info:focus,
.btn-info:hover {
    background: linear-gradient(180deg, #29b6f6, #0277bd);
    top: 2px;
    box-shadow: 0 3px 0 #01579b, 0 6px 15px rgba(3, 169, 244, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-info:active {
    top: 5px;
    box-shadow: 0 0 0 transparent, inset 0 3px 8px rgba(0, 0, 0, 0.5);
}

/* 3D Dark (Charcoal/Black) */
.btn-dark {
    background: linear-gradient(180deg, #424242, #212121);
    border: none;
    color: white !important;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 0 #000000, 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.btn-dark:focus,
.btn-dark:hover {
    background: linear-gradient(180deg, #616161, #000000);
    top: 2px;
    box-shadow: 0 3px 0 #000000, 0 6px 15px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.btn-dark:active {
    top: 5px;
    box-shadow: 0 0 0 transparent, inset 0 3px 8px rgba(0, 0, 0, 0.8);
}

.form-control,
.form-select {
    padding: 0.65rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);
    transition: var(--transition-standard);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-focus), 0 4px 12px rgba(229, 57, 53, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

/* --- Premium Library Overrides --- */
.os-theme-dark,
.os-theme-light {
    --os-handle-bg: rgba(148, 163, 184, 0.4);
    --os-handle-bg-hover: rgba(148, 163, 184, 0.6);
    --os-handle-bg-active: var(--brand-primary);
}

/* --- Utilities: Layout & Spacing (Padding, Margin, Justify, Align) --- */
.flex-column-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center-all {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-sm {
    gap: 0.5rem;
}

.gap-md {
    gap: 1rem;
}

.gap-lg {
    gap: 1.5rem;
}

.gap-xl {
    gap: 2rem;
}

.pad-content {
    padding: 1.5rem 1.5rem;
}

.mar-bottom {
    margin-bottom: 2rem;
}

.header-actions-spacing {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.25rem;
    padding-right: 1.5rem;
}

.sidebar-nav-spacing {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-padding-enhanced {
    padding: 1.75rem !important;
}

/* Ensure data tables stretch beautifully */
.table-wrapper {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* === GLASSMORPHISM EXTENDED STYLES === */

/* --- Glass Dropdown Menus --- */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: dropIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] .dropdown-menu {
    background: rgba(24, 24, 30, 0.8);
}

.dropdown-item {
    transition: var(--transition-fast);
    border-radius: var(--border-radius-xs);
    margin: 2px 6px;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(79, 70, 229, 0.08);
    color: var(--brand-primary);
}

@keyframes dropIn {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Glass Card Headers & Footers --- */
.card-header {
    background: rgba(248, 250, 252, 0.5) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border) !important;
}

[data-bs-theme="dark"] .card-header {
    background: rgba(30, 30, 40, 0.4) !important;
}

.card-footer {
    background: rgba(248, 250, 252, 0.4) !important;
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--glass-border) !important;
}

/* --- Glass Pagination --- */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border: 1px solid var(--glass-border);
    color: var(--gray-600);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--border-radius-xs) !important;
    margin: 0 4px;
    position: relative;
    top: 0;
    box-shadow: 0 4px 0 #cbd5e1, 0 4px 6px rgba(0, 0, 0, 0.05);
    /* 3D depth */
    overflow: hidden;
    /* For specular highlight */
    font-weight: 600;
}

/* Glassy Specular Highlight for pagination */
.pagination .page-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10%;
    width: 120%;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(180deg, #ef5350, #c62828);
    color: white !important;
    border-color: transparent;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 0 #8e0000, 0 8px 15px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.pagination .page-item.active .page-link:hover {
    background: linear-gradient(180deg, #e53935, #b71c1c);
    top: 2px;
    box-shadow: 0 2px 0 #8e0000, 0 6px 15px rgba(229, 57, 53, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.pagination .page-link:hover:not(.active) {
    background: linear-gradient(180deg, #f9fafb, #e5e7eb);
    color: var(--brand-red);
    border-color: rgba(229, 57, 53, 0.2);
    top: 2px;
    box-shadow: 0 2px 0 #cbd5e1, 0 4px 8px rgba(229, 57, 53, 0.15);
}

.pagination .page-link:active,
.pagination .page-item.active .page-link:active {
    top: 4px;
    box-shadow: 0 0 0 transparent, inset 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* --- Glass Modal --- */
.modal-content {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-backdrop.show {
    backdrop-filter: blur(4px);
}

[data-bs-theme="dark"] .modal-content {
    background: rgba(24, 24, 30, 0.85);
}

/* --- Glass Tooltips --- */
.tooltip-inner {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius-xs);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* --- Hover Lift Utility --- */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* --- Glass Nav Label Divider --- */
.nav-label {
    position: relative;
    padding-left: 1rem;
}

.nav-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 14px;
    transform: translateY(-50%);
    background: linear-gradient(180deg, var(--brand-primary), transparent);
    border-radius: 2px;
}

/* --- Glass Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.4);
}

/* --- Glass Soft Backgrounds (for icons) --- */
.bg-soft-primary {
    background: rgba(79, 70, 229, 0.12) !important;
}

.bg-soft-success {
    background: rgba(16, 185, 129, 0.12) !important;
}

.bg-soft-warning {
    background: rgba(245, 158, 11, 0.12) !important;
}

.bg-soft-danger {
    background: rgba(239, 68, 68, 0.12) !important;
}

.bg-soft-info {
    background: rgba(6, 182, 212, 0.12) !important;
}

/* --- Glass Preloader Enhancement --- */
.preloader-wrapper {
    background: rgba(238, 242, 247, 0.9) !important;
    backdrop-filter: blur(20px);
}

[data-bs-theme="dark"] .preloader-wrapper {
    background: rgba(10, 10, 15, 0.9) !important;
}

/* --- Animated Content Entrance --- */
.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Glass Input Group --- */
.input-group .input-group-text {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(6px);
}

/* --- Responsive Glass Breakpoints --- */
@media (max-width: 768px) {
    :root {
        --glass-blur: 14px;
        --border-radius: 16px;
        --border-radius-sm: 10px;
    }

    main.content-body {
        padding: 1rem;
    }

    .flex-between-center {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}