/* Global Premium Light Mode Styles */
:root {
    --primary-color: #4f46e5;      /* indigo-600 */
    --primary-hover: #4338ca;      /* indigo-700 */
    --primary-light: #e0e7ff;      /* indigo-100 */
    --sidebar-bg: #ffffff;
    --sidebar-text: #475569;       /* slate-600 */
    --sidebar-active: #f1f5f9;     /* slate-100 */
    --sidebar-active-text: #4f46e5;
    --header-bg: #ffffff;
    --body-bg: #f8fafc;            /* slate-50 */
    --card-bg: #ffffff;
    --text-main: #0f172a;          /* slate-900 */
    --text-muted: #64748b;         /* slate-500 */
    --border-color: #e2e8f0;       /* slate-200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body.light-mode {
    background-color: var(--body-bg);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.sidebar-logo {
    height: 70px;
    padding: 0 24px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logo i {
    font-size: 24px;
}

.sidebar-logo .logo-text {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Scrollable Sidebar Menu Wrapper */
.sidebar-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar Menu */
.sidebar-menu-wrapper::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sidebar-menu-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
    padding: 0 12px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-menu li a i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.sidebar-menu li a:hover {
    background-color: var(--sidebar-active);
    color: var(--sidebar-active-text);
}

.sidebar-menu li a:hover i {
    transform: scale(1.1);
}

.sidebar-menu li a.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-menu li a .menu-text {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Main Content Container */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--body-bg);
}

/* Header */
.top-header {
    background-color: var(--header-bg);
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
}

.header-left .header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

#toggleSidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s;
}

#toggleSidebar:hover {
    background-color: var(--sidebar-active);
}

/* User Profile & Dropdown */
.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.dropdown-toggle:hover .avatar-img {
    border-color: var(--primary-color);
}

.dropdown-toggle::after {
    display: none !important; /* Hide bootstrap caret */
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

/* Content Body */
.content-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

/* Footer */
.bottom-footer {
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
    flex-shrink: 0;
}

/* Collapsed Sidebar State styling */
.sidebar-collapsed .sidebar {
    width: 70px;
}

.sidebar-collapsed .sidebar-logo .logo-text,
.sidebar-collapsed .sidebar-menu li a .menu-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    margin: 0;
    padding: 0;
}

.sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .sidebar-menu li a {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
}

/* Cards & Components Styling */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 24px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.primary {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.stat-icon.info {
    background-color: #e0f2fe;
    color: #0369a1;
}

.stat-icon.success {
    background-color: #dcfce7;
    color: #15803d;
}

.stat-icon.warning {
    background-color: #fef9c3;
    color: #a16207;
}

/* Alert Styling */
.alert {
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.alert-success {
    background-color: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Custom Bootstrap Dropdown items styling override */
.dropdown-menu {
    border-radius: 10px;
    padding: 6px;
}

.dropdown-menu.show {
    display: block !important;
    position: absolute;
    right: -20px;
}

.dropdown-item {
    font-size: 14px;
    font-weight: 500;
    color: var(--sidebar-text);
    border-radius: 6px;
}

.dropdown-item:hover {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
}

.dropdown-item.text-danger:hover {
    background-color: #fee2e2;
    color: #ef4444;
}