/* ============================================
   SFAMS - SCHOOL FACILITY & ASSET MANAGEMENT SYSTEM
   Main Stylesheet - Modern Pastel Blue Theme
   ============================================ */

/* CSS Variables - Blue Palette (converted from pink) */
:root {
    /* Primary Blue Palette (replacing pink) */
    --primary: #4A90D9;
    --primary-light: #7BB3EA;
    --primary-lighter: #B8D4F5;
    --primary-lightest: #E8F2FC;
    --primary-dark: #2E6BB5;
    --primary-gradient: linear-gradient(135deg, #7BB3EA 0%, #4A90D9 100%);
    --primary-gradient-light: linear-gradient(135deg, #E8F2FC 0%, #D0E4F9 100%);
    
    /* Accent Colors */
    --accent-cyan: #36D1DC;
    --accent-cyan-light: #5EDCE3;
    --accent-purple: #9B6DD9;
    --accent-purple-light: #B794E8;
    
    /* Card Gradients (Blue-Purple like reference) */
    --card-gradient-1: linear-gradient(135deg, #B8D4F5 0%, #D4C4F5 100%);
    --card-gradient-2: linear-gradient(135deg, #C5E0FA 0%, #E8F2FC 100%);
    --card-gradient-3: linear-gradient(135deg, #7BB3EA 0%, #9B6DD9 50%, #36D1DC 100%);
    
    /* Background */
    --bg-page: linear-gradient(180deg, #F0F7FD 0%, #E8F2FC 50%, #F5F0FA 100%);
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-light: #F8FAFD;
    --bg-input: #FAFCFE;
    
    /* Status Colors */
    --success: #22C55E;
    --success-light: #DCFCE7;
    --success-dark: #16A34A;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #4A90D9;
    --info-light: #E8F2FC;
    
    /* Text Colors */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-white: #FFFFFF;
    --text-heading: #111827;
    
    /* Borders */
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --border-primary: #B8D4F5;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(74, 144, 217, 0.08);
    --shadow-lg: 0 8px 24px rgba(74, 144, 217, 0.12);
    --shadow-xl: 0 16px 48px rgba(74, 144, 217, 0.16);
    --shadow-card: 0 2px 8px rgba(74, 144, 217, 0.06);
    --shadow-button: 0 4px 14px rgba(74, 144, 217, 0.25);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Border Radius - Minimalist Design */
    --radius-sm: 4px;
    --radius-md: 5px;
    --radius-lg: 6px;
    --radius-xl: 6px;
    --radius-full: 9999px;
    
    /* Sidebar */
    --sidebar-width: 200px;
    --sidebar-collapsed: 0px;
    --sidebar-bg: linear-gradient(180deg, #4A90D9 0%, #7BB3EA 100%);
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-loading: 600;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

/* ============================================
   LAYOUT STRUCTURE
   ============================================ */
:root {
    --topbar-height: 56px;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-body {
    display: flex;
    flex: 1;
    padding-top: var(--topbar-height);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--topbar-height));
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
    background: var(--bg-page);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

.content-wrapper {
    flex: 1;
    padding: 16px 20px;
    max-width: 1600px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--primary);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

/* ============================================
   SIDEBAR (Modern Collapsible Navigation)
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--sidebar-bg);
    color: var(--text-white);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-normal) ease;
    z-index: calc(var(--z-sidebar) - 1);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Global Scrollbar - Slim Design */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 217, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 217, 0.5);
}

.sidebar::-webkit-scrollbar {
    width: 3px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav {
    padding: 8px 6px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Single Nav Items */
.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 2px 0;
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--bg-white);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    min-width: 18px;
    width: 18px;
    font-size: 13px;
    margin-right: 8px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
}

/* Nav Groups - Accordion Style */
.nav-group {
    margin: 10px 0;
}

.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12.5px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-group-header:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-white);
}

.nav-group.open .nav-group-header {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group-title i {
    font-size: 13px;
    width: 18px;
    min-width: 18px;
    text-align: center;
}

/* Arrow Animation - Right when closed, Down when open */
.nav-group-arrow {
    font-size: 10px;
    transition: transform var(--transition-fast);
    opacity: 0.7;
}

.nav-group.open .nav-group-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* Nav Group Menu - Smooth Accordion */
.nav-group-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
    padding-left: 0;
    margin-left: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.nav-group.open .nav-group-menu {
    max-height: 400px;
    opacity: 1;
    padding: 3px 0 3px 0;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 7px 8px 7px 12px;
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-subitem i {
    font-size: 12px;
    width: 16px;
    min-width: 16px;
    margin-right: 6px;
    text-align: center;
    opacity: 0.8;
}

.nav-subitem:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    padding-left: 18px;
}

.nav-subitem:hover i {
    opacity: 1;
}

.nav-subitem.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    font-weight: 500;
}

.nav-subitem.active i {
    opacity: 1;
}

.nav-subitem.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--accent-cyan);
    border-radius: 0 4px 4px 0;
}

.nav-subitem i {
    min-width: 20px;
    width: 20px;
    font-size: 14px;
    margin-right: 10px;
    text-align: center;
    opacity: 0.8;
}

.nav-subitem:hover i,
.nav-subitem.active i {
    opacity: 1;
}

/* Collapsed State - Nav Groups */
.sidebar.collapsed .nav-group-header {
    justify-content: center;
    padding: 14px;
}

.sidebar.collapsed .nav-group-title .nav-text {
    opacity: 0;
    width: 0;
    position: absolute;
}

.sidebar.collapsed .nav-group-arrow {
    display: none;
}

.sidebar.collapsed .nav-group-menu {
    position: absolute;
    left: calc(var(--sidebar-collapsed) + 8px);
    top: 0;
    width: 220px;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-left: 0;
    border-left: none;
    padding: 0;
    transition: all var(--transition-fast);
    z-index: 1001;
}


.sidebar.collapsed .nav-group:hover .nav-group-menu {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    padding: 8px;
}

.sidebar.collapsed .nav-subitem {
    padding: 10px 14px;
}

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 8px 6px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: padding var(--transition-fast);
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-mini-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-mini-info {
    flex: 1;
    min-width: 0;
}

.user-mini-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-mini-role {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-logout-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    position: relative;
    font-size: 14px;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show,
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content Adjustment for Collapsed Sidebar */
.main-content {
    transition: margin-left var(--transition-normal) ease;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* ============================================
   TOPBAR (Modern Header)
   ============================================ */
.topbar {
    background: var(--bg-white);
    padding: 0 20px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sidebar);
    gap: 20px;
}

/* Topbar Left */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Sidebar Toggle Button in Topbar */
.sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-light);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-toggle-btn:hover {
    background: var(--primary-lightest);
    color: var(--primary);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

/* Topbar Center - Search */
.topbar-center {
    flex: 1;
    max-width: 450px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0 14px;
    height: 38px;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lightest);
    background: white;
}

.search-box i {
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box kbd {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: inherit;
    color: var(--text-muted);
}

/* Topbar Right */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.topbar-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    position: relative;
    transition: all var(--transition-fast);
}

.topbar-icon:hover {
    background: var(--primary-lightest);
    color: var(--primary);
}

.topbar-icon.mobile-search-toggle {
    display: none;
}

.icon-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* User Dropdown */
.user-dropdown-wrapper {
    position: relative;
    margin-left: 4px;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-dropdown-trigger:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.dropdown-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.user-dropdown-wrapper.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.user-dropdown-wrapper.show .user-dropdown-menu,
.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--primary-lightest);
}

.dropdown-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.dropdown-user-details {
    flex: 1;
    min-width: 0;
}

.dropdown-username {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 14px;
}

.dropdown-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.dropdown-item i {
    width: 18px;
    font-size: 15px;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-logout {
    color: var(--danger);
}

.dropdown-logout:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.dropdown-logout i {
    color: var(--danger);
}

/* ============================================
   CARDS (Like Reference Cards)
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 14px 16px;
    background: var(--card-gradient-2);
    border-bottom: none;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
    font-size: 16px;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

/* Instruction Card (Like Reference Pink Box → Blue Box) */
.instruction-card {
    background: var(--card-gradient-2);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.instruction-card i {
    font-size: 18px;
    color: var(--primary);
}

.instruction-card p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

/* Content Card (Like Reference Yellow/Cream Box → Light Blue) */
.content-card {
    background: linear-gradient(135deg, #F0F7FD 0%, #E8F4FF 100%);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 20px;
    text-align: center;
}

.content-card-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-heading);
    letter-spacing: 0.5px;
    line-height: 1.5;
}

/* Action Card (Like Reference Recording Section) */
.action-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.action-icon {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 12px;
}

.action-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ============================================
   STAT CARDS (Modern Style)
   ============================================ */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #B8D4F5 0%, #7BB3EA 100%);
    color: #2E6BB5;
}

.stat-icon.green {
    background: linear-gradient(135deg, #BBF7D0 0%, #86EFAC 100%);
    color: #166534;
}

.stat-icon.yellow {
    background: linear-gradient(135deg, #FEF08A 0%, #FDE047 100%);
    color: #A16207;
}

.stat-icon.red {
    background: linear-gradient(135deg, #FECACA 0%, #FCA5A5 100%);
    color: #B91C1C;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #DDD6FE 0%, #C4B5FD 100%);
    color: #6D28D9;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.1;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-top: 10px;
    color: var(--text-muted);
}

.stat-change.up {
    color: var(--success);
}

.stat-change.down {
    color: var(--danger);
}

/* ============================================
   BUTTONS (Like Reference Buttons)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button (Blue gradient like reference pink) */
.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.35);
}

/* Secondary/Cyan Button (Like reference cyan button) */
.btn-secondary {
    background: linear-gradient(135deg, #36D1DC 0%, #5EDCE3 100%);
    color: var(--text-white);
    box-shadow: 0 4px 14px rgba(54, 209, 220, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(54, 209, 220, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #34D399 100%);
    color: var(--text-white);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #F87171 100%);
    color: var(--text-white);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #FBBF24 100%);
    color: var(--text-heading);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--text-white);
}

.btn-light {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-light:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 14px;
}

.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: var(--radius-md);
    font-size: 11px;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   FORMS (Modern Clean Style)
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-control:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.input-group-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.input-group-btn:hover {
    background: var(--primary-lightest);
    color: var(--primary);
}

/* Select Wrapper */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    padding-right: 44px;
}

.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ============================================
   FILTER BAR (Modern Style)
   ============================================ */
.filter-bar {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select {
    min-width: 140px;
    padding: 8px 32px 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 13px;
    background: var(--bg-white);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.filter-search {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.filter-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 13px;
    background: var(--bg-white);
    transition: all var(--transition-fast);
}

.filter-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.filter-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* ============================================
   TABLES (Clean Modern Style)
   ============================================ */
.table-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.table-header {
    padding: 10px 14px;
    background: var(--card-gradient-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.table-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-title i {
    color: var(--primary);
    font-size: 12px;
}

/* Table Info Inline - Pagination on header */
.table-info-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
}

.per-page-select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    background: var(--bg-white);
}

.pagination-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-inline .pagination-btn {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    font-size: 10px;
}

.page-info {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 0 4px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-search {
    position: relative;
}

.table-search input {
    width: 200px;
    padding: 6px 12px 6px 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 11px;
    background: var(--bg-white);
}

.table-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.table-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 11px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 6px 10px;
}

table th.sortable {
    cursor: pointer;
    user-select: none;
}

table th.sortable:hover {
    color: var(--primary);
}

table th.sortable::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 10px;
}

table th.sortable.asc::after {
    content: '\f0de';
    color: var(--primary);
}

table th.sortable.desc::after {
    content: '\f0dd';
    color: var(--primary);
}

table tbody tr {
    transition: background var(--transition-fast);
}

table tbody tr:hover {
    background: var(--primary-lightest);
}

table td {
    font-size: 14px;
    color: var(--text-primary);
}

/* Table Cell Types */
.cell-id {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

.cell-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cell-name {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 12px;
}

.cell-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.cell-actions {
    display: flex;
    gap: 4px;
}

/* Table Footer */
.table-footer {
    padding: 10px 14px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.table-info {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================
   PAGINATION (Modern Pills)
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 3px;
}

.pagination-btn {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-lightest);
}

.pagination-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   BADGES (Like Reference Tags)
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: #92400E;
}

.badge-danger {
    background: var(--danger-light);
    color: #B91C1C;
}

.badge-info {
    background: var(--info-light);
    color: var(--primary-dark);
}

.badge-secondary {
    background: var(--bg-light);
    color: var(--text-secondary);
}

/* Status Indicator (Like Reference Progress Items) */
.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-active .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-active {
    color: var(--success);
}

.status-pending .status-dot {
    background: var(--warning);
    animation: pulse 2s infinite;
}

.status-pending {
    color: #92400E;
}

.status-inactive .status-dot {
    background: var(--text-muted);
}

.status-inactive {
    color: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================
   PROGRESS BAR (Like Reference Skills)
   ============================================ */
.progress-wrapper {
    margin-bottom: 8px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    text-align: right;
    margin-top: 4px;
}

/* ============================================
   SKILL CARD (Like Reference Pathway Item)
   ============================================ */
.skill-card {
    background: var(--bg-white);
    border: 2px solid var(--success);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-fast);
}

.skill-card:hover {
    box-shadow: var(--shadow-md);
}

.skill-icon {
    width: 48px;
    height: 48px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 20px;
    flex-shrink: 0;
}

.skill-info {
    flex: 1;
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.skill-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
}

.skill-badge {
    background: var(--success-light);
    color: var(--success);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.skill-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.skill-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ============================================
   DRAG & DROP CARDS (Like Reference Puzzle)
   ============================================ */
.drag-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 24px;
    background: var(--card-gradient-2);
    border-radius: var(--radius-xl);
}

.drag-card {
    width: 120px;
    height: 140px;
    background: var(--card-gradient-1);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.drag-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.drag-card:active {
    cursor: grabbing;
}

.drag-card-number {
    background: var(--bg-white);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.drag-card-letter {
    font-size: 48px;
    font-weight: 300;
    color: var(--text-heading);
}

/* ============================================
   CHARTS
   ============================================ */
.chart-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.chart-header {
    padding: 20px 24px;
    background: var(--card-gradient-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
}

.chart-body {
    padding: 24px;
    position: relative;
    min-height: 300px;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 24px;
}

.modal-overlay.show {
    display: flex !important;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 24px;
    background: var(--card-gradient-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.modal-footer {
    padding: 20px 24px;
    background: var(--bg-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    transform: translateX(120%);
    transition: transform var(--transition-normal);
    min-width: 320px;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* Toast Types */
.toast-success {
    border-left-color: var(--success);
}

.toast-success .toast-icon {
    background: var(--success-light);
    color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-error .toast-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-warning .toast-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-info .toast-icon {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.alert-message {
    font-size: 13px;
    line-height: 1.5;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.alert-danger {
    background: var(--danger-light);
    color: #B91C1C;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
}

.alert-info {
    background: var(--info-light);
    color: var(--primary-dark);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state-icon {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.empty-state-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 440px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: var(--primary-gradient);
    color: var(--text-white);
    padding: 40px 32px;
    text-align: center;
}

.login-logo {
    font-size: 56px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.login-body {
    padding: 40px 32px;
}

.login-footer {
    padding: 20px 32px;
    background: var(--bg-light);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.p-0 { padding: 0; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

.w-100 { width: 100%; }

.grid {
    display: grid;
    gap: 20px;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open,
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .topbar-brand {
        display: none;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
        height: 56px;
    }
    
    .topbar-center {
        display: none;
    }
    
    .search-box kbd {
        display: none;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .filter-search {
        width: 100%;
        min-width: auto;
    }
    
    .filter-actions {
        width: 100%;
        margin-left: 0;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-search input {
        width: 100%;
    }
    
    .table-footer {
        flex-direction: column;
        text-align: center;
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 18px;
    }
    
    .breadcrumb {
        display: none;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    
    .stat-value {
        font-size: 26px;
    }
    
    table th,
    table td {
        padding: 12px;
        font-size: 13px;
    }
    
    .cell-actions {
        flex-direction: column;
        gap: 4px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .header,
    .filter-bar,
    .toast-container,
    .loading-overlay,
    .btn,
    .cell-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 0;
    }
    
    .table-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   COMPATIBILITY CLASSES (for legacy pages)
   ============================================ */

/* Alias for old wrapper class */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Legacy dashboard container */
.dashboard-container {
    padding: 24px 32px;
    max-width: 1600px;
}

/* Legacy content section */
.content-section {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-bottom: 24px;
}

.content-section .section-title {
    padding: 20px 24px;
    background: var(--card-gradient-2);
    border-bottom: none;
}

.content-section .section-title h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.content-section .section-title h2 i {
    color: var(--primary);
    font-size: 20px;
}

/* Legacy activity table */
.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th,
.activity-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.activity-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.activity-table tbody tr {
    transition: background var(--transition-fast);
}

.activity-table tbody tr:hover {
    background: var(--primary-lightest);
}

.activity-table td {
    font-size: 14px;
    color: var(--text-primary);
}

/* Legacy action badge */
.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    color: white;
    white-space: nowrap;
}

/* Legacy form group */
.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.1);
}

/* Legacy header styles */
.header .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header .header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg-light);
}

/* Legacy logo in sidebar */
.sidebar .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.sidebar .logo i {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: var(--radius-md);
}

.sidebar .logo span {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Settings container */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Charts */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* Mobile responsive for legacy */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }
    
    .dashboard-container {
        padding: 20px;
    }
}

/* Legacy grid system */
.form-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

/* Fix bg-gray */
.bg-gray,
[style*="bg-gray"] {
    background: var(--bg-light);
}

/* Additional variable aliases */
:root {
    --bg-gray: #F8FAFD;
}

/* ============================================
   HEADER COMPONENTS (for templates)
   ============================================ */

/* Header Center - Global Search */
.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 24px;
}

.global-search {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0 16px;
    transition: all var(--transition-fast);
}

.global-search:focus-within {
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.1);
}

.global-search i {
    color: var(--text-muted);
    font-size: 14px;
}

.global-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.global-search input::placeholder {
    color: var(--text-muted);
}

.global-search kbd {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: inherit;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.header-action:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.header-action .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
    margin: 0 12px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-info:hover {
    background: var(--bg-light);
}

.user-details {
    text-align: left;
}

.user-details .username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-details .role {
    font-size: 12px;
    color: var(--text-muted);
}

.user-info > i {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform var(--transition-fast);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.dropdown-item i {
    width: 18px;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.dropdown-item.text-danger i {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

/* ============================================
   NOTIFICATION PANEL
   ============================================ */
.notification-panel {
    position: fixed;
    top: 70px;
    right: 24px;
    width: 380px;
    max-height: 500px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.notification-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--primary-lightest);
}

.notification-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-header h4 i {
    color: var(--primary);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.mark-all-read:hover {
    background: var(--primary-lighter);
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item.unread {
    background: var(--primary-lightest);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.notification-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.notification-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.notification-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.notification-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 12px;
    color: var(--text-muted);
}

.notification-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

.notification-footer a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   SIDEBAR ADDITIONAL STYLES
   ============================================ */
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: calc(var(--z-sidebar) - 1);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.active-indicator {
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

/* Mobile sidebar styles */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .notification-panel {
        right: 12px;
        left: 12px;
        width: auto;
        top: 60px;
    }
    
    .user-dropdown-menu {
        right: -12px;
        min-width: 200px;
    }
}

/* ============================================
   MODAL STYLES
   ============================================ */
/* Modal OLD - DISABLED - Using modal-overlay instead */
/*
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 24px;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}
*/

.modal-sm .modal-dialog {
    max-width: 400px;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* ============================================
   FIX CHECKBOX COLUMN
   ============================================ */
.checkbox-col {
    width: 50px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Selected row */
tr.selected {
    background: var(--primary-lightest) !important;
}

/* Per page select */
.per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.per-page select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
}

/* Pagination ellipsis */
.pagination-ellipsis {
    padding: 0 8px;
    color: var(--text-muted);
}

/* Text alignment */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* ============================================
   FORM GRID & TEXTAREA
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lightest);
}

.form-select-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   MODAL DIALOG (Alternative)
   ============================================ */
.modal-dialog {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* ============================================
   REQUIRED MARKER
   ============================================ */
.required {
    color: var(--danger);
}

/* ============================================
   GRID UTILITIES
   ============================================ */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 992px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MARGIN & PADDING UTILITIES
   ============================================ */
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ============================================
   BUTTON GROUP
   ============================================ */
.btn-group {
    display: inline-flex;
    gap: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .table-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   SIDEBAR & TOPBAR RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    /* Mobile sidebar */
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        z-index: 1050;
        top: var(--topbar-height);
        height: calc(100vh - var(--topbar-height));
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Main content full width on mobile */
    .main-content {
        margin-left: 0 !important;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* Topbar adjustments */
    .topbar-left .brand-name {
        display: none;
    }
    
    .topbar-center {
        display: none;
    }
    
    .topbar-right {
        gap: 4px;
    }
    
    /* Show mobile search toggle */
    .topbar-icon.mobile-search-toggle {
        display: flex !important;
    }
    
    /* Hide user name on mobile */
    .user-name {
        display: none;
    }
}

@media (max-width: 575.98px) {
    /* Extra small devices */
    .topbar {
        padding: 0 12px;
    }
    
    .topbar-right {
        gap: 2px;
    }
    
    .topbar-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .sidebar-toggle-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .brand-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    /* Sidebar full width on very small screens */
    .sidebar {
        width: 100%;
    }
    
    /* Stats cards single column */
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    /* Page header stacked */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-header .page-actions {
        width: 100%;
    }
    
    .page-header .page-actions .btn {
        flex: 1;
    }
}

/* Mobile search modal */
.mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 16px;
}

.mobile-search-modal.show {
    display: flex;
}

.mobile-search-modal .search-box {
    width: 100%;
    max-width: 500px;
}

.mobile-search-modal .search-box input {
    padding: 14px 16px 14px 44px;
    font-size: 16px;
}

/* Close button for mobile search */
.mobile-search-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--white);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.mobile-search-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* ============================================
   DARK MODE
   ============================================ */
body.dark-mode {
    --bg-body: #1a1d21;
    --bg-white: #242830;
    --bg-light: #2d323c;
    --bg-sidebar: #1e2228;
    
    --text-heading: #f1f3f5;
    --text-body: #adb5bd;
    --text-muted: #868e96;
    --text-light: #495057;
    
    --border-color: #373d47;
    --border-light: #2d323c;
    
    --primary: #5BA4E6;
    --primary-light: #7BB8EC;
    --primary-lighter: #2d3f52;
    --primary-lightest: #1e2a38;
    
    --success: #40c057;
    --warning: #fab005;
    --danger: #fa5252;
    --info: #339af0;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.6);
}

body.dark-mode .topbar {
    background: var(--bg-sidebar);
    border-bottom-color: var(--border-color);
}

body.dark-mode .sidebar {
    background: var(--bg-sidebar);
    border-right-color: var(--border-color);
}

body.dark-mode .main-content {
    background: var(--bg-body);
}

body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .chart-card,
body.dark-mode .table-wrapper {
    background: var(--bg-white);
    border-color: var(--border-color);
}

body.dark-mode table {
    background: var(--bg-white);
}

body.dark-mode table th {
    background: var(--bg-light);
    color: var(--text-heading);
    border-color: var(--border-color);
}

body.dark-mode table td {
    border-color: var(--border-color);
    color: var(--text-body);
}

body.dark-mode table tbody tr:hover {
    background: var(--bg-light);
}

body.dark-mode .search-box {
    background: var(--bg-light);
    border-color: var(--border-color);
}

body.dark-mode .search-box input {
    color: var(--text-heading);
}

body.dark-mode .search-box input::placeholder {
    color: var(--text-muted);
}

body.dark-mode .form-control {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-heading);
}

body.dark-mode .form-control:focus {
    border-color: var(--primary);
}

body.dark-mode .modal {
    background: var(--bg-white);
}

body.dark-mode .modal-header {
    background: var(--bg-light);
    border-bottom-color: var(--border-color);
}

body.dark-mode .modal-footer {
    border-top-color: var(--border-color);
}

body.dark-mode .user-dropdown-menu,
body.dark-mode .notification-panel {
    background: var(--bg-white);
    border-color: var(--border-color);
}

body.dark-mode .dropdown-item:hover {
    background: var(--bg-light);
}

body.dark-mode .dropdown-user-info {
    background: var(--bg-light);
}

body.dark-mode .alert {
    background: var(--bg-light);
    border-color: var(--border-color);
}

body.dark-mode .nav-item:hover,
body.dark-mode .nav-subitem:hover {
    background: rgba(91, 164, 230, 0.1);
}

body.dark-mode .nav-item.active,
body.dark-mode .nav-subitem.active {
    background: rgba(91, 164, 230, 0.15);
}

body.dark-mode .filter-bar {
    background: var(--bg-white);
    border-color: var(--border-color);
}

body.dark-mode .filter-select {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-heading);
}

body.dark-mode .pagination-btn {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-body);
}

body.dark-mode .pagination-btn:hover:not(:disabled) {
    background: var(--primary-lighter);
}

body.dark-mode .badge {
    opacity: 0.9;
}

body.dark-mode .btn-secondary {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-heading);
}

body.dark-mode .btn-secondary:hover {
    background: var(--border-color);
}

body.dark-mode .notification-header {
    background: var(--bg-light);
    border-bottom-color: var(--border-color);
}

body.dark-mode .notification-item {
    border-bottom-color: var(--border-color);
}

body.dark-mode .notification-footer {
    background: var(--bg-light);
    border-top-color: var(--border-color);
}

body.dark-mode .brand-name {
    color: var(--text-heading);
}

body.dark-mode kbd {
    background: var(--bg-light);
    color: var(--text-muted);
    border-color: var(--border-color);
}

body.dark-mode .stat-icon {
    opacity: 0.9;
}

body.dark-mode .empty-state-icon {
    color: var(--text-muted);
}

body.dark-mode .cell-sub {
    color: var(--text-muted);
}

body.dark-mode ::selection {
    background: var(--primary);
    color: white;
}
