@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-family: 'Plus Jakarta Sans', sans-serif;
    
    /* Harmonious Light Theme Colors (Clean & Modern) */
    --bg-primary: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(226, 232, 240, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --primary-color: #6366f1; /* Indigo */
    --primary-rgb: 99, 102, 241;
    --secondary-color: #ec4899; /* Pink */
    --secondary-rgb: 236, 72, 153;
    
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --glass-blur: 16px;
    --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    --transition-speed: 0.3s;
}

[data-bs-theme="dark"] {
    /* Sleek Dark Theme Colors */
    --bg-primary: #090d16;
    --bg-sidebar: #0f1524;
    --bg-card: rgba(15, 21, 36, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-color: #818cf8; /* Light Indigo */
    --primary-rgb: 129, 140, 248;
    --secondary-color: #f472b6; /* Light Pink */
    
    --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .glass-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
}

/* Layout Shell */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    padding: 20px 12px;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 16px;
    letter-spacing: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link i {
    width: 20px;
    font-size: 1.1rem;
    margin-right: 12px;
    transition: transform 0.2s ease;
}

.sidebar-link:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.08);
}

.sidebar-link:hover i {
    transform: scale(1.1);
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), rgba(var(--primary-rgb), 0.8));
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* Header Navbar Styling */
.app-header {
    height: var(--header-height);
    margin-left: var(--sidebar-width);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    transition: margin-left var(--transition-speed), background-color var(--transition-speed);
}

.header-search {
    width: 300px;
    position: relative;
}

.header-search input {
    padding-left: 36px;
    border-radius: 30px;
    font-size: 0.85rem;
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: calc(var(--header-height) + 24px) 24px 24px 24px;
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
}

/* Dropdowns & Badges */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Statistics Mini-Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.15);
}

/* Animation utilities */
.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tables custom styling */
.custom-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.custom-table tr:not(.table-header) {
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.custom-table td, .custom-table th {
    padding: 12px 16px;
    vertical-align: middle;
}

.custom-table tbody tr {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.custom-table tbody tr:hover {
    transform: scale(1.002);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    background-color: rgba(var(--primary-rgb), 0.02);
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] .custom-table tbody tr:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* Form Styling */
.form-control, .form-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    color: var(--text-primary);
}

/* Mobile Responsiveness Toggle */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-header {
        margin-left: 0;
        padding: 0 15px;
    }
    .app-main {
        margin-left: 0;
        padding: calc(var(--header-height) + 16px) 16px 16px 16px;
    }
}
