:root {
    --primary-color: #667eea;
    --primary-light: #a8b5ff;
    --primary-dark: #4c63d2;
    --accent-color: #f093fb;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f5f7ff;
    --bg-light: #f8f9fe;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --white: #ffffff;
    --border-color: #e8ecf4;

    /* Modern Vibrant Gradients */
    --grad-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --grad-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --grad-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --grad-danger: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    --grad-purple: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

/* Layout */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar */
#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--sidebar-bg);
    color: var(--text-dark);
    transition: all 0.3s;
    min-height: 100vh;
    border-right: 1px solid var(--border-color);
}

#sidebar .sidebar-header {
    padding: 30px 20px;
    background: var(--white);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

#sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
}

#sidebar ul.components {
    padding: 25px 15px;
}

#sidebar ul li a {
    padding: 13px 15px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

#sidebar ul li a:hover,
#sidebar ul li.active>a {
    color: var(--primary-color);
    background: var(--sidebar-hover);
    transform: translateX(4px);
}

#sidebar ul li a i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

#sidebar ul li.active>a i {
    color: var(--primary-color);
}

/* Page Content */
#content {
    width: 100%;
    padding: 30px 40px;
    transition: all 0.3s;
}

/* Sidebar Responsive Behavior */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: -260px;
        position: fixed;
        z-index: 1050;
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        padding: 20px 15px;
    }

    .navbar {
        padding: 15px;
        margin-bottom: 20px;
    }

    #content.active {
        position: relative;
    }

    #content.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1040;
        cursor: pointer;
        backdrop-filter: blur(2px);
    }

    /* Small mobile tweaks */
    .stat-card .h4 {
        font-size: 1.8rem;
    }

    .stat-card .icon {
        font-size: 2.5rem;
    }

    .stat-card {
        padding: 20px;
    }
}

/* Custom Scrollbar for responsiveness */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
}

@media (min-width: 992px) {
    #sidebar.active {
        margin-left: -260px;
    }
}

/* Navbar */
.navbar {
    padding: 20px 30px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 35px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* Modern Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 25px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Dashboard Stats - Modern Glassmorphism */
.stat-card {
    padding: 32px;
    border-radius: 24px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.bg-grad-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-grad-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.bg-grad-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-grad-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.bg-grad-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.bg-grad-dark {
    background: linear-gradient(135deg, #2d3436 0%, #000000 100%);
}

.stat-card .h4 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 8px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.5px;
}

.stat-card .small {
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    opacity: 0.95;
    font-size: 0.75rem;
}

.stat-card .icon {
    font-size: 3.5rem;
    opacity: 0.25;
    z-index: 1;
    transition: all 0.4s;
}

.stat-card:hover .icon {
    opacity: 0.4;
    transform: scale(1.1) rotate(5deg);
}

/* Improved Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    background: #fdfdfd;
    border-top: none;
    padding: 18px 25px;
}

.table tbody td {
    padding: 18px 25px;
    vertical-align: middle;
    font-size: 0.95rem;
    border-color: var(--border-color);
}

/* Quick Action Buttons - Modern Design */
.btn-action {
    padding: 18px 24px;
    border-radius: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.btn-action:hover::before {
    left: 100%;
}

.btn-action:hover {
    transform: translateX(8px) scale(1.02);
    background: linear-gradient(135deg, #f8f9fe 0%, #ffffff 100%);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.btn-action i {
    transition: transform 0.3s;
}

.btn-action:hover i {
    transform: scale(1.2);
}

/* Button Styling Overrides */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
}

.btn-outline-dark {
    border-color: var(--primary-color);
    color: var(--primary-color);
    border-radius: 10px;
}

.btn-outline-dark:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Login Page Modernized Light */
.login-body {
    background: #ffffff;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(245, 124, 0, 0.1) 0%, rgba(245, 124, 0, 0.05) 100%);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    z-index: 0;
}

.login-card {
    width: 440px;
    background: #ffffff;
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    z-index: 1;
}

/* Page Load Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Staggered Animation Delays */
.stat-card:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.stat-card:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.stat-card:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Card Enhancements */
.card {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.card-header {
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--grad-primary);
    transition: width 0.3s;
}

.card:hover .card-header::after {
    width: 60%;
}

/* Modern Chart Container */
.chart-container {
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 254, 0.9) 100%);
    border-radius: 16px;
}

/* Gradient Text */
.gradient-text {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* User Avatar Utilities */
.object-fit-cover {
    object-fit: cover !important;
}

.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.avatar-circle:hover .avatar-edit-overlay {
    opacity: 1;
}

.extra-small {
    font-size: 11px !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bg-primary-light {
    background-color: #f0f3ff !important;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-hover-lift {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover-lift:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}
