:root {
    /* Color Palette */
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #3f37c9;
    --success-color: #2ec4b6;
    --danger-color: #e71d36;
    --warning-color: #ff9f1c;
    --info-color: #4cc9f0;

    /* Backgrounds */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-sidebar: #2b2d42;
    --bg-sidebar-active: #4361ee;
    --text-main: #2b2d42;
    --text-light: #8d99ae;
    --text-white: #ffffff;

    /* Spacing & Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-spring: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Global Reset & Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    zoom: 85%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-main);
}

a {
    text-decoration: none;
    transition: var(--transition-fast);
}

/* Layout Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    position: relative;
    overflow-x: hidden;
}

/* Sidebar Styles */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-white);
    transition: all 0.3s ease;
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    position: relative;
}

#sidebar.active {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
    top: 0;
    left: 0;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h3 {
    color: var(--text-white);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

#sidebar ul.components {
    padding: 15px 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
}

#sidebar ul li.active>a,
a[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--primary-color);
}

/* Submenu Styles */
ul.collapse.list-unstyled {
    background: rgba(0, 0, 0, 0.1) !important;
}

ul.collapse.list-unstyled li a {
    padding-left: 50px !important;
    font-size: 0.9rem;
}

/* Content Area */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-body);
}

/* Navbar */
.navbar {
    padding: 10px 20px;
    background: var(--bg-card);
    border: none;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-btn {
    box-shadow: none;
    outline: none !important;
    border: none;
}

#sidebarCollapse {
    width: 40px;
    height: 40px;
    background: var(--bg-body);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition-fast);
}

#sidebarCollapse:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        margin-left: calc(var(--sidebar-width) * -1);
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        width: 100% !important;
    }

    .navbar {
        padding: 10px 15px;
    }
}

@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .sidebar-header h3 {
        font-size: 1rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
}

/* Cards & Utility Components */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
    transition: transform var(--transition-fast);
    margin-bottom: 20px;
}

.table-responsive {
    border-radius: var(--border-radius);
    border: none;
}