/* ============================================================
   EduSystem - Neumorphism Design System
   ============================================================
   TABLE OF CONTENTS:
   
   1.  Variables & Base .............. :root, body, scrollbar
   2.  Sidebar ....................... navigation, submenus, labels
   3.  Main Content ................. wrapper, content area
   4.  Top Navbar ................... header bar, search, user menu
   5.  Footer ....................... sticky footer
   6.  Page Header / Breadcrumb ..... title, subtitle, actions
   7.  Cards ........................ stat cards, neo cards
   8.  Tables ....................... data tables, striped rows
   9.  Badges ....................... status pills, counters
   10. Buttons ...................... primary, outline, loading states
   11. Forms ........................ inputs, selects, checkboxes
   12. Filters Bar .................. search & filter sections
   13. Auth Pages ................... login, forgot password
   14. Quick Actions ................ grid actions
   15. Activity Timeline ............ event timeline
   16. Chart Containers ............. chart wrappers
   17. Alerts ....................... notifications, warnings
   18. Modal ........................ dialog overlays
   19. Dropdown ..................... context menus
   20. Pagination ................... page navigation
   21. Loading Overlay .............. spinners
   22. Animations ................... keyframes, transitions
   23. Toastr / SweetAlert .......... notification overrides
   24. Utility ...................... helpers, spacers
   25. Enhanced Page Components ..... headers, filters, tables, forms
   26. Empty State .................. no-data placeholders
   27. Settings Page ................ admin settings layout
   28. Responsive ................... tablet, mobile breakpoints
   29. Dark Mode .................... [data-theme="dark"]
   30. Color Schemes ................ blue, emerald, rose, amber, etc.
   31. Neo Skins .................... sand, ocean, lavender, mint, etc.
   32. Report & Print ............... report cards, print styles
   33. Typography ................... headings, text utilities
   34. Dashboard Components ......... stat cards, charts, widgets
   35. Profile / Detail Cards ....... student/staff profiles
   36. Roles & Permissions UI ....... permission matrix
   37. Animations & Effects ......... hover, focus, transitions
   38. Auto-Enhance ................. :has() based consistency
   39. Enhanced Form Elements ....... global form polish
   40. Tab Panels ................... nav-tabs neumorphic
   41. Breadcrumbs .................. neumorphic breadcrumbs
   42. Status Indicators ............ labels, badges, dots
   43. Page Spacing ................. content margins
   ============================================================ */

/* ---- CSS Variables (Neumorphism) ---- */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #e8e9ed;
    --sidebar-hover: rgba(0,0,0,0.06);
    --sidebar-active: rgba(99,102,241,0.10);
    --sidebar-active-border: #6366f1;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --info: #06b6d4;
    --info-light: #22d3ee;
    --body-bg: #dfe3e8;
    --card-bg: #ffffff;
    --text-primary: #1a365d;
    --text-secondary: #2d4a7a;
    --text-muted: #5a80a8;
    --border-color: rgba(0,0,0,0.12);
    /* Gradient presets — top-to-bottom for skeuomorphic 3D feel */
    --gradient-primary: linear-gradient(to bottom, #7577f5, #5558e8);
    --gradient-success: linear-gradient(to bottom, #22d394, #0ea573);
    --gradient-danger: linear-gradient(to bottom, #f56565, #e03131);
    --gradient-warning: linear-gradient(to bottom, #fbbf24, #e8a307);
    --gradient-info: linear-gradient(to bottom, #22d3ee, #0897af);
    --gradient-dark: linear-gradient(to bottom, #334155, #1e293b);
    --gradient-accent: linear-gradient(to bottom, #7577f5, #9b8bfa, #7577f5);
    /* Skeuomorphic shadows — realistic downward drop shadows */
    --neo-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    --neo-shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --neo-shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
    --neo-shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --neo-inset: inset 0 2px 4px rgba(0,0,0,0.10), inset 0 1px 2px rgba(0,0,0,0.06);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 1px rgba(0,0,0,0.04);
    /* Glow shadows for interactive elements */
    --glow-primary: 0 4px 12px rgba(99,102,241,0.20);
    --glow-success: 0 4px 12px rgba(16,185,129,0.20);
    --glow-danger: 0 4px 12px rgba(239,68,68,0.20);
    --glow-warning: 0 4px 12px rgba(245,158,11,0.20);
    /* Legacy compat */
    --shadow-sm: var(--neo-shadow-sm);
    --shadow: var(--neo-shadow);
    --shadow-md: var(--neo-shadow-md);
    --shadow-lg: var(--neo-shadow-lg);
    --radius: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Base ---- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.wrapper {
    width: 100%;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
}

a { color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); text-decoration: none; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b8c4d4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    transition: min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

#sidebar .sidebar-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh; /* Modern browsers - respects mobile chrome/address bar */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Collapsed -> mini sidebar (icons only) */
#sidebar.collapsed {
    min-width: 70px;
    max-width: 70px;
}
#sidebar.collapsed .sidebar-header h5 span,
#sidebar.collapsed .sidebar-header small {
    display: none;
}
#sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
    text-align: center;
}
#sidebar.collapsed .sidebar-user-widget {
    padding: 0.5rem;
    margin: 0.25rem;
    justify-content: center;
}
#sidebar.collapsed .sidebar-user-widget .user-info {
    display: none;
}
#sidebar.collapsed .sidebar-user-widget .d-flex {
    justify-content: center;
}
#sidebar.collapsed .sidebar-menu .nav-item {
    margin: 2px 4px;
}
#sidebar.collapsed .sidebar-menu > .nav-item > .nav-link {
    padding: 0.65rem 0;
    justify-content: center;
    border-left: none;
    border-radius: 10px;
    font-size: 0;
}
#sidebar.collapsed .sidebar-menu > .nav-item > .nav-link i {
    margin: 0 !important;
    font-size: 1.05rem;
    opacity: 0.75;
}
#sidebar.collapsed .sidebar-menu > .nav-item > .nav-link[data-bs-toggle="collapse"]::after {
    display: none;
}
#sidebar.collapsed .sidebar-section-label {
    font-size: 0;
    padding: 0.5rem 0;
    text-align: center;
}
#sidebar.collapsed .sidebar-section-label::before {
    left: 0.75rem;
    right: 0.75rem;
}
#sidebar.collapsed .sidebar-section-label i {
    font-size: 0.55rem;
    opacity: 0.4;
}
/* Hide submenus in collapsed mode */
#sidebar.collapsed .sidebar-menu .collapse,
#sidebar.collapsed .sidebar-menu .collapsing {
    display: none !important;
}
/* Tooltip for collapsed items — on the nav-item, not on the link */
#sidebar.collapsed .sidebar-menu > .nav-item {
    position: relative;
}
#sidebar.collapsed .sidebar-menu > .nav-item:hover::after {
    content: attr(data-title);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: var(--card-bg);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
    z-index: 1100;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-weight: 500;
}

/* Sidebar Header */
#sidebar .sidebar-header {
    padding: 1.15rem 1.25rem;
    border-bottom: none;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(99,102,241,0.05), transparent);
    position: relative;
}
#sidebar .sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.15), transparent);
}

#sidebar .sidebar-header h5 {
    font-weight: 800;
    letter-spacing: 0.3px;
    font-size: 1.05rem;
    color: var(--text-primary);
}

#sidebar .sidebar-header h5 i {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#sidebar .sidebar-header small {
    font-size: 0.7rem;
    opacity: 0.6;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* Sidebar Menu */
#sidebar .sidebar-menu {
    padding: 0.75rem 0;
    flex: 1 1 0;
    min-height: 0;
    flex-wrap: nowrap !important; /* Override Bootstrap .nav flex-wrap:wrap — prevents horizontal wrapping */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
#sidebar .sidebar-menu:hover {
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}
/* Webkit scrollbar for sidebar menu */
#sidebar .sidebar-menu::-webkit-scrollbar { width: 4px; }
#sidebar .sidebar-menu::-webkit-scrollbar-track { background: transparent; }
#sidebar .sidebar-menu::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; transition: background 0.3s; }
#sidebar .sidebar-menu:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
#sidebar .sidebar-menu::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* Fade edges for scroll indication */
#sidebar .sidebar-menu {
    mask-image: linear-gradient(to bottom, transparent 0px, black 8px, black calc(100% - 8px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 8px, black calc(100% - 8px), transparent 100%);
}

#sidebar .sidebar-menu .nav-item {
    margin: 2px 10px;
}

#sidebar .sidebar-menu > .nav-item > .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 12px;
    border-left: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    position: relative;
}

#sidebar .sidebar-menu > .nav-item > .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 0.88rem;
    opacity: 0.65;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

#sidebar .sidebar-menu > .nav-item > .nav-link:hover {
    background: rgba(0,0,0,0.04);
    box-shadow: var(--neo-shadow-sm);
    color: var(--text-primary);
    padding-left: 1.15rem;
}

#sidebar .sidebar-menu > .nav-item > .nav-link:hover i {
    opacity: 1;
    color: var(--primary);
}

#sidebar .sidebar-menu > .nav-item > .nav-link.active,
#sidebar .sidebar-menu .nav-link.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(129,140,248,0.06));
    border-left-color: var(--sidebar-active-border);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--neo-inset-sm);
}

#sidebar .sidebar-menu > .nav-item > .nav-link.active i {
    opacity: 1;
    color: var(--primary);
}

/* Submenu */
#sidebar .sidebar-menu .collapse,
#sidebar .sidebar-menu .collapsing {
    transition: height 0.3s ease;
}
#sidebar .sidebar-menu .collapse .nav-link,
#sidebar .sidebar-menu .collapsing .nav-link {
    font-size: 0.82rem;
    padding: 0.38rem 1.25rem 0.38rem 2.5rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border-radius: 10px;
    position: relative;
}
/* Submenu dot indicator */
#sidebar .sidebar-menu .collapse .nav-link::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.4;
    transition: all 0.2s ease;
}

#sidebar .sidebar-menu .collapse .nav-link:hover,
#sidebar .sidebar-menu .collapsing .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.25);
    padding-left: 2.75rem;
}
#sidebar .sidebar-menu .collapse .nav-link:hover::before {
    background: var(--primary);
    opacity: 1;
    width: 6px;
    height: 6px;
}

#sidebar .sidebar-menu .collapse .nav-link.active {
    color: var(--primary);
    font-weight: 600;
}
#sidebar .sidebar-menu .collapse .nav-link.active::before {
    background: var(--primary);
    opacity: 1;
    width: 6px;
    height: 6px;
}

/* Override Bootstrap text-white inside sidebar to use sidebar scheme */
#sidebar.text-white,
#sidebar .text-white,
#sidebar .nav-link.text-white {
    color: var(--text-primary) !important;
}
#sidebar .text-white-50,
#sidebar .nav-link.text-white-50 {
    color: var(--text-muted) !important;
}

/* Submenu arrow indicator */
#sidebar .sidebar-menu > .nav-item > .nav-link[data-bs-toggle="collapse"]::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

#sidebar .sidebar-menu > .nav-item > .nav-link[data-bs-toggle="collapse"]:hover::after {
    opacity: 0.8;
    background: rgba(99,102,241,0.08);
}

#sidebar .sidebar-menu > .nav-item > .nav-link[data-bs-toggle="collapse"][aria-expanded="true"]::after {
    transform: rotate(90deg);
    opacity: 1;
    color: var(--primary);
}

/* Sidebar Scrollbar */
#sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
#sidebar::-webkit-scrollbar-track { background: transparent; }

/* Sidebar User Widget */
.sidebar-user-widget {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0.75rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--border-color);
    border-bottom: none;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: var(--neo-shadow-sm);
}
.sidebar-user-widget:hover {
    box-shadow: var(--neo-shadow);
    border-color: rgba(99,102,241,0.15);
}

.sidebar-user-widget .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.sidebar-user-widget .user-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-widget .user-info {
    margin-left: 0.6rem;
    min-width: 0;
}

.sidebar-user-widget .user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-user-widget .user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Sidebar Section Labels */
.sidebar-section-label {
    list-style: none;
    padding: 1.1rem 1.25rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: none;
    margin-top: 0.25rem;
    margin-bottom: 2px;
    position: relative;
}
.sidebar-section-label::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,0,0,0.06), transparent);
}

/* Sidebar Divider */
.sidebar-divider {
    list-style: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin: 0.5rem 1.25rem;
}

/* Submenu Divider */
#sidebar .sidebar-menu .collapse .nav-divider,
#sidebar .sidebar-menu .collapsing .nav-divider {
    list-style: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin: 0.35rem 1.25rem;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-content {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--body-bg);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: auto;
    flex: 1;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.navbar {
    padding: 0.5rem 1.5rem;
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--neo-shadow-sm);
    z-index: 100;
    margin: 0.5rem 1rem;
    border-radius: var(--radius);
}

.navbar #sidebarToggle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 12px;
    transition: var(--transition);
    box-shadow: var(--neo-shadow-sm);
    background: var(--card-bg);
}

.navbar #sidebarToggle:hover {
    box-shadow: var(--neo-inset-sm);
    color: var(--primary);
}

/* Notification Bell */
.notification-bell {
    position: relative;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 12px;
    box-shadow: var(--neo-shadow-sm);
    background: var(--card-bg);
}

.notification-bell:hover {
    color: var(--primary);
    box-shadow: var(--neo-inset-sm);
}

.notification-bell .badge-count {
    position: absolute;
    top: 2px;
    right: 0;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

.notification-dropdown {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-lg); border: 1px solid var(--border-color);
    background: var(--card-bg);
}
.notification-dropdown .dropdown-header {
    background: transparent;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.notification-dropdown .notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition);
    display: block;
    color: var(--text-primary);
}

.notification-dropdown .notification-item:hover {
    background: rgba(0,0,0,0.04);
}

.notification-dropdown .notification-item.unread {
    background: rgba(99,102,241,0.06);
    border-left: 3px solid var(--primary);
}

.notification-dropdown .notification-item .notif-title {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.notification-dropdown .notification-item .notif-message {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 3px;
}

.notification-dropdown .notification-item .notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.main-footer {
    padding: 0.75rem 1.5rem;
    margin-top: auto;
    border-top: none;
    background: var(--body-bg);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.main-footer .footer-version {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ============================================================
   PAGE HEADER / BREADCRUMB
   ============================================================ */
.page-header {
    position: relative;
    z-index: 2;
    margin-bottom: 1.75rem;
    padding: 0.75rem 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-out both;
}

.page-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.page-header h3,
.page-header h4,
.page-title {
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0;
    font-size: 1.3rem;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--gradient-primary);
    box-shadow: var(--glow-primary);
    font-size: 0.92rem;
    color: #fff;
    flex-shrink: 0;
    transition: var(--transition-bounce);
}
.page-header:hover .page-icon {
    transform: scale(1.05) rotate(-3deg);
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
    transition: box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.card:hover {
    box-shadow: var(--neo-shadow-md);
    transform: translateY(-3px);
}

.card:hover::before {
    opacity: 0.7;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.1rem 1.5rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5, .card-header h6 { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.card-header h5 i, .card-header h6 i { color: var(--primary); margin-right: 0.5rem; }

.card-body { padding: 1.5rem; }

.card-footer {
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---- Stat Cards (Neomorphic) ---- */
.stat-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
}

.stat-card:hover {
    box-shadow: var(--neo-shadow-lg);
    transform: translateY(-4px);
}

.stat-card .card-body {
    padding: 1.75rem 2rem;
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 2.15rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.5px;
    animation: countUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.stat-card .stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--neo-inset-sm);
    background: var(--card-bg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: var(--neo-shadow-sm);
}

/* Stat card color variants */
.stat-card.stat-primary .stat-icon { color: var(--primary); }
.stat-card.stat-success .stat-icon { color: var(--success); }
.stat-card.stat-warning .stat-icon { color: var(--warning); }
.stat-card.stat-danger .stat-icon  { color: var(--danger); }
.stat-card.stat-info .stat-icon    { color: var(--info); }

/* Legacy border-left support */
.border-left-primary { border-left: 4px solid var(--primary) !important; }
.border-left-success { border-left: 4px solid var(--success) !important; }
.border-left-warning { border-left: 4px solid var(--warning) !important; }
.border-left-danger  { border-left: 4px solid var(--danger) !important; }
.border-left-info    { border-left: 4px solid var(--info) !important; }

/* ============================================================
   TABLES
   ============================================================ */
.table { margin-bottom: 0; border-collapse: separate; border-spacing: 0; }

.table thead th {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted); border-top: none;
    border-bottom: 2px solid rgba(99,102,241,0.08); padding: 0.85rem 1rem;
    white-space: nowrap; background: rgba(99,102,241,0.02);
    position: sticky; top: 0; z-index: 1;
}

.table tbody td {
    vertical-align: middle; font-size: 0.85rem; padding: 0.8rem 1rem;
    color: var(--text-primary); border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: background 0.2s ease;
}

.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: rgba(99,102,241,0.04); }
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(163,177,198,0.04); }

/* DataTables overrides */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: none; border-radius: 12px; padding: 0.35rem 0.75rem;
    font-size: 0.85rem; box-shadow: var(--neo-inset-sm);
    background: var(--card-bg); color: var(--text-primary);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary); box-shadow: var(--neo-inset-sm), 0 0 0 3px rgba(99,102,241,0.12); outline: none;
}

.dataTables_wrapper .dataTables_info { font-size: 0.8rem; color: var(--text-secondary); }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 12px !important; margin: 0 2px; border: none !important;
    box-shadow: var(--neo-shadow-sm); background: var(--card-bg) !important;
    color: var(--text-primary) !important; transition: var(--transition);
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    box-shadow: var(--neo-inset-sm) !important; background: var(--body-bg) !important;
    color: var(--primary) !important; border-color: transparent !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important; color: #fff !important;
    box-shadow: 0 2px 4px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2) !important; border-color: transparent !important;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-weight: 600; padding: 0.4em 0.85em; font-size: 0.72rem;
    border-radius: 50px; letter-spacing: 0.3px;
    border: none; transition: var(--transition);
}

/* Soft translucent badges (neumorphic style) — override Bootstrap solid bg-* on badges */
.badge.bg-primary   { background: rgba(99,102,241,0.15) !important; color: var(--primary) !important; }
.badge.bg-success   { background: rgba(16,185,129,0.15) !important; color: var(--success) !important; }
.badge.bg-danger    { background: rgba(239,68,68,0.15) !important; color: var(--danger) !important; }
.badge.bg-warning   { background: rgba(245,158,11,0.18) !important; color: #b45309 !important; }
.badge.bg-info      { background: rgba(6,182,212,0.15) !important; color: #0e7490 !important; }
.badge.bg-secondary { background: rgba(100,116,139,0.15) !important; color: var(--secondary) !important; }
.badge.bg-dark      { background: rgba(45,55,72,0.15) !important; color: var(--text-primary) !important; }
.badge.bg-light     { background: rgba(248,250,252,0.8) !important; color: var(--text-secondary) !important; }

/* Legacy badge-* classes (backward compat) */
.badge-primary   { background: rgba(99,102,241,0.15); color: var(--primary); }
.badge-success   { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-danger    { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-warning   { background: rgba(245,158,11,0.18); color: #b45309; }
.badge-info      { background: rgba(6,182,212,0.15); color: #0e7490; }
.badge-secondary { background: rgba(100,116,139,0.15); color: var(--secondary); }
.badge-dark      { background: rgba(45,55,72,0.15); color: var(--text-primary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-weight: 600; font-size: 0.85rem; padding: 0.5rem 1.25rem;
    border-radius: 12px; transition: box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, color 0.25s ease; letter-spacing: 0.3px;
    box-shadow: var(--neo-shadow-sm); background: var(--card-bg); border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn:focus { box-shadow: var(--neo-shadow-sm), 0 0 0 3px rgba(99,102,241,0.15); }
.btn:active { box-shadow: var(--neo-inset-sm) !important; transform: scale(0.96) translateY(0) !important; }

.btn-primary {
    background: var(--gradient-primary); color: #fff;
    box-shadow: 0 2px 4px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 1px solid rgba(79,70,229,0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff;
    box-shadow: 0 4px 8px rgba(99,102,241,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}
.btn-primary:active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2) !important;
}

.btn-success {
    background: var(--gradient-success); border-color: transparent; color: #fff;
    box-shadow: 0 2px 4px rgba(16,185,129,0.25), inset 0 1px 0 rgba(255,255,255,0.2); border: 1px solid rgba(5,150,105,0.4);
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669, #10b981); color: #fff;
    box-shadow: 0 4px 8px rgba(16,185,129,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--gradient-danger); border-color: transparent; color: #fff;
    box-shadow: 0 2px 4px rgba(239,68,68,0.25), inset 0 1px 0 rgba(255,255,255,0.2); border: 1px solid rgba(220,38,38,0.4);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff;
    box-shadow: 0 4px 8px rgba(239,68,68,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--gradient-warning); border-color: transparent; color: #fff;
    box-shadow: 0 2px 4px rgba(245,158,11,0.25), inset 0 1px 0 rgba(255,255,255,0.2); border: 1px solid rgba(217,119,6,0.4);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff;
    box-shadow: 0 4px 8px rgba(245,158,11,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.btn-info {
    background: var(--gradient-info); border-color: transparent; color: #fff;
    box-shadow: 0 2px 4px rgba(6,182,212,0.25), inset 0 1px 0 rgba(255,255,255,0.2); border: 1px solid rgba(8,145,178,0.4);
}
.btn-info:hover {
    background: linear-gradient(135deg, #0891b2, #06b6d4); color: #fff;
    box-shadow: 0 4px 8px rgba(6,182,212,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.btn-outline-primary { color: var(--primary); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 2px 4px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2); transform: translateY(-1px); }

.btn-outline-secondary { color: var(--text-secondary); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-outline-secondary:hover { box-shadow: var(--neo-inset-sm); color: var(--text-primary); }

.btn-outline-success { color: var(--success); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-outline-success:hover { background: var(--success); color: #fff; border-color: transparent; box-shadow: 0 2px 4px rgba(16,185,129,0.25), inset 0 1px 0 rgba(255,255,255,0.2); transform: translateY(-1px); }

.btn-outline-danger { color: var(--danger); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; border-color: transparent; box-shadow: 0 2px 4px rgba(239,68,68,0.25), inset 0 1px 0 rgba(255,255,255,0.2); transform: translateY(-1px); }

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.78rem; border-radius: 8px; }

.btn-action { padding: 0.25rem 0.6rem; font-size: 0.75rem; margin: 0 2px; border-radius: 8px; }

/* Action button semantic colors */
.btn-action-view  { color: var(--info); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-action-view:hover  { box-shadow: var(--neo-inset-sm); color: #0891b2; }
.btn-action-edit  { color: var(--primary); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-action-edit:hover  { box-shadow: var(--neo-inset-sm); color: var(--primary-dark); }
.btn-action-delete { color: var(--danger); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-action-delete:hover { box-shadow: var(--neo-inset-sm); color: #dc2626; }
.btn-action-print  { color: var(--secondary); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); }
.btn-action-print:hover  { box-shadow: var(--neo-inset-sm); color: #475569; }

/* ---- Button Loading States ---- */
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { position: relative; pointer-events: none; opacity: 0.75; }
.btn-loading .btn-text { visibility: hidden; }
.btn-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 16px; height: 16px; margin: -8px 0 0 -8px;
    border: 2px solid transparent; border-top-color: currentColor; border-right-color: currentColor;
    border-radius: 50%; animation: btn-spin 0.5s linear infinite;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-label,
.form-group label {
    font-weight: 600; font-size: 0.78rem; color: var(--text-secondary);
    margin-bottom: 0.4rem; letter-spacing: 0.2px;
    display: block;
}
.form-label .text-danger { font-size: 0.9em; }

.form-control {
    border: 1px solid var(--border-color); border-radius: 12px; padding: 0.6rem 0.9rem;
    font-size: 0.85rem; color: var(--text-primary);
    transition: box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
    background: var(--card-bg); box-shadow: var(--neo-inset-sm);
}

.form-control:focus {
    background: var(--card-bg); color: var(--text-primary);
    border-color: var(--primary); box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.15); outline: none;
}

.form-control::placeholder { color: var(--text-muted); }

/* ============================================================
   UNIFIED DROPDOWN SELECT STYLING
   Matches form-control (text input) neumorphic design
   ============================================================ */
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 0.9rem 0.6rem 2.2rem;
    min-height: 42px;
    box-shadow: var(--neo-inset-sm);
    background-color: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236366f1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.85rem center;
    background-size: 14px 12px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* Standalone selects (not inside input-group) */
.form-card .form-select:not(.input-group .form-select),
.form-card-body .form-select:not(.input-group .form-select),
.form-horizontal .form-select:not(.input-group .form-select),
.form-group .form-select:not(.input-group .form-select) {
    padding: 0.6rem 0.9rem 0.6rem 2.2rem;
    background-position: left 0.85rem center;
}

/* Selects inside input-group */
.input-group .form-select {
    padding: 0.6rem 0.9rem 0.6rem 2.2rem;
    background-position: left 0.75rem center;
    border-radius: 0 12px 12px 0;
}
[dir="rtl"] .input-group .form-select {
    border-radius: 12px 0 0 12px;
}

/* Table-inline selects (DataTables length, fee items) keep compact */
table .form-select,
.dataTables_length .form-select {
    min-height: 34px;
    padding: 0.35rem 0.6rem 0.35rem 2rem;
    font-size: 0.8rem;
    background-position: left 0.6rem center;
    background-size: 12px 10px;
    border-radius: 10px;
}

.form-select:focus {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.15);
    outline: none;
}
.form-select:hover:not(:focus) {
    box-shadow: var(--neo-inset-sm), 0 0 0 2px rgba(99,102,241,0.08);
}

/* Enhanced native select options */
.form-select option {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
.form-select option:checked {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    font-weight: 600;
}

/* Select2 Bootstrap 5 theme overrides */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid rgba(0,0,0,0.08);
    border-right: 3px solid var(--primary);
    border-radius: var(--radius);
    min-height: 42px; font-size: 0.85rem;
    transition: all 0.3s ease; box-shadow: var(--neo-inset-sm); background: var(--card-bg);
    cursor: pointer;
}
.select2-container--bootstrap-5 .select2-selection--single {
    padding: 0.5rem 0.75rem; height: auto; min-height: 42px; display: flex; align-items: center;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { padding: 0; line-height: 1.5; color: var(--text-primary); font-weight: 500; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder { color: var(--text-muted); font-weight: 400; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 100%; top: 0; right: auto; left: 10px; display: flex; align-items: center;
    color: var(--primary);
}
/* Input-group select2 removes accent */
.input-group .select2-container--bootstrap-5 .select2-selection {
    border-right: 1px solid rgba(0,0,0,0.08);
    border-radius: 0 var(--radius) var(--radius) 0;
}
[dir="rtl"] .input-group .select2-container--bootstrap-5 .select2-selection {
    border-right: none;
    border-left: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius) 0 0 var(--radius);
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--primary); box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.12);
}
.select2-container--bootstrap-5 .select2-selection:hover {
    border-color: rgba(99,102,241,0.2);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.06);
    margin-top: 4px; overflow: hidden; background: var(--card-bg);
}
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 0.55rem 0.85rem; font-size: 0.85rem;
    outline: none; box-shadow: var(--neo-inset-sm); background: var(--card-bg);
    margin: 0.5rem; width: calc(100% - 1rem);
}
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary); box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.12);
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 0.55rem 1rem; font-size: 0.85rem; transition: all 0.15s ease;
    border-radius: 0; font-weight: 500;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 85%, #000)) !important;
    color: #fff;
}
.select2-container--bootstrap-5 .select2-results__option--selected {
    background: rgba(99,102,241,0.08); color: var(--primary); font-weight: 600;
    position: relative;
}
.select2-container--bootstrap-5 .select2-results__option--selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.7rem;
    position: absolute;
    left: 1rem;
    color: var(--primary);
}

.select2-container--bootstrap-5 .select2-selection--multiple { min-height: 38px; padding: 2px 6px; }
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background: rgba(99,102,241,0.12); border: none; color: var(--primary);
    border-radius: 6px; padding: 2px 8px; font-size: 0.8rem; margin: 2px;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove { color: var(--primary); margin-right: 4px; }
.select2-container--bootstrap-5 .select2-selection__clear { font-size: 1.1rem; color: var(--text-muted); margin-right: 4px; }
.select2-container--bootstrap-5 .select2-selection__clear:hover { color: var(--danger); }

.input-group .select2-container--bootstrap-5 { flex: 1 1 auto; width: 1% !important; }
.is-invalid + .select2-container--bootstrap-5 .select2-selection { box-shadow: var(--neo-inset-sm), 0 0 0 2px rgba(239,68,68,0.2); }
.is-valid + .select2-container--bootstrap-5 .select2-selection { box-shadow: var(--neo-inset-sm), 0 0 0 2px rgba(16,185,129,0.2); }
.select2-sm + .select2-container--bootstrap-5 .select2-selection,
.form-control-sm + .select2-container--bootstrap-5 .select2-selection { min-height: 32px; font-size: 0.8rem; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
    background: var(--card-bg); padding: 1rem 1.25rem; border-radius: var(--radius);
    margin-bottom: 1.25rem; border: none; box-shadow: var(--neo-shadow);
}

/* ============================================================
   AUTH PAGES - Educational Theme
   ============================================================ */

/* Language switcher - pill button */
.auth-lang-switcher {
    position: fixed; top: 20px; right: 20px; z-index: 100;
}
.auth-lang-switcher a {
    display: inline-flex; align-items: center; padding: 0.45rem 1rem;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99,102,241,0.15); border-radius: 50px;
    color: #4f46e5; font-size: 0.82rem; font-weight: 600; text-decoration: none;
    transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(99,102,241,0.1);
}
.auth-lang-switcher a:hover {
    background: #fff; transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.2); color: #4f46e5; text-decoration: none;
}

.auth-wrapper {
    min-height: 100vh; display: flex; align-items: stretch;
    background: var(--body-bg); position: relative; overflow: hidden;
}

/* Brand panel - gradient with educational elements */
.auth-brand-panel {
    flex: 0 0 500px;
    background: linear-gradient(135deg, #312e81 0%, #4338ca 25%, #6366f1 50%, #818cf8 75%, #a78bfa 100%);
    background-size: 300% 300%;
    animation: authGradientShift 15s ease infinite;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 3rem; position: relative; overflow: hidden; color: #fff;
}

/* Subtle dot grid */
.auth-brand-panel::before {
    content: ''; position: absolute; top: -40%; left: -40%; width: 180%; height: 180%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 28px 28px; animation: authBgMove 40s linear infinite;
}

@keyframes authGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes authBgMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(28px, 28px); }
}

.auth-brand-content { position: relative; z-index: 1; text-align: center; max-width: 360px; }

/* Logo with glow ring */
.auth-brand-logo {
    width: 100px; height: 100px; background: rgba(255,255,255,0.15); border-radius: 30px;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.75rem;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255,255,255,0.25);
    position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.auth-brand-logo::before {
    content: ''; position: absolute; inset: -5px; border-radius: 32px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(167,139,250,0.3), rgba(255,255,255,0.4));
    background-size: 200% 200%; animation: authLogoGlow 4s ease infinite;
    z-index: -1; opacity: 0.6;
}
@keyframes authLogoGlow {
    0%, 100% { background-position: 0% 50%; opacity: 0.4; }
    50% { background-position: 100% 50%; opacity: 0.7; }
}
.auth-brand-logo i {
    font-size: 2.8rem; color: #fff;
    filter: drop-shadow(0 2px 8px rgba(255,255,255,0.3));
}

.auth-brand-content h2 {
    font-weight: 800; font-size: 2.2rem; letter-spacing: 2px; margin-bottom: 0.5rem; color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.auth-brand-content .brand-tagline {
    font-size: 1rem; color: rgba(255,255,255,0.75); font-weight: 400;
    margin-bottom: 2.5rem; line-height: 1.7;
}

.auth-features { list-style: none; padding: 0; margin: 0; text-align: left; }
.auth-features li {
    display: flex; align-items: center; padding: 0.7rem 0;
    color: rgba(255,255,255,0.9); font-size: 0.92rem; font-weight: 500;
}
.auth-features li .feature-icon {
    width: 42px; height: 42px; border-radius: 14px;
    background: rgba(255,255,255,0.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    margin-right: 14px; flex-shrink: 0;
    transition: all 0.3s ease;
}
.auth-features li:hover .feature-icon {
    background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.3);
    transform: scale(1.08) rotate(-3deg);
}
.auth-features li .feature-icon i { font-size: 0.9rem; color: #fff; }

/* Floating educational icons */
.auth-float-icon {
    position: absolute; color: #fff; pointer-events: none; z-index: 0;
    opacity: 0.12; line-height: 1;
}
.auth-float-icon:nth-child(1) {
    top: 12%; left: 8%; font-size: 2.2rem;
    animation: authIconFloat 6s ease-in-out infinite;
}
.auth-float-icon:nth-child(2) {
    top: 22%; right: 12%; font-size: 1.8rem;
    animation: authIconFloat2 7s ease-in-out 1s infinite;
}
.auth-float-icon:nth-child(3) {
    bottom: 30%; left: 15%; font-size: 1.5rem;
    animation: authIconFloat 8s ease-in-out 2s infinite;
}
.auth-float-icon:nth-child(4) {
    top: 55%; right: 8%; font-size: 2rem;
    animation: authIconFloat2 6.5s ease-in-out 3s infinite;
}
.auth-float-icon:nth-child(5) {
    bottom: 15%; left: 25%; font-size: 1.6rem;
    animation: authIconFloat 7.5s ease-in-out 0.5s infinite;
}
.auth-float-icon:nth-child(6) {
    bottom: 45%; right: 20%; font-size: 1.4rem;
    animation: authIconFloat2 9s ease-in-out 2.5s infinite;
}

@keyframes authIconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}
@keyframes authIconFloat2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(8px, -12px) rotate(-4deg); }
    66% { transform: translate(-6px, -8px) rotate(3deg); }
}

/* Decorative background shapes */
.auth-brand-shape {
    position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
    background: rgba(255,255,255,0.06);
}
.auth-brand-shape-1 {
    width: 280px; height: 280px; top: -80px; right: -80px;
    opacity: 0.6; animation: authShapePulse 8s ease-in-out infinite;
}
.auth-brand-shape-2 {
    width: 180px; height: 180px; bottom: -50px; left: -50px;
    opacity: 0.5; animation: authShapePulse 10s ease-in-out 2s infinite;
}
.auth-brand-shape-3 {
    width: 100px; height: 100px; top: 40%; left: -30px;
    border-radius: 24px; opacity: 0.4;
    animation: authShapePulse 12s ease-in-out 4s infinite;
}

@keyframes authShapePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Form panel - light & clean */
.auth-form-panel {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 3rem 2rem; position: relative;
    background: var(--body-bg);
}
.auth-form-panel::before {
    content: ''; position: absolute; top: -250px; right: -200px; width: 500px; height: 500px;
    border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.auth-form-panel::after {
    content: ''; position: absolute; bottom: -200px; left: -150px; width: 450px; height: 450px;
    border-radius: 50%; background: radial-gradient(circle, rgba(167,139,250,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.auth-card { width: 100%; max-width: 440px; position: relative; z-index: 1; }

/* Card with top accent bar */
.auth-card-inner {
    background: var(--body-bg); border-radius: 24px; padding: 2.5rem;
    border: none;
    box-shadow: var(--neo-shadow-lg);
    position: relative; overflow: hidden;
}
.auth-card-inner::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #4f46e5, #6366f1, #818cf8, #a78bfa);
    background-size: 200% 100%; animation: authAccentShift 4s ease infinite;
}
@keyframes authAccentShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.auth-card .auth-header { text-align: center; margin-bottom: 2rem; }

/* Header icon */
.auth-header-icon {
    width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 1rem;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(99,102,241,0.3);
}
.auth-header-icon i { font-size: 1.3rem; color: #fff; }

.auth-card .auth-header h3 {
    font-weight: 700; font-size: 1.5rem; color: #1e293b; margin-bottom: 0.35rem;
}
.auth-card .auth-subtitle { color: #64748b; font-size: 0.88rem; margin-bottom: 0; }

/* Input fields */
.auth-input-group { position: relative; margin-bottom: 1.25rem; }
.auth-input-group label {
    display: block; font-size: 0.82rem; font-weight: 600; color: #374151; margin-bottom: 0.4rem;
}
.auth-input-wrapper { position: relative; }
.auth-input-wrapper .input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 0.9rem; transition: color 0.3s ease; z-index: 2;
}
.auth-input-wrapper input {
    width: 100%; padding: 0.8rem 0.9rem 0.8rem 2.6rem;
    border: none; border-radius: 14px;
    font-size: 0.9rem; background: var(--body-bg); color: var(--text-primary);
    transition: all 0.3s ease; outline: none;
    box-shadow: var(--neo-inset-sm);
}
.auth-input-wrapper input::placeholder { color: var(--text-muted); }
.auth-input-wrapper input:focus {
    border-color: transparent; background: var(--body-bg);
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.12);
}
.auth-input-wrapper input:focus ~ .input-icon,
.auth-input-wrapper input:focus + .input-icon { color: #6366f1; }
.auth-input-wrapper input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.auth-input-wrapper input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239,68,68,0.1);
}
.auth-input-wrapper .toggle-password {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none;
    border: none; color: #94a3b8; cursor: pointer; padding: 0; font-size: 0.9rem;
    transition: color 0.3s ease; z-index: 2;
}
.auth-input-wrapper .toggle-password:hover { color: #6366f1; }
.auth-input-error { font-size: 0.78rem; color: #ef4444; margin-top: 0.35rem; font-weight: 500; }

/* Remember me & forgot password */
.auth-actions {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem;
}
.auth-actions .custom-checkbox-label {
    display: flex; align-items: center; cursor: pointer;
    font-size: 0.85rem; color: #64748b; user-select: none;
}
.auth-actions .custom-checkbox-label input[type="checkbox"] {
    width: 17px; height: 17px; border-radius: 4px; margin-right: 8px;
    accent-color: #6366f1; cursor: pointer;
}
.auth-actions .forgot-link {
    font-size: 0.83rem; color: #6366f1; font-weight: 600; text-decoration: none;
}
.auth-actions .forgot-link:hover { color: #4f46e5; text-decoration: underline; }

/* Submit button - gradient with neumorphic shadow */
.auth-submit-btn {
    width: 100%; padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
    background-size: 200% 200%; background-position: 0% 50%;
    border: none; border-radius: 16px; color: #fff; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: all 0.4s ease; display: flex; align-items: center;
    justify-content: center; gap: 8px; position: relative; overflow: hidden;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
    letter-spacing: 0.3px;
}
.auth-submit-btn::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}
.auth-submit-btn:hover {
    background-position: 100% 50%;
    box-shadow: 0 6px 16px rgba(99,102,241,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}
.auth-submit-btn:hover::after { left: 100%; }
.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: var(--neo-inset);
}
.auth-submit-btn:disabled {
    opacity: 0.7; cursor: not-allowed; transform: none;
}
.auth-submit-btn i { font-size: 1rem; }

/* Divider */
.auth-divider {
    display: flex; align-items: center; margin: 1.5rem 0; color: #94a3b8; font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.auth-divider span { padding: 0 1rem; }

/* Footer */
.auth-footer { text-align: center; margin-top: 2rem; color: #94a3b8; font-size: 0.78rem; }
.auth-footer .auth-version {
    display: block; margin-top: 0.25rem; font-size: 0.72rem; color: #cbd5e1;
}

/* Auth page alerts */
.auth-card-inner .alert {
    border-radius: 12px; border: none; font-size: 0.85rem; font-weight: 500;
    box-shadow: none; margin-bottom: 1.25rem;
}
.auth-card-inner .alert-success {
    background: #ecfdf5; color: #065f46; border-left: 4px solid #10b981;
}
.auth-card-inner .alert-danger {
    background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444;
}
.auth-card-inner .alert-warning {
    background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b;
}
.auth-card-inner .alert-info {
    background: #ecfeff; color: #155e75; border-left: 4px solid #06b6d4;
}

/* Auth page links */
.auth-card-inner .forgot-link { color: #6366f1; }
.auth-card-inner .forgot-link:hover { color: #4f46e5; }

/* ─── AUTH RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .auth-brand-panel { flex: 0 0 auto; width: 100%; min-height: 220px; padding: 2rem; }
    .auth-wrapper { flex-direction: column; }
    .auth-brand-content h2 { font-size: 1.6rem; }
    .auth-brand-content .brand-tagline { margin-bottom: 1rem; }
    .auth-features { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
    .auth-features li { padding: 0.4rem 0; font-size: 0.82rem; }
    .auth-features li .feature-icon { width: 32px; height: 32px; border-radius: 10px; margin-right: 8px; }
    .auth-float-icon { font-size: 1.2rem !important; }
    .auth-brand-logo { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 1rem; }
    .auth-brand-logo i { font-size: 2rem; }
    .auth-lang-switcher { top: 12px; right: 12px; }
}
@media (max-width: 767.98px) {
    .auth-brand-panel { min-height: 180px; padding: 1.5rem; }
    .auth-features { display: none; }
    .auth-float-icon:nth-child(n+5) { display: none; }
    .auth-form-panel { padding: 1.5rem 1rem; }
    .auth-card-inner { padding: 2rem 1.5rem; }
}
@media (max-width: 575.98px) {
    .auth-brand-panel { min-height: 150px; padding: 1.25rem; }
    .auth-brand-content h2 { font-size: 1.3rem; letter-spacing: 1px; }
    .auth-brand-content .brand-tagline { font-size: 0.85rem; }
    .auth-brand-logo { width: 60px; height: 60px; margin-bottom: 0.75rem; }
    .auth-brand-logo i { font-size: 1.6rem; }
    .auth-card-inner { padding: 1.75rem 1.25rem; border-radius: 20px; }
    .auth-submit-btn { padding: 0.9rem 1rem; font-size: 0.9rem; min-height: 48px; }
    .auth-input-wrapper input { padding: 0.85rem 0.9rem 0.85rem 2.6rem; min-height: 48px; }
}

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions .quick-action-item {
    display: flex; align-items: center; padding: 0.75rem 1rem; border-radius: var(--radius);
    transition: var(--transition); color: var(--text-primary); text-decoration: none;
    border: 1px solid var(--border-color); box-shadow: var(--neo-shadow-sm); background: var(--card-bg); margin-bottom: 0.5rem;
}
.quick-actions .quick-action-item:hover { box-shadow: var(--neo-inset-sm); color: var(--primary); }
.quick-actions .quick-action-item i {
    width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; margin-right: 0.75rem; font-size: 0.85rem; box-shadow: var(--neo-inset-sm);
}

/* ============================================================
   ACTIVITY TIMELINE
   ============================================================ */
.activity-timeline { position: relative; padding-left: 1.5rem; }
.activity-timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,0.08); }
.activity-timeline .timeline-item { position: relative; padding-bottom: 1rem; padding-left: 1rem; }
.activity-timeline .timeline-item::before {
    content: ''; position: absolute; left: -1.5rem; top: 4px; width: 10px; height: 10px;
    border-radius: 50%; background: var(--primary); border: 2px solid var(--body-bg); z-index: 1;
    box-shadow: 0 0 0 2px var(--card-bg);
}
.activity-timeline .timeline-item .timeline-content { font-size: 0.82rem; color: var(--text-primary); }
.activity-timeline .timeline-item .timeline-time { font-size: 0.7rem; color: var(--text-muted); }

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container { position: relative; width: 100%; min-height: 250px; }
.chart-container canvas { width: 100% !important; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border: none; border-radius: var(--radius); font-size: 0.85rem; font-weight: 500; padding: 0.875rem 1.25rem; box-shadow: var(--neo-shadow-sm); }
.alert-success { background: rgba(16,185,129,0.1); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger  { background: rgba(239,68,68,0.1); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(245,158,11,0.1); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: rgba(6,182,212,0.1); color: #155e75; border-left: 4px solid var(--info); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-content {
    border: 1px solid var(--border-color); border-radius: 20px; box-shadow: var(--neo-shadow-lg); background: var(--card-bg);
    animation: neoScaleIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal-header { border-bottom: 1px solid rgba(0,0,0,0.06); padding: 1rem 1.5rem; }
.modal-header .modal-title { font-weight: 700; font-size: 1rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid rgba(0,0,0,0.06); padding: 1rem 1.5rem; }

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown-menu {
    border-radius: var(--radius); box-shadow: var(--neo-shadow-lg); padding: 0.5rem 0; font-size: 0.85rem;
    background: var(--card-bg); border: 1px solid var(--border-color);
    animation: fadeInUp 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-origin: top center;
}
.dropdown-item { padding: 0.5rem 1.25rem; color: var(--text-primary); transition: var(--transition); }
.dropdown-item:hover { background: rgba(0,0,0,0.05); color: var(--primary); }
.dropdown-item i { width: 20px; text-align: center; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination .page-link {
    border: 1px solid var(--border-color); color: var(--text-primary); font-size: 0.85rem; padding: 0.4rem 0.75rem;
    transition: var(--transition); border-radius: 10px; box-shadow: var(--neo-shadow-sm);
    background: var(--card-bg); margin: 0 3px;
}
.pagination .page-link:hover { box-shadow: var(--neo-inset-sm); color: var(--primary); }
.pagination .page-item.active .page-link {
    background: var(--primary); color: #fff;
    box-shadow: 0 2px 4px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(224,229,236,0.9); z-index: 9999; display: flex;
    align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: var(--transition);
}
.loading-overlay.active { opacity: 1; visibility: visible; }

.loading-spinner {
    width: 56px; height: 56px; border-radius: 50%;
    box-shadow: var(--neo-shadow); border: none; background: var(--body-bg); position: relative;
}
.loading-spinner::after {
    content: ''; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px;
    border-radius: 50%; border: 3px solid transparent; border-top-color: var(--primary);
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ANIMATIONS
   ============================================================ */
/* ── Keyframes ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes neoSlideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes neoSlideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes neoScaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes neoPulse {
    0% { box-shadow: var(--neo-shadow); }
    50% { box-shadow: var(--neo-shadow-md); }
    100% { box-shadow: var(--neo-shadow); }
}
@keyframes neoPress {
    0% { box-shadow: var(--neo-shadow-sm); transform: scale(1); }
    50% { box-shadow: var(--neo-inset-sm); transform: scale(0.97); }
    100% { box-shadow: var(--neo-shadow-sm); transform: scale(1); }
}
@keyframes neoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes neoGlow {
    0%, 100% { box-shadow: var(--neo-shadow), 0 0 0 0 rgba(99,102,241,0); }
    50% { box-shadow: var(--neo-shadow-md), 0 0 20px 4px rgba(99,102,241,0.15); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes shadowBreath {
    0%, 100% { box-shadow: var(--neo-shadow-sm); }
    50% { box-shadow: var(--neo-shadow); }
}

/* ── Utility animation classes ── */
.animate-fade-in { animation: fadeIn 0.4s ease-out both; }
.animate-fade-up { animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-slide-left { animation: neoSlideInLeft 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-slide-right { animation: neoSlideInRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-scale-in { animation: neoScaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-pulse { animation: neoPulse 2.5s ease-in-out infinite; }
.animate-float { animation: neoFloat 3s ease-in-out infinite; }
.animate-glow { animation: neoGlow 3s ease-in-out infinite; }

/* ── Staggered card entrance ── */
.row > [class*="col-"]:nth-child(1) .card,
.row > [class*="col-"]:nth-child(1) .stat-card,
.row > [class*="col-"]:nth-child(1) .dash-stat { animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.05s; }
.row > [class*="col-"]:nth-child(2) .card,
.row > [class*="col-"]:nth-child(2) .stat-card,
.row > [class*="col-"]:nth-child(2) .dash-stat { animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.12s; }
.row > [class*="col-"]:nth-child(3) .card,
.row > [class*="col-"]:nth-child(3) .stat-card,
.row > [class*="col-"]:nth-child(3) .dash-stat { animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.19s; }
.row > [class*="col-"]:nth-child(4) .card,
.row > [class*="col-"]:nth-child(4) .stat-card,
.row > [class*="col-"]:nth-child(4) .dash-stat { animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.26s; }
.row > [class*="col-"]:nth-child(5) .card,
.row > [class*="col-"]:nth-child(5) .stat-card { animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.33s; }
.row > [class*="col-"]:nth-child(6) .card,
.row > [class*="col-"]:nth-child(6) .stat-card { animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.40s; }

/* ── Skeleton loading placeholder ── */
.neo-skeleton {
    background: var(--body-bg);
    box-shadow: var(--neo-inset-sm);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}
.neo-skeleton::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

/* ============================================================
   TOASTR OVERRIDES
   ============================================================ */
#toast-container > div {
    border-radius: var(--radius) !important;
    box-shadow: var(--neo-shadow-lg) !important;
    opacity: 1 !important; font-size: 0.85rem;
    animation: neoSlideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
/* The sticky top navbar (badges, school switcher, theme/lang toggles) sits in
   the same top-12px corner toastr uses for toast-top-left (RTL pages) and
   toast-top-right (LTR pages), so a toast popping in visually overlapped
   the navbar cluster instead of appearing below it. Push both corner
   positions down past the navbar (measured ~69px including its own
   top margin) instead of the toastr default top:12px. */
#toast-container.toast-top-left,
#toast-container.toast-top-right {
    top: 80px !important;
}
#toast-container > .toast-success { background-color: var(--success) !important; }
#toast-container > .toast-error   { background-color: var(--danger) !important; }
#toast-container > .toast-warning { background-color: var(--warning) !important; }
#toast-container > .toast-info    { background-color: var(--info) !important; }

/* ============================================================
   SWAL2 OVERRIDES
   ============================================================ */
.swal2-popup { border-radius: 20px !important; font-size: 0.9rem !important; box-shadow: var(--neo-shadow-lg) !important; background: var(--card-bg) !important; border: 1px solid var(--border-color) !important; }
.swal2-confirm { background: var(--primary) !important; border-radius: 12px !important; font-weight: 600 !important; box-shadow: 0 2px 4px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2) !important; }
.swal2-cancel { border-radius: 12px !important; font-weight: 600 !important; box-shadow: var(--neo-shadow-sm) !important; }

/* ============================================================
   UTILITY
   ============================================================ */
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-info      { color: var(--info) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }

.bg-primary-light { background: rgba(99,102,241,0.1); }
.bg-success-light { background: rgba(16,185,129,0.1); }
.bg-danger-light  { background: rgba(239,68,68,0.1); }
.bg-warning-light { background: rgba(245,158,11,0.1); }
.bg-info-light    { background: rgba(6,182,212,0.1); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ============================================================
   CONTENT WRAPPER
   ============================================================ */
.content-wrapper { padding: 1.5rem; animation: fadeIn 0.3s ease-out; }

/* ============================================================
   ENHANCED PAGE HEADER
   ============================================================ */
.page-header .page-header-left { display: flex; flex-direction: column; gap: 0.25rem; }
.page-header .page-title .page-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; background: var(--gradient-primary); color: #fff;
    box-shadow: var(--glow-primary);
    transition: var(--transition-bounce);
}
.page-header:hover .page-title .page-icon {
    transform: scale(1.06) rotate(-3deg);
}
.page-header .page-subtitle { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.page-header .page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.page-header .page-breadcrumb {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.75rem; color: var(--text-muted); margin: 0; padding: 0; list-style: none;
}
.page-header .page-breadcrumb li { display: flex; align-items: center; }
.page-header .page-breadcrumb li a { color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
.page-header .page-breadcrumb li a:hover { color: var(--primary); }
.page-header .page-breadcrumb li + li::before {
    content: '\f105'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 0.6rem; color: var(--text-muted); margin-right: 0.4rem;
}
.page-header .page-breadcrumb li.active { color: var(--text-muted); }

/* ============================================================
   ENHANCED FILTERS
   ============================================================ */
/* ============================================================
   FILTERS CARD — Professional Filter Bar
   ============================================================ */
.filters-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-bottom: 1.5rem;
    box-shadow: var(--neo-shadow);
    transition: box-shadow 0.3s ease;
    animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
    overflow: hidden;
    position: relative;
}
/* Top accent strip */
.filters-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light, #818cf8), var(--primary));
    background-size: 200% 100%;
    animation: filterAccentShift 6s ease infinite;
    z-index: 1;
}
@keyframes filterAccentShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Header */
.filters-card .filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem 0;
    margin-bottom: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.filters-card .filters-header h6 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filters-card .filters-header h6 i,
.filters-card .filters-header > i {
    margin-right: 0.4rem;
    color: var(--primary);
    opacity: 0.8;
    font-size: 0.82rem;
}
/* Clear/reset button in header */
.filters-card .filters-header .btn {
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
}

/* Filter body (form area) */
.filters-card > form,
.filters-card > div > form {
    padding: 1rem 1.5rem 1.25rem;
}

/* Filter group — flex row */
.filters-card .filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

/* Filter items */
.filters-card .filter-item {
    flex: 1;
    min-width: 160px;
    position: relative;
}
.filters-card .filter-item label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 4px;
}
.filters-card .filter-item label .form-label {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    margin-bottom: 0;
}

/* Filter inputs */
.filters-card .form-control,
.filters-card .form-control-sm {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius);
    padding: 0.55rem 0.85rem;
    font-size: 0.83rem;
    font-weight: 500;
    background: var(--card-bg);
    box-shadow: var(--neo-inset-sm);
    transition: all 0.3s ease;
    min-height: 40px;
}
.filters-card .form-control:focus,
.filters-card .form-control-sm:focus {
    border-color: var(--primary);
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.12);
}
.filters-card .form-control:hover:not(:focus),
.filters-card .form-control-sm:hover:not(:focus) {
    border-color: rgba(99,102,241,0.2);
}

/* Filter selects */
.filters-card .form-select,
.filters-card .form-select-sm {
    min-height: 40px;
    font-size: 0.83rem;
    font-weight: 500;
}

/* Filter input-group */
.filters-card .input-group {
    box-shadow: none;
}
.filters-card .input-group .input-group-text {
    background: var(--card-bg);
    border: none;
    box-shadow: var(--neo-shadow-sm);
    color: var(--primary);
    font-size: 0.82rem;
    min-width: 40px;
    justify-content: center;
    border-radius: 12px 0 0 12px;
}
[dir="rtl"] .filters-card .input-group .input-group-text {
    border-radius: 0 12px 12px 0;
}
.filters-card .input-group .form-control {
    border-radius: 0 12px 12px 0;
}
[dir="rtl"] .filters-card .input-group .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
}

/* Filter action buttons */
.filters-card .filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding-bottom: 1px;
}
.filters-card .filter-actions .btn,
.filters-card .btn-primary,
.filters-card .btn-outline-secondary {
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius);
    padding: 0.55rem 1.1rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.filters-card .btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border: none;
    box-shadow: 0 3px 12px rgba(99,102,241,0.25);
}
.filters-card .btn-primary:hover {
    box-shadow: 0 5px 18px rgba(99,102,241,0.35);
    transform: translateY(-1px);
}
.filters-card .btn-outline-secondary {
    border: 1px solid rgba(0,0,0,0.12);
    color: var(--text-muted);
}
.filters-card .btn-outline-secondary:hover {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.18);
    color: var(--text-primary);
}

/* Active filter indicator */
.filters-card .filter-item .form-select:not([value=""]):valid,
.filters-card .filter-item .form-control:not(:placeholder-shown) {
    background-color: rgba(99,102,241,0.03);
    box-shadow: var(--neo-inset-sm), 0 0 0 2px rgba(99,102,241,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .filters-card .filter-group { flex-direction: column; gap: 0.75rem; }
    .filters-card .filter-item { min-width: 100%; }
    .filters-card .filter-actions { width: 100%; }
    .filters-card .filter-actions .btn { flex: 1; justify-content: center; }
}
@media (min-width: 1200px) {
    .filters-card .filter-item { min-width: 140px; }
}

/* Dark mode */
[data-theme="dark"] .filters-card {
    background: var(--card-bg);
}
[data-theme="dark"] .filters-card .filters-header h6,
[data-theme="dark"] .filters-card .filters-header {
    color: var(--text-muted);
}
[data-theme="dark"] .filters-card .filter-item label {
    color: var(--primary-light, #818cf8);
}
[data-theme="dark"] .filters-card .form-control,
[data-theme="dark"] .filters-card .form-control-sm {
    background: var(--body-bg);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-primary);
}
[data-theme="dark"] .filters-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(129,140,248,0.12);
}
[data-theme="dark"] .filters-card .input-group .input-group-text {
    background: var(--body-bg);
    border-color: rgba(255,255,255,0.08);
    color: var(--primary-light, #818cf8);
}
[data-theme="dark"] .filters-card .btn-outline-secondary {
    border-color: rgba(255,255,255,0.1);
    color: var(--text-muted);
}
[data-theme="dark"] .filters-card .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.18);
    color: var(--text-primary);
}

/* ============================================================
   TABLE CARD
   ============================================================ */
.table-card { border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--neo-shadow); background: var(--card-bg); overflow: visible; transition: box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; position: relative; }
.table-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-primary); border-radius: var(--radius-lg) var(--radius-lg) 0 0; opacity: 0.6; z-index: 1; }
.table-card:hover { box-shadow: var(--neo-shadow-md); }
.table-card .table-card-header {
    padding: 1.1rem 1.5rem; border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex; align-items: center; justify-content: space-between; background: transparent;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.table-card .table-card-header .table-title,
.table-card .table-card-header .table-card-title { font-weight: 700; font-size: 0.92rem; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.table-card .table-card-header .record-count {
    background: var(--gradient-primary); color: #fff;
    font-size: 0.72rem; font-weight: 700; padding: 0.25em 0.7em; border-radius: 50px;
    box-shadow: var(--glow-primary); border: none;
    min-width: 24px; text-align: center;
}
.table-card .table-card-body { padding: 0; }
.table-card .table-card-body .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-card .table-card-body .table { min-width: 700px; }
.table-card .table-card-footer {
    padding: 0.85rem 1.5rem; border-top: 1px solid rgba(0,0,0,0.06); background: transparent;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.action-btns { display: flex; gap: 4px; justify-content: center; }
.action-btns .btn-action {
    width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center;
    justify-content: center; border-radius: 8px; font-size: 0.75rem; transition: var(--transition);
}
.action-btns .btn-action:hover { box-shadow: var(--neo-inset-sm); }

/* ============================================================
   FORM SECTIONS
   ============================================================ */
.form-card { border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--neo-shadow); background: var(--card-bg); margin-bottom: 1.25rem; animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; position: relative; overflow: hidden; }
.form-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-primary); z-index: 1; opacity: 0.6; }
.form-card .form-card-header { padding: 1.15rem 1.5rem; border-bottom: 1px solid rgba(0,0,0,0.05); background: transparent; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.form-card .form-card-header h6, .form-card-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.form-card .form-card-header h6 i, .form-card-title i { color: var(--primary); font-size: 0.9rem; }
.form-card .form-card-body { padding: 1.5rem; }
.form-card .form-card-body .form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; letter-spacing: 0.2px; }
.form-card .form-card-footer { padding: 1.15rem 1.5rem; border-top: 1px solid rgba(0,0,0,0.05); background: transparent; display: flex; gap: 0.5rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg); justify-content: flex-end; }

/* ============================================================
   DETAIL / VIEW PAGE
   ============================================================ */
.detail-card { border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--neo-shadow); background: var(--card-bg); margin-bottom: 1.25rem; }
.detail-card .detail-header { padding: 1.25rem; border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; align-items: center; gap: 1rem; }
.detail-card .detail-avatar {
    width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center;
    justify-content: center; font-size: 1.5rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light)); flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(99,102,241,0.25);
}
.detail-card .detail-info h5 { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.2rem; }
.detail-card .detail-info p { color: var(--text-muted); font-size: 0.8rem; margin: 0; }
.detail-row { display: flex; padding: 0.65rem 1.25rem; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 0.85rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row .detail-label { width: 180px; flex-shrink: 0; font-weight: 600; color: var(--text-secondary); }
.detail-row .detail-value { flex: 1; color: var(--text-primary); }

/* Standalone detail labels (used in info grids) */
.detail-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.detail-value { font-size: 0.92rem; font-weight: 500; color: var(--text-primary); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 4rem 1.5rem; }
.empty-state .empty-icon {
    width: 88px; height: 88px; border-radius: 22px; background: var(--body-bg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: var(--text-muted); margin-bottom: 1.25rem; box-shadow: var(--neo-shadow);
    animation: shadowBreath 3s ease-in-out infinite;
}
.empty-state i.fa-3x { color: var(--text-muted); margin-bottom: 1rem; opacity: 0.5; }
.empty-state h5, .empty-state h6 { font-weight: 700; color: var(--text-secondary); margin-bottom: 0.35rem; }
.empty-state p { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 1.25rem; max-width: 360px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.empty-state .btn { box-shadow: var(--neo-shadow-sm); }

/* ============================================================
   ATTENDANCE SYSTEM
   ============================================================ */

/* ── Summary Stats Row ─────────────────────────────────────── */
.attendance-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
}
.att-stat-card {
    flex: 1;
    min-width: 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-sm);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}
.att-stat-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--neo-shadow-md);
    z-index: 2;
}
.att-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.att-stat-card.stat-total::before    { background: linear-gradient(90deg, var(--primary), #818cf8); }
.att-stat-card.stat-present::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.att-stat-card.stat-absent::before   { background: linear-gradient(90deg, #ef4444, #f87171); }
.att-stat-card.stat-late::before     { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.att-stat-card.stat-halfday::before  { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.att-stat-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.att-stat-icon.icon-total   { background: rgba(99,102,241,0.12); color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.06); }
.att-stat-icon.icon-present { background: rgba(16,185,129,0.12); color: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.06); }
.att-stat-icon.icon-absent  { background: rgba(239,68,68,0.12);  color: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,0.06); }
.att-stat-icon.icon-late    { background: rgba(245,158,11,0.12); color: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,0.06); }
.att-stat-icon.icon-halfday { background: rgba(6,182,212,0.12);  color: #06b6d4; box-shadow: 0 0 0 4px rgba(6,182,212,0.06); }
.att-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.att-stat-info .att-stat-number {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}
.att-stat-info .att-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-stat-info .att-stat-pct {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
}
.att-stat-pct.pct-success { background: rgba(16,185,129,0.12); color: #059669; }
.att-stat-pct.pct-danger  { background: rgba(239,68,68,0.12);  color: #dc2626; }
.att-stat-pct.pct-warning { background: rgba(245,158,11,0.12); color: #d97706; }
.att-stat-pct.pct-info    { background: rgba(6,182,212,0.12);  color: #0891b2; }

/* ── Quick Actions Bar ─────────────────────────────────────── */
.att-quick-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--neo-inset-sm);
    margin-bottom: 16px;
}
.att-quick-bar .quick-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.att-quick-bar .quick-label i { color: var(--primary); }
.att-quick-bar .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 16px;
    box-shadow: var(--neo-shadow-sm);
    border: none;
}
.att-quick-bar .btn:hover { transform: translateY(-1px); }

/* ── Attendance Toggle Buttons ─────────────────────────────── */
.att-toggle-group {
    display: flex;
    gap: 4px;
    width: 100%;
}
.att-toggle-group .att-toggle {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: var(--card-bg);
    box-shadow: var(--neo-shadow-sm);
    color: var(--text-secondary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.att-toggle-group .att-toggle input[type="radio"] { display: none; }
.att-toggle-group .att-toggle:hover { transform: translateY(-1px); }
.att-toggle-group .att-toggle.active,
.att-toggle-group .att-toggle:has(input:checked) {
    box-shadow: var(--neo-inset-sm);
    transform: none;
}
.att-toggle.t-present.active, .att-toggle.t-present:has(input:checked) { border-color: #10b981; color: #059669; background: rgba(16,185,129,0.08); }
.att-toggle.t-absent.active, .att-toggle.t-absent:has(input:checked)   { border-color: #ef4444; color: #dc2626; background: rgba(239,68,68,0.08); }
.att-toggle.t-late.active, .att-toggle.t-late:has(input:checked)       { border-color: #f59e0b; color: #d97706; background: rgba(245,158,11,0.08); }
.att-toggle.t-halfday.active, .att-toggle.t-halfday:has(input:checked) { border-color: #06b6d4; color: #0891b2; background: rgba(6,182,212,0.08); }

/* ── Attendance Table Enhancements ─────────────────────────── */
.att-table .student-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.att-table .student-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
}
.att-table .student-avatar { background: linear-gradient(135deg, var(--primary), #818cf8); }
.att-table .student-name { font-weight: 600; color: var(--text-primary); }
.att-table .student-id   { font-size: 0.75rem; color: var(--text-muted); }
.att-table .table > thead > tr > th {
    background: rgba(99,102,241,0.06);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    padding: 12px 16px;
    border: none;
}
.att-table .table > tbody > tr {
    transition: background 0.15s ease;
}
.att-table .table > tbody > tr:hover {
    background: rgba(99,102,241,0.03);
}
.att-table .table > tbody > tr > td {
    vertical-align: middle;
    padding: 10px 16px;
    border-color: rgba(0,0,0,0.04);
}

/* ── Class Selector Cards (Teacher Panel) ──────────────────── */
.class-select-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-sm);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}
.class-select-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--neo-shadow);
    border-color: rgba(99,102,241,0.15);
}
.class-select-card .class-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.class-select-card .class-section {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.class-select-card .class-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(99,102,241,0.08);
    color: var(--primary);
    margin-bottom: 14px;
}
.class-select-card .btn {
    border-radius: 10px;
    font-weight: 600;
    width: 100%;
}

/* ── Save Footer Bar ───────────────────────────────────────── */
.att-save-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: 0 0 var(--radius) var(--radius);
    border-top: 1px solid rgba(0,0,0,0.06);
}
.att-save-bar .btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border: none;
    border-radius: 12px;
    padding: 10px 28px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.att-save-bar .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99,102,241,0.4);
}
.att-save-bar .count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(99,102,241,0.08);
    color: var(--primary);
}

/* Dark mode attendance */
[data-theme="dark"] .att-stat-card { background: var(--card-bg); box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] .attendance-stats { background: var(--card-bg); box-shadow: var(--neo-shadow); }
[data-theme="dark"] .att-quick-bar { background: var(--card-bg); box-shadow: var(--neo-inset-sm); }
[data-theme="dark"] .att-toggle-group .att-toggle { background: var(--card-bg); box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] .class-select-card { background: var(--card-bg); box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] .att-table .table > thead > tr > th { background: rgba(99,102,241,0.08); }
[data-theme="dark"] .att-save-bar { border-top-color: rgba(255,255,255,0.06); }

@media (max-width: 992px) {
    .attendance-stats { flex-wrap: wrap; }
    .att-stat-card { flex: 1 1 calc(50% - 7px); min-width: 140px; }
}
@media (max-width: 576px) {
    .attendance-stats { flex-direction: column; gap: 10px; padding: 4px; }
    .att-stat-card { flex: 1 1 100%; }
    .att-toggle-group { flex-wrap: wrap; }
    .att-toggle-group .att-toggle { flex: 1 1 45%; }
    .att-quick-bar { padding: 10px 14px; }
    .att-save-bar { flex-direction: column; align-items: stretch; }
}

/* ── Attendance Progress Bars ─────────────────────────────── */
.att-progress-wrap {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0 2px;
}
.att-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.att-bar-success { background: linear-gradient(90deg, #10b981, #34d399); }
.att-bar-danger  { background: linear-gradient(90deg, #ef4444, #f87171); }
.att-bar-warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.att-bar-info    { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

/* ── Attendance Rate Overview (Donut + Legend + Bars) ──── */
.att-rate-overview {
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 24px;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.att-rate-chart {
    display: flex;
    justify-content: center;
    align-items: center;
}
.att-donut {
    position: relative;
    width: 140px;
    height: 140px;
}
.att-donut-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.att-donut-seg {
    transition: stroke-dasharray 0.6s ease;
}
.att-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.att-donut-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1.2;
}
.att-donut-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.att-rate-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.att-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.att-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.att-legend-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 1;
}
.att-legend-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.att-rate-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.att-hbar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.att-hbar-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 65px;
    text-align: right;
}
.att-hbar-track {
    flex: 1;
    height: 8px;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    overflow: hidden;
}
.att-hbar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.att-hbar-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 40px;
}

/* ── Status Row Indicators ────────────────────────────────── */
.att-row-present { border-left: 3px solid #10b981 !important; }
.att-row-absent  { border-left: 3px solid #ef4444 !important; }
.att-row-late    { border-left: 3px solid #f59e0b !important; }
.att-row-halfday { border-left: 3px solid #06b6d4 !important; }

/* ── Enhanced Date Cell ───────────────────────────────────── */
.att-date-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.att-date-day {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 30px;
    text-align: center;
    line-height: 1;
}
.att-date-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.att-date-month {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
}
.att-date-weekday {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* ── Status Badge ─────────────────────────────────────────── */
.att-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.att-badge-success { background: rgba(16,185,129,0.1); color: #059669; }
.att-badge-danger  { background: rgba(239,68,68,0.1);  color: #dc2626; }
.att-badge-warning { background: rgba(245,158,11,0.1); color: #d97706; }
.att-badge-info    { background: rgba(6,182,212,0.1);  color: #0891b2; }

/* ── Admission Code & Class/Section Badges ────────────────── */
.att-admission-code {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}
.att-class-badge, .att-section-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary);
}
.att-note-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.att-note-text i { color: #f59e0b; }

/* ── Active Filters Badge ─────────────────────────────────── */
.att-active-filters-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(16,185,129,0.1);
    color: #059669;
}

/* ── Table Actions ────────────────────────────────────────── */
.att-table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.att-date-display {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(99,102,241,0.06);
}

/* ── Live Summary Bar ─────────────────────────────────────── */
.att-live-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    flex-wrap: wrap;
}
.att-live-item {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-sm);
    background: var(--card-bg);
    transition: all 0.3s ease;
}
.att-live-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.att-live-present i { color: #10b981; }
.att-live-absent i  { color: #ef4444; }
.att-live-late i    { color: #f59e0b; }
.att-live-halfday i { color: #06b6d4; }
.att-live-total i   { color: var(--primary); }
.att-live-count {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    transition: transform 0.2s ease;
}
.att-count-pulse {
    transform: scale(1.3);
}
.att-live-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Save Date Badge ──────────────────────────────────────── */
.att-save-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(16,185,129,0.08);
    color: #059669;
    margin-inline-start: auto;
}

/* ── Dark mode for new attendance elements ────────────────── */
[data-theme="dark"] .att-rate-overview { background: var(--card-bg); box-shadow: var(--neo-shadow); }
[data-theme="dark"] .att-live-summary { background: var(--card-bg); box-shadow: var(--neo-shadow); }
[data-theme="dark"] .att-live-item { background: var(--card-bg); box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] .att-hbar-track { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .att-progress-wrap { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .att-class-badge,
[data-theme="dark"] .att-section-badge { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
[data-theme="dark"] .att-admission-code { background: rgba(99,102,241,0.15); }
[data-theme="dark"] .att-row-present { border-left-color: #10b981; }
[data-theme="dark"] .att-row-absent  { border-left-color: #ef4444; }
[data-theme="dark"] .att-row-late    { border-left-color: #f59e0b; }
[data-theme="dark"] .att-row-halfday { border-left-color: #06b6d4; }

/* ── Responsive for new elements ──────────────────────────── */
@media (max-width: 992px) {
    .att-rate-overview { grid-template-columns: 1fr 1fr; }
    .att-rate-chart { grid-column: 1 / -1; }
}
@media (max-width: 576px) {
    .att-rate-overview { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
    .att-donut { width: 110px; height: 110px; }
    .att-donut-value { font-size: 1.2rem; }
    .att-live-summary { gap: 8px; padding: 8px 12px; }
    .att-live-item { min-width: 80px; padding: 8px 10px; }
    .att-live-count { font-size: 1.1rem; }
    .att-date-cell { flex-direction: column; align-items: flex-start; gap: 2px; }
    .att-date-day { font-size: 1rem; }
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-nav { list-style: none; padding: 0; margin: 0; }
.settings-nav .settings-nav-item { border-bottom: 1px solid rgba(0,0,0,0.06); }
.settings-nav .settings-nav-item:last-child { border-bottom: none; }
.settings-nav .settings-nav-link {
    display: flex; align-items: center; padding: 0.85rem 1.25rem; color: var(--text-secondary);
    text-decoration: none; transition: var(--transition); font-size: 0.85rem; font-weight: 500; gap: 0.75rem; cursor: pointer;
}
.settings-nav .settings-nav-link:hover { background: rgba(0,0,0,0.04); color: var(--primary); }
.settings-nav .settings-nav-link.active {
    background: rgba(99,102,241,0.08); color: var(--primary); font-weight: 600;
    border-left: 3px solid var(--primary); box-shadow: var(--neo-inset-sm);
}
.settings-nav .settings-nav-link i { width: 22px; text-align: center; font-size: 0.9rem; }
.settings-nav .settings-nav-link .nav-label { flex: 1; }
.settings-nav .settings-nav-link .nav-arrow { font-size: 0.7rem; opacity: 0.4; }
.settings-section { padding: 1.5rem; }
.settings-section .section-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.settings-section .section-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.settings-section .setting-row { padding: 1rem 0; border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; align-items: flex-start; gap: 1.5rem; }
.settings-section .setting-row:last-child { border-bottom: none; }
.settings-section .setting-label-col { width: 280px; flex-shrink: 0; }
.settings-section .setting-label-col label { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 0.15rem; display: block; }
.settings-section .setting-label-col .setting-help { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.settings-section .setting-input-col { flex: 1; max-width: 480px; }

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.active   { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.status-dot.inactive { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.status-dot.pending  { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.4); }

/* Avatar circles */
.avatar-circle {
    width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 0.75rem; color: #fff; flex-shrink: 0;
    box-shadow: var(--neo-shadow-sm);
}
.avatar-circle.avatar-sm { width: 28px; height: 28px; font-size: 0.65rem; border-radius: 8px; }
.avatar-circle.avatar-lg { width: 48px; height: 48px; font-size: 1rem; border-radius: 14px; }
.avatar-circle.bg-primary { background: linear-gradient(135deg, #6366f1, #818cf8) !important; }
.avatar-circle.bg-success { background: linear-gradient(135deg, #10b981, #34d399) !important; }
.avatar-circle.bg-danger  { background: linear-gradient(135deg, #ef4444, #f87171) !important; }
.avatar-circle.bg-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24) !important; }
.avatar-circle.bg-info    { background: linear-gradient(135deg, #06b6d4, #22d3ee) !important; }

/* Summary stats */
.summary-stats { display: flex; gap: 1.25rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.summary-stat-item {
    flex: 1; min-width: 170px; background: var(--card-bg); border: none; border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--neo-shadow); transition: var(--transition);
    position: relative; overflow: hidden;
}
.summary-stat-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0; transition: opacity 0.3s ease;
}
.summary-stat-item:hover { box-shadow: var(--neo-shadow-lg); transform: translateY(-2px); }
.summary-stat-item:hover::before { opacity: 1; }
.summary-stat-item .stat-icon-sm {
    width: 48px; height: 48px; min-width: 48px; border-radius: 14px; display: flex; align-items: center;
    justify-content: center; font-size: 1.1rem; box-shadow: var(--neo-shadow-sm);
}
.summary-stat-item .stat-text .stat-number { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.summary-stat-item .stat-text .stat-desc { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-top: 2px; }

/* .stat-card nested inside summary-stat-item — layout fix */
.summary-stat-item .stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}
.summary-stat-item .stat-card .stat-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: none;
    flex-shrink: 0;
}
.summary-stat-item .stat-card .stat-details {
    flex: 1;
    min-width: 0;
}
.summary-stat-item .stat-card .stat-details .stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.summary-stat-item .stat-card .stat-details .stat-label {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0;
    margin-top: 2px;
}

/* Gradient icon enhancements inside summary cards */
.summary-stat-item .stat-icon.bg-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    box-shadow: 0 6px 16px rgba(99,102,241,0.35);
}
.summary-stat-item .stat-icon.bg-success {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    box-shadow: 0 6px 16px rgba(16,185,129,0.35);
}
.summary-stat-item .stat-icon.bg-danger {
    background: linear-gradient(135deg, #ef4444, #f87171) !important;
    box-shadow: 0 6px 16px rgba(239,68,68,0.35);
}
.summary-stat-item .stat-icon.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    box-shadow: 0 6px 16px rgba(245,158,11,0.35);
}
.summary-stat-item .stat-icon.bg-info {
    background: linear-gradient(135deg, #06b6d4, #22d3ee) !important;
    box-shadow: 0 6px 16px rgba(6,182,212,0.35);
}
.summary-stat-item .stat-icon.bg-secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
    box-shadow: 0 6px 16px rgba(107,114,128,0.35);
}

/* Toggle switch - Neomorphic */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--card-bg); transition: background 0.3s ease, box-shadow 0.3s ease; border-radius: 12px; border: 1px solid var(--border-color);
    box-shadow: var(--neo-inset-sm);
}
.toggle-switch .slider:before {
    content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: var(--card-bg); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, box-shadow 0.25s ease; border-radius: 50%;
    box-shadow: var(--neo-shadow-sm);
}
.toggle-switch input:checked + .slider { background: rgba(99,102,241,0.15); }
.toggle-switch input:checked + .slider:before {
    transform: translateX(20px); background: var(--primary);
    box-shadow: 0 2px 4px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        transform: translateX(-100%);
        min-width: var(--sidebar-width);
        max-width: var(--sidebar-width);
        opacity: 1;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #sidebar .sidebar-sticky { position: static; height: 100%; }
    #sidebar.show { transform: translateX(0); }
    #sidebar.collapsed { transform: translateX(-100%); min-width: var(--sidebar-width); max-width: var(--sidebar-width); }
    .sidebar-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1040; display: none; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); transition: opacity 0.3s ease; }
    .sidebar-backdrop.show { display: block; }
    .container-fluid { padding: 1rem; }
    .navbar { margin: 4px 8px; }
}

@media (max-width: 767.98px) {
    .stat-card .stat-value { font-size: 1.35rem; }
    .stat-card .stat-icon { width: 48px; height: 48px; font-size: 1.1rem; }
    .dash-stat .card-body { padding: 18px 20px; }
    .dash-stat .stat-icon-circle { width: 48px; height: 48px; min-width: 48px; font-size: 1.15rem; }
    .dash-stat .stat-value { font-size: 1.5rem; }
    .dash-stat .stat-footer { padding: 10px 20px; }
    .fin-card .card-body { padding: 16px 18px; }
    .fin-card .fin-value { font-size: 1.25rem; }
    .snapshot-card .card-body { padding: 16px 18px; }
    .snapshot-value { font-size: 1.3rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .notification-dropdown { width: 280px; }
    .filters-card .filter-group { flex-direction: column; }
    .filters-card .filter-item { min-width: 100%; }
    .detail-row { flex-direction: column; gap: 0.25rem; }
    .detail-row .detail-label { width: 100%; }
    .settings-section .setting-row { flex-direction: column; gap: 0.5rem; }
    .settings-section .setting-label-col { width: 100%; }
    .settings-section .setting-input-col { max-width: 100%; }
    .summary-stats { flex-direction: column; }
    .summary-stat-item { min-width: 100%; }
}

@media (max-width: 991.98px) {
    .auth-wrapper { flex-direction: column; }
    .auth-brand-panel { flex: none; padding: 2rem 1.5rem; }
    .auth-brand-shape-1 { width: 200px; height: 200px; top: -60px; right: -60px; }
    .auth-brand-shape-2 { width: 140px; height: 140px; bottom: -30px; left: -40px; }
    .auth-brand-shape-3 { width: 80px; height: 80px; }
    .auth-brand-content h2 { font-size: 1.5rem; }
    .auth-brand-content .brand-tagline { margin-bottom: 1.5rem; font-size: 0.9rem; }
    .auth-features { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
    .auth-features li { font-size: 0.8rem; padding: 0.4rem 0; }
    .auth-features li .feature-icon { width: 30px; height: 30px; margin-right: 8px; }
    .auth-form-panel { padding: 2rem 1.5rem; }
}

@media (max-width: 575.98px) {
    .auth-brand-panel { padding: 1.5rem 1rem; }
    .auth-brand-logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 1rem; }
    .auth-brand-logo i { font-size: 1.75rem; }
    .auth-brand-content h2 { font-size: 1.25rem; }
    .auth-brand-content .brand-tagline { font-size: 0.82rem; margin-bottom: 1rem; }
    .auth-features { display: none; }
    .auth-brand-shape { display: none; }
    .auth-card-inner { padding: 1.5rem; border-radius: 16px; }
    .auth-form-panel { padding: 1.5rem 1rem; }
    .auth-lang-switcher { top: 10px; right: 10px; }
    .navbar { padding: 0.5rem 0.75rem; margin: 4px; }
    .notification-dropdown { width: 280px; }
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
    --sidebar-bg: #1e2128;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(129,140,248,0.15);
    --body-bg: #1a1d23;
    --card-bg: #252830;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(255,255,255,0.08);
    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;
    --gradient-primary: linear-gradient(to bottom, #919cf8, #6f72e8);
    --gradient-accent: linear-gradient(to bottom, #919cf8, #c4b5fd, #919cf8);
    --gradient-dark: linear-gradient(to bottom, #e2e8f0, #cbd5e1);
    --glow-primary: 0 4px 12px rgba(129,140,248,0.15);
    --glow-success: 0 4px 12px rgba(52,211,153,0.15);
    --glow-danger: 0 4px 12px rgba(248,113,113,0.15);
    --glow-warning: 0 4px 12px rgba(251,191,36,0.15);
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
    --shadow-sm: var(--neo-shadow-sm);
    --shadow: var(--neo-shadow);
    --shadow-md: var(--neo-shadow-md);
    --shadow-lg: var(--neo-shadow-lg);
}

[data-theme="dark"] body { background: var(--body-bg); color: var(--text-primary); }
[data-theme="dark"] .navbar { background: var(--card-bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--border-color); }
[data-theme="dark"] .navbar .text-dark { color: var(--text-primary) !important; }
[data-theme="dark"] .navbar #sidebarToggle { color: var(--text-secondary); background: var(--card-bg); box-shadow: var(--neo-shadow-sm); }

[data-theme="dark"] .form-control { background: var(--body-bg); color: var(--text-primary); box-shadow: var(--neo-inset-sm); }
[data-theme="dark"] .form-control:focus { background: var(--body-bg); color: var(--text-primary); box-shadow: var(--neo-inset), 0 0 0 3px rgba(129,140,248,0.12); }
[data-theme="dark"] .form-select {
    background-color: var(--body-bg); color: var(--text-primary);
    box-shadow: var(--neo-inset-sm); border: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23818cf8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
[data-theme="dark"] .form-select:hover:not(:focus) {
    box-shadow: var(--neo-inset-sm), 0 0 0 2px rgba(129,140,248,0.08);
}
[data-theme="dark"] .form-select:focus {
    background: var(--body-bg); color: var(--text-primary);
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(129,140,248,0.12);
}
[data-theme="dark"] .input-group .form-select {
    border: none;
}
[data-theme="dark"] table .form-select,
[data-theme="dark"] .dataTables_length .form-select {
    border: none;
}
[data-theme="dark"] .input-group-text { background: var(--card-bg); color: var(--text-secondary); border: none; box-shadow: var(--neo-shadow-sm); }

/* Bootstrap paints cells with --bs-table-bg (default #fff); in dark mode that
   put light text on a white background. Override Bootstrap's own table
   variables so cells inherit the dark surface and stay readable. */
[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-striped-bg: rgba(255,255,255,0.03);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-hover-bg: rgba(129,140,248,0.08);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
}
[data-theme="dark"] .table thead th { background: transparent; color: var(--text-secondary); }
[data-theme="dark"] .table tbody td { color: var(--text-primary); }
[data-theme="dark"] .table-hover tbody tr:hover { background: rgba(129,140,248,0.06); }
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255,255,255,0.02); }
[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light > th,
[data-theme="dark"] .table-light > td,
[data-theme="dark"] .table .table-light > * {
    --bs-table-bg: rgba(255,255,255,0.05);
    --bs-table-color: var(--text-primary);
    background-color: rgba(255,255,255,0.05) !important;
    color: var(--text-primary) !important;
}

/* Bootstrap light utility classes render a light background / dark text; in
   dark mode remap them to theme-appropriate values so panels, badges, callouts
   and headings that use bg-light / bg-white / text-dark stay readable app-wide
   (used across 100+ views — fixed here once rather than per file). */
[data-theme="dark"] .bg-light { background-color: rgba(255,255,255,0.05) !important; }
[data-theme="dark"] .bg-white { background-color: var(--card-bg) !important; }
[data-theme="dark"] .text-dark { color: var(--text-primary) !important; }
[data-theme="dark"] .text-bg-light {
    background-color: rgba(255,255,255,0.08) !important;
    color: var(--text-primary) !important;
}

/* Shared chart chrome tokens for secondary dashboards (accounting, HRM, GPS,
   teacher, virtual classroom). Read once via getComputedStyle to theme
   Chart.js ink / gridlines / doughnut-segment borders. Defined here once
   instead of an identical inline block repeated in ~19 views. */
:root { --acc-ink: #52514e; --acc-grid: #e1e0d9; --acc-surface: #fcfcfb; }
:root[data-theme="dark"] { --acc-ink: #c3c2b7; --acc-grid: #2c2c2a; --acc-surface: #252830; }

[data-theme="dark"] .dropdown-menu { background: var(--card-bg); box-shadow: var(--neo-shadow-lg); }
[data-theme="dark"] .dropdown-item { color: var(--text-primary); }
[data-theme="dark"] .dropdown-item:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .dropdown-header { background: transparent; color: var(--text-primary); }
[data-theme="dark"] .dropdown-divider { border-color: rgba(255,255,255,0.06); }

[data-theme="dark"] .modal-content { background: var(--card-bg); box-shadow: var(--neo-shadow-lg); }
[data-theme="dark"] .modal-header { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .modal-footer { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .btn-close { color: var(--text-muted); }

[data-theme="dark"] .pagination .page-link { background: var(--card-bg); color: var(--text-primary); box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] .pagination .page-item.active .page-link { box-shadow: var(--neo-shadow-sm); }

[data-theme="dark"] .table-card .table-card-header, [data-theme="dark"] .table-card .table-card-footer { background: transparent; }
[data-theme="dark"] .form-card .form-card-header, [data-theme="dark"] .form-card .form-card-footer { background: transparent; }

[data-theme="dark"] .notification-dropdown { background: var(--card-bg); }
[data-theme="dark"] .notification-dropdown .notification-item.unread { background: rgba(129,140,248,0.08); }
[data-theme="dark"] .notification-dropdown .notification-item:hover { background: rgba(255,255,255,0.03); }

[data-theme="dark"] .loading-overlay { background: rgba(45,55,72,0.85); }
[data-theme="dark"] .loading-spinner { background: var(--body-bg); }
[data-theme="dark"] .loading-spinner::after { border-top-color: var(--primary); }

[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background: var(--body-bg); color: var(--text-primary);
    border-color: rgba(255,255,255,0.08);
    border-right-color: var(--primary);
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection:hover {
    border-color: rgba(129,140,248,0.3);
    border-right-color: var(--primary);
}
[data-theme="dark"] .input-group .select2-container--bootstrap-5 .select2-selection {
    border-right-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--text-primary); }
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow { color: var(--primary); }
[data-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    background: var(--card-bg);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.15);
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    background: var(--body-bg); color: var(--text-primary);
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option { color: var(--text-primary); }
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--selected {
    background: rgba(129,140,248,0.12); color: var(--primary);
}

[data-theme="dark"] .swal2-popup { background: var(--card-bg) !important; color: var(--text-primary) !important; }
[data-theme="dark"] .swal2-title { color: var(--text-primary) !important; }
[data-theme="dark"] .swal2-html-container { color: var(--text-secondary) !important; }

[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input { background: var(--body-bg); color: var(--text-primary); }

[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #4a5568; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #718096; }

[data-theme="dark"] .main-footer { background: var(--body-bg); }
[data-theme="dark"] .sidebar-section-label { color: var(--text-muted); }
[data-theme="dark"] .sidebar-section-label::before { background: linear-gradient(90deg, rgba(129,140,248,0.15), transparent); }
[data-theme="dark"] .sidebar-user-widget { border: none; box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] .sidebar-user-widget:hover { box-shadow: var(--neo-shadow); }
[data-theme="dark"] #sidebar { box-shadow: 2px 0 8px rgba(0,0,0,0.3); border-right-color: var(--border-color); }
[data-theme="dark"] #sidebar .sidebar-header { border-bottom-color: rgba(255,255,255,0.04); background: transparent; }
[data-theme="dark"] #sidebar .sidebar-menu > .nav-item > .nav-link { color: var(--text-secondary) !important; }
[data-theme="dark"] #sidebar .sidebar-menu > .nav-item > .nav-link:hover { color: var(--text-primary) !important; background: rgba(255,255,255,0.06); box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] #sidebar .sidebar-menu > .nav-item > .nav-link.active { color: var(--primary) !important; background: rgba(129,140,248,0.12); box-shadow: var(--neo-inset-sm); }
[data-theme="dark"] #sidebar .sidebar-menu .collapse .nav-link:hover { background: rgba(129,140,248,0.06); }
[data-theme="dark"] #sidebar .sidebar-menu::-webkit-scrollbar-thumb { background: transparent; }
[data-theme="dark"] #sidebar .sidebar-menu:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
[data-theme="dark"] #sidebar.collapsed .sidebar-menu > .nav-item:hover::after {
    background: var(--card-bg); color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

[data-theme="dark"] .auth-wrapper { background: var(--body-bg); }
[data-theme="dark"] .auth-form-panel { background: var(--body-bg); }
[data-theme="dark"] .auth-card-inner { background: var(--body-bg); box-shadow: var(--neo-shadow-lg); }

/* Theme toggle button */
.theme-toggle {
    background: var(--body-bg); border: none; border-radius: 12px; padding: 0.4rem 0.5rem;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition);
    font-size: 0.95rem; line-height: 1; margin-right: 0.5rem; box-shadow: var(--neo-shadow-sm);
}
.theme-toggle:hover { color: var(--primary); box-shadow: var(--neo-inset-sm); }

/* ============================================================
   COLOR SCHEMES
   ============================================================ */
/* Indigo is the default - no override needed */

/* ---- Blue ---- */
[data-color-scheme="blue"] {
    --primary: #3b82f6; --primary-light: #60a5fa; --primary-dark: #2563eb;
    --sidebar-active: rgba(59,130,246,0.12); --sidebar-active-border: #3b82f6;
}
[data-theme="dark"][data-color-scheme="blue"] {
    --primary: #60a5fa; --primary-light: #93c5fd; --primary-dark: #3b82f6;
}

/* ---- Emerald ---- */
[data-color-scheme="emerald"] {
    --primary: #10b981; --primary-light: #34d399; --primary-dark: #059669;
    --sidebar-active: rgba(16,185,129,0.12); --sidebar-active-border: #10b981;
}
[data-theme="dark"][data-color-scheme="emerald"] {
    --primary: #34d399; --primary-light: #6ee7b7; --primary-dark: #10b981;
}

/* ---- Rose ---- */
[data-color-scheme="rose"] {
    --primary: #f43f5e; --primary-light: #fb7185; --primary-dark: #e11d48;
    --sidebar-active: rgba(244,63,94,0.12); --sidebar-active-border: #f43f5e;
}
[data-theme="dark"][data-color-scheme="rose"] {
    --primary: #fb7185; --primary-light: #fda4af; --primary-dark: #f43f5e;
}

/* ---- Amber ---- */
[data-color-scheme="amber"] {
    --primary: #f59e0b; --primary-light: #fbbf24; --primary-dark: #d97706;
    --sidebar-active: rgba(245,158,11,0.12); --sidebar-active-border: #f59e0b;
}
[data-theme="dark"][data-color-scheme="amber"] {
    --primary: #fbbf24; --primary-light: #fde68a; --primary-dark: #f59e0b;
}

/* ---- Violet ---- */
[data-color-scheme="violet"] {
    --primary: #8b5cf6; --primary-light: #a78bfa; --primary-dark: #7c3aed;
    --sidebar-active: rgba(139,92,246,0.12); --sidebar-active-border: #8b5cf6;
}
[data-theme="dark"][data-color-scheme="violet"] {
    --primary: #a78bfa; --primary-light: #c4b5fd; --primary-dark: #8b5cf6;
}

/* ---- Cyan ---- */
[data-color-scheme="cyan"] {
    --primary: #06b6d4; --primary-light: #22d3ee; --primary-dark: #0891b2;
    --sidebar-active: rgba(6,182,212,0.12); --sidebar-active-border: #06b6d4;
}
[data-theme="dark"][data-color-scheme="cyan"] {
    --primary: #22d3ee; --primary-light: #67e8f9; --primary-dark: #06b6d4;
}

/* ---- Slate ---- */
[data-color-scheme="slate"] {
    --primary: #64748b; --primary-light: #94a3b8; --primary-dark: #475569;
    --sidebar-active: rgba(100,116,139,0.12); --sidebar-active-border: #64748b;
}
[data-theme="dark"][data-color-scheme="slate"] {
    --primary: #94a3b8; --primary-light: #cbd5e1; --primary-dark: #64748b;
}

/* ============================================================
   NEO SKINS (Surface / Background Styles)
   ============================================================ */
/* Classic is the default - no override needed */

/* ---- Warm Sand ---- */
[data-neo-skin="sand"] {
    --body-bg: #e5ddd0; --card-bg: #fdfcfa; --sidebar-bg: #ece5da;
    --neo-shadow: 0 2px 6px rgba(120,100,70,0.10), 0 1px 3px rgba(120,100,70,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(120,100,70,0.10), 0 1px 2px rgba(120,100,70,0.05);
    --neo-shadow-md: 0 4px 12px rgba(120,100,70,0.12), 0 2px 4px rgba(120,100,70,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(120,100,70,0.14), 0 4px 8px rgba(120,100,70,0.07);
    --neo-inset: inset 0 2px 4px rgba(120,100,70,0.12), inset 0 1px 2px rgba(120,100,70,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(120,100,70,0.10), inset 0 1px 1px rgba(120,100,70,0.05);
}
[data-theme="dark"][data-neo-skin="sand"] {
    --body-bg: #33302a; --card-bg: #3d3a33; --sidebar-bg: #38352e;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Cool Ocean ---- */
[data-neo-skin="ocean"] {
    --body-bg: #d7e0ec; --card-bg: #fbfcfe; --sidebar-bg: #dfe6ef;
    --neo-shadow: 0 2px 6px rgba(60,80,120,0.10), 0 1px 3px rgba(60,80,120,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(60,80,120,0.10), 0 1px 2px rgba(60,80,120,0.05);
    --neo-shadow-md: 0 4px 12px rgba(60,80,120,0.12), 0 2px 4px rgba(60,80,120,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(60,80,120,0.14), 0 4px 8px rgba(60,80,120,0.07);
    --neo-inset: inset 0 2px 4px rgba(60,80,120,0.12), inset 0 1px 2px rgba(60,80,120,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(60,80,120,0.10), inset 0 1px 1px rgba(60,80,120,0.05);
}
[data-theme="dark"][data-neo-skin="ocean"] {
    --body-bg: #2a3242; --card-bg: #343c4c; --sidebar-bg: #2f3747;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Soft Lavender ---- */
[data-neo-skin="lavender"] {
    --body-bg: #dfd9eb; --card-bg: #fcfbfe; --sidebar-bg: #e5e0ed;
    --neo-shadow: 0 2px 6px rgba(90,70,130,0.10), 0 1px 3px rgba(90,70,130,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(90,70,130,0.10), 0 1px 2px rgba(90,70,130,0.05);
    --neo-shadow-md: 0 4px 12px rgba(90,70,130,0.12), 0 2px 4px rgba(90,70,130,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(90,70,130,0.14), 0 4px 8px rgba(90,70,130,0.07);
    --neo-inset: inset 0 2px 4px rgba(90,70,130,0.12), inset 0 1px 2px rgba(90,70,130,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(90,70,130,0.10), inset 0 1px 1px rgba(90,70,130,0.05);
}
[data-theme="dark"][data-neo-skin="lavender"] {
    --body-bg: #302b3f; --card-bg: #3a3549; --sidebar-bg: #353044;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Mint Fresh ---- */
[data-neo-skin="mint"] {
    --body-bg: #d9e5e0; --card-bg: #fbfefc; --sidebar-bg: #e0e9e4;
    --neo-shadow: 0 2px 6px rgba(50,100,70,0.10), 0 1px 3px rgba(50,100,70,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(50,100,70,0.10), 0 1px 2px rgba(50,100,70,0.05);
    --neo-shadow-md: 0 4px 12px rgba(50,100,70,0.12), 0 2px 4px rgba(50,100,70,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(50,100,70,0.14), 0 4px 8px rgba(50,100,70,0.07);
    --neo-inset: inset 0 2px 4px rgba(50,100,70,0.12), inset 0 1px 2px rgba(50,100,70,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(50,100,70,0.10), inset 0 1px 1px rgba(50,100,70,0.05);
}
[data-theme="dark"][data-neo-skin="mint"] {
    --body-bg: #293430; --card-bg: #333e3a; --sidebar-bg: #2e3935;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Rose Quartz ---- */
[data-neo-skin="rose"] {
    --body-bg: #e5d9dd; --card-bg: #fefbfc; --sidebar-bg: #ebe0e3;
    --neo-shadow: 0 2px 6px rgba(130,70,90,0.10), 0 1px 3px rgba(130,70,90,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(130,70,90,0.10), 0 1px 2px rgba(130,70,90,0.05);
    --neo-shadow-md: 0 4px 12px rgba(130,70,90,0.12), 0 2px 4px rgba(130,70,90,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(130,70,90,0.14), 0 4px 8px rgba(130,70,90,0.07);
    --neo-inset: inset 0 2px 4px rgba(130,70,90,0.12), inset 0 1px 2px rgba(130,70,90,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(130,70,90,0.10), inset 0 1px 1px rgba(130,70,90,0.05);
}
[data-theme="dark"][data-neo-skin="rose"] {
    --body-bg: #342b2e; --card-bg: #3e3538; --sidebar-bg: #393033;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Slate Storm ---- */
[data-neo-skin="slate"] {
    --body-bg: #d5dae1; --card-bg: #fbfcfd; --sidebar-bg: #dde1e6;
    --neo-shadow: 0 2px 6px rgba(60,70,90,0.10), 0 1px 3px rgba(60,70,90,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(60,70,90,0.10), 0 1px 2px rgba(60,70,90,0.05);
    --neo-shadow-md: 0 4px 12px rgba(60,70,90,0.12), 0 2px 4px rgba(60,70,90,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(60,70,90,0.14), 0 4px 8px rgba(60,70,90,0.07);
    --neo-inset: inset 0 2px 4px rgba(60,70,90,0.12), inset 0 1px 2px rgba(60,70,90,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(60,70,90,0.10), inset 0 1px 1px rgba(60,70,90,0.05);
}
[data-theme="dark"][data-neo-skin="slate"] {
    --body-bg: #2b3037; --card-bg: #353a41; --sidebar-bg: #30353c;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Sunset Peach ---- */
[data-neo-skin="peach"] {
    --body-bg: #e9dad2; --card-bg: #fefcfb; --sidebar-bg: #efe3dc;
    --neo-shadow: 0 2px 6px rgba(130,90,60,0.10), 0 1px 3px rgba(130,90,60,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(130,90,60,0.10), 0 1px 2px rgba(130,90,60,0.05);
    --neo-shadow-md: 0 4px 12px rgba(130,90,60,0.12), 0 2px 4px rgba(130,90,60,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(130,90,60,0.14), 0 4px 8px rgba(130,90,60,0.07);
    --neo-inset: inset 0 2px 4px rgba(130,90,60,0.12), inset 0 1px 2px rgba(130,90,60,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(130,90,60,0.10), inset 0 1px 1px rgba(130,90,60,0.05);
}
[data-theme="dark"][data-neo-skin="peach"] {
    --body-bg: #372e28; --card-bg: #413832; --sidebar-bg: #3c332d;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Arctic Frost ---- */
[data-neo-skin="frost"] {
    --body-bg: #e1e7ed; --card-bg: #fbfcfe; --sidebar-bg: #e7ecf1;
    --neo-shadow: 0 2px 6px rgba(50,70,100,0.10), 0 1px 3px rgba(50,70,100,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(50,70,100,0.10), 0 1px 2px rgba(50,70,100,0.05);
    --neo-shadow-md: 0 4px 12px rgba(50,70,100,0.12), 0 2px 4px rgba(50,70,100,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(50,70,100,0.14), 0 4px 8px rgba(50,70,100,0.07);
    --neo-inset: inset 0 2px 4px rgba(50,70,100,0.12), inset 0 1px 2px rgba(50,70,100,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(50,70,100,0.10), inset 0 1px 1px rgba(50,70,100,0.05);
}
[data-theme="dark"][data-neo-skin="frost"] {
    --body-bg: #2a313d; --card-bg: #343b47; --sidebar-bg: #2f3642;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Golden Honey ---- */
[data-neo-skin="honey"] {
    --body-bg: #e7dfcd; --card-bg: #fdfcf9; --sidebar-bg: #ede6d6;
    --neo-shadow: 0 2px 6px rgba(120,100,50,0.10), 0 1px 3px rgba(120,100,50,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(120,100,50,0.10), 0 1px 2px rgba(120,100,50,0.05);
    --neo-shadow-md: 0 4px 12px rgba(120,100,50,0.12), 0 2px 4px rgba(120,100,50,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(120,100,50,0.14), 0 4px 8px rgba(120,100,50,0.07);
    --neo-inset: inset 0 2px 4px rgba(120,100,50,0.12), inset 0 1px 2px rgba(120,100,50,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(120,100,50,0.10), inset 0 1px 1px rgba(120,100,50,0.05);
}
[data-theme="dark"][data-neo-skin="honey"] {
    --body-bg: #353028; --card-bg: #3f3a32; --sidebar-bg: #3a352d;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Berry Plum ---- */
[data-neo-skin="plum"] {
    --body-bg: #e1d7e3; --card-bg: #fcfbfd; --sidebar-bg: #e7dee8;
    --neo-shadow: 0 2px 6px rgba(100,60,110,0.10), 0 1px 3px rgba(100,60,110,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(100,60,110,0.10), 0 1px 2px rgba(100,60,110,0.05);
    --neo-shadow-md: 0 4px 12px rgba(100,60,110,0.12), 0 2px 4px rgba(100,60,110,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(100,60,110,0.14), 0 4px 8px rgba(100,60,110,0.07);
    --neo-inset: inset 0 2px 4px rgba(100,60,110,0.12), inset 0 1px 2px rgba(100,60,110,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(100,60,110,0.10), inset 0 1px 1px rgba(100,60,110,0.05);
}
[data-theme="dark"][data-neo-skin="plum"] {
    --body-bg: #312b37; --card-bg: #3b3541; --sidebar-bg: #36303c;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ---- Olive Garden ---- */
[data-neo-skin="olive"] {
    --body-bg: #dde1d5; --card-bg: #fcfdfa; --sidebar-bg: #e3e6dc;
    --neo-shadow: 0 2px 6px rgba(70,80,50,0.10), 0 1px 3px rgba(70,80,50,0.07);
    --neo-shadow-sm: 0 1px 3px rgba(70,80,50,0.10), 0 1px 2px rgba(70,80,50,0.05);
    --neo-shadow-md: 0 4px 12px rgba(70,80,50,0.12), 0 2px 4px rgba(70,80,50,0.07);
    --neo-shadow-lg: 0 8px 24px rgba(70,80,50,0.14), 0 4px 8px rgba(70,80,50,0.07);
    --neo-inset: inset 0 2px 4px rgba(70,80,50,0.12), inset 0 1px 2px rgba(70,80,50,0.07);
    --neo-inset-sm: inset 0 1px 3px rgba(70,80,50,0.10), inset 0 1px 1px rgba(70,80,50,0.05);
}
[data-theme="dark"][data-neo-skin="olive"] {
    --body-bg: #2d3029; --card-bg: #373a33; --sidebar-bg: #32352e;
    --neo-shadow: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --neo-shadow-sm: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    --neo-shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
    --neo-shadow-lg: 0 8px 30px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.20);
    --neo-inset: inset 0 2px 5px rgba(0,0,0,0.25), inset 0 1px 2px rgba(0,0,0,0.15);
    --neo-inset-sm: inset 0 1px 3px rgba(0,0,0,0.20), inset 0 1px 1px rgba(0,0,0,0.10);
}

/* ============================================================
   REPORT UTILITIES
   ============================================================ */
.text-xs { font-size: 0.7rem; }
.opacity-50 { opacity: 0.5; }
.year-end-section { margin-bottom: 2rem; }
.section-header { font-size: 0.95rem; }

.trend-up { color: #1cc88a; font-size: 0.75rem; font-weight: 600; }
.trend-down { color: #e74a3b; font-size: 0.75rem; font-weight: 600; }
.trend-neutral { color: #858796; font-size: 0.75rem; font-weight: 600; }

.report-page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.report-quick-link { transition: var(--transition); cursor: pointer; }
.report-quick-link:hover { box-shadow: var(--neo-shadow-lg) !important; }
.report-stat-value { transition: color 0.3s ease; }
.report-filter .form-group { margin-right: 1rem; margin-bottom: 0.5rem; }
.report-filter label { margin-right: 0.5rem; font-weight: 600; }
.report-empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.report-empty-state i { font-size: 3rem; opacity: 0.4; margin-bottom: 1rem; display: block; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    /* ── Neutralize dark theme for print ──
       Components read --card-bg / --text-* / --body-bg; the dark theme keeps
       them dark and its [data-theme="dark"] scope outranks plain component
       print rules. Reset the tokens themselves so every consumer (cards,
       tables, headers, text) prints on white with dark ink regardless of the
       viewer's active theme. */
    :root[data-theme="dark"], [data-theme="dark"] {
        --body-bg: #ffffff !important;
        --card-bg: #ffffff !important;
        --sidebar-bg: #ffffff !important;
        --text-primary: #111111 !important;
        --text-secondary: #444444 !important;
        --text-muted: #666666 !important;
        --border-color: rgba(0,0,0,0.15) !important;
    }
    /* Chart token wrappers (read by JS at draw time, but kept light for any
       reflow/redraw during printing). */
    [data-theme="dark"] .fin-charts, [data-theme="dark"] .fin-kpis,
    [data-theme="dark"] .stu-charts, [data-theme="dark"] .stu-kpis,
    [data-theme="dark"] .exm-charts, [data-theme="dark"] .exm-kpis,
    [data-theme="dark"] .tp-viz, [data-theme="dark"] .et-viz,
    [data-theme="dark"] .ap-viz, [data-theme="dark"] .cc-viz,
    [data-theme="dark"] .sa-viz, [data-theme="dark"] .att-viz,
    [data-theme="dark"] .yc-viz, [data-theme="dark"] .sca-viz,
    [data-theme="dark"] .sas-viz, [data-theme="dark"] .year-end-section,
    [data-theme="dark"] .chart-card {
        --viz-ink: #52514e !important;
        --viz-grid: #e1e0d9 !important;
        --viz-axis: #c3c2b7 !important;
        --viz-surface: #ffffff !important;
    }

    /* ── Hide non-printable elements ── */
    #sidebar, .navbar, .main-footer, .filters-bar, .filters-card, .filter-actions,
    .table-card-footer, .page-actions, .action-btns,
    .dataTables_length, .dataTables_filter, .dataTables_paginate, .dataTables_info,
    .no-print, .modal, .modal-backdrop, .dropdown-menu, .toast,
    .breadcrumb, .page-breadcrumb, nav[aria-label="breadcrumb"],
    form, .filter-panel, .export-buttons, .sidebar-backdrop,
    .pagination, .btn, .page-header .btn
    { display: none !important; }

    /* ── Page setup ── */
    @page { margin: 12mm 10mm; }
    body { font-size: 10pt; color: #000; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    #main-content { width: 100%; margin: 0; padding: 0; }
    .container-fluid { padding: 0; }
    .content-wrapper { padding: 0; }
    a { color: #000; text-decoration: none; }

    /* ── Page header ── */
    .page-header { border-bottom: 2px solid #333; padding-bottom: 6px; margin-bottom: 12px; }
    .page-title { font-size: 16pt; font-weight: 700; margin-bottom: 4px; }
    .page-header .page-icon { display: none; }
    .page-subtitle { font-size: 9pt; color: #555; }

    /* ── Summary stats — VISIBLE in print ── */
    .summary-stats { display: flex !important; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
    .summary-stat-item, .stat-card, .summary-stats > div {
        flex: 1; min-width: 100px; border: 1px solid #ccc; border-radius: 6px;
        padding: 8px 10px; box-shadow: none !important; background: #fff !important;
        page-break-inside: avoid;
    }
    .summary-stat-item .stat-number, .stat-card .stat-value,
    .stat-card .stat-details h3, .summary-stats h3 { font-size: 13pt; font-weight: 700; color: #000; }
    .summary-stat-item .stat-desc, .stat-card .stat-label,
    .stat-card .stat-details span { font-size: 7pt; color: #555; text-transform: uppercase; }
    .summary-stat-item .stat-icon, .stat-card .stat-icon,
    .summary-stat-item .stat-icon-sm { display: none; }

    /* ── Cards ── */
    .card, .table-card, .info-card, .chart-card, .detail-card, .form-card {
        box-shadow: none !important; border: 1px solid #ddd; page-break-inside: avoid;
        background: #fff !important; border-radius: 4px;
    }
    .card-header, .table-card-header, .info-card-header {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        background: #f8f8f8 !important; padding: 6px 10px;
    }

    /* ── Tables ── */
    .table { page-break-inside: auto; font-size: 9pt; }
    .table tr { page-break-inside: avoid; }
    .table thead th {
        background: #2d3748 !important; color: #fff !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        font-size: 8pt; padding: 5px 8px; font-weight: 600;
    }
    .table tbody td { padding: 4px 8px; border-bottom: 1px solid #e2e2e2; }
    .table-striped tbody tr:nth-of-type(odd) {
        background-color: #f7f7f7 !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .table tfoot tr { font-weight: 700; border-top: 2px solid #333; }
    .table tfoot td, .table tfoot th {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        background: #f0f4ff !important;
    }

    /* ── Multi-column layout preservation ── */
    .row { display: flex !important; flex-wrap: wrap !important; }
    .col-lg-6 { flex: 0 0 50% !important; max-width: 50% !important; }
    .col-lg-4 { flex: 0 0 33.333% !important; max-width: 33.333% !important; }
    .col-lg-3 { flex: 0 0 25% !important; max-width: 25% !important; }

    /* ── Charts — keep visible ── */
    .chart-card, .chart-container {
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    canvas { max-height: 200px !important; }

    /* ── Badges ── */
    .badge {
        border: 1px solid #999; box-shadow: none;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }

    /* ── Progress bars ── */
    .progress {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        border: 1px solid #ddd;
    }
    .progress-bar {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }

    /* ── Page break helpers ── */
    .table-card, .info-card, .chart-card { page-break-inside: avoid; }
    h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
    .row > [class*="col-"] { page-break-inside: avoid; }
}

/* ============================================================
   ENHANCED TYPOGRAPHY
   ============================================================ */
h1, .h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.3; }
h2, .h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; }
h3, .h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.4; }
h4, .h4 { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
h5, .h5 { font-size: 0.95rem; font-weight: 600; line-height: 1.45; }
h6, .h6 { font-size: 0.85rem; font-weight: 600; line-height: 1.5; }

/* ============================================================
   SMOOTH INTERACTIONS & ANIMATIONS
   ============================================================ */
html { scroll-behavior: smooth; }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.btn { transition: all 0.25s ease; }

.theme-toggle i { transition: transform 0.3s ease; }
.theme-toggle:hover i { transform: rotate(30deg); }

.container-fluid { animation: contentFadeIn 0.25s ease-out; flex: 1; }
@keyframes contentFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.table-hover tbody tr { transition: background-color 0.15s ease; }

.dropdown-menu { animation: dropdownEntry 0.15s ease-out; }
@keyframes dropdownEntry { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.badge { font-weight: 600; letter-spacing: 0.02em; }

.notification-bell .badge-count:not([style*="display:none"]):not([style*="display: none"]) { animation: bellPulse 2s infinite; }
@keyframes bellPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* ============================================================
   DASHBOARD COMPONENTS (Neomorphic - Global)
   Moved from inline styles for system-wide reuse
   ============================================================ */

/* ── Welcome/Hero Banner ─────────────────────────────────────── */
.welcome-banner {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 50%, #6d28d9 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -60%; left: 10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-banner .greeting { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; position: relative; z-index: 1; }
.welcome-banner .sub-greeting { font-size: 0.95rem; opacity: 0.85; position: relative; z-index: 1; }
.welcome-banner .date-badge {
    background: rgba(255,255,255,0.15); border-radius: 12px; padding: 12px 18px;
    display: inline-flex; align-items: center; gap: 10px; font-size: 0.85rem;
    position: relative; z-index: 1;
    box-shadow: none; border: 1px solid rgba(255,255,255,0.2);
}
.welcome-banner .date-badge i { font-size: 1.1rem; opacity: 0.9; }
.welcome-banner.welcome-teacher { background: linear-gradient(135deg, #0891b2 0%, #22d3ee 50%, #06b6d4 100%); box-shadow: 0 4px 12px rgba(8,145,178,0.25); }
.welcome-banner.welcome-success { background: linear-gradient(135deg, #059669 0%, #34d399 50%, #10b981 100%); box-shadow: 0 4px 12px rgba(16,185,129,0.25); }

/* ── Dashboard Stat Cards (Neomorphic) ───────────────────────── */
.dash-stat {
    border: none; border-radius: var(--radius-lg); overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--neo-shadow); background: var(--card-bg);
    position: relative;
}
.dash-stat::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    opacity: 0; transition: opacity 0.3s ease;
}
.dash-stat:hover { box-shadow: var(--neo-shadow-lg); transform: translateY(-3px); }
.dash-stat:hover::after { opacity: 0.6; }
.dash-stat .card-body { padding: 26px 28px; }
.dash-stat .stat-header { display: flex; align-items: flex-start; gap: 18px; }
.dash-stat .stat-icon-circle {
    width: 60px; height: 60px; min-width: 60px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff; flex-shrink: 0;
    transition: var(--transition);
}
.dash-stat:hover .stat-icon-circle { transform: scale(1.05); }
.dash-stat .stat-info { flex: 1; min-width: 0; }
.dash-stat .stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--text-primary); letter-spacing: -0.5px; }
.dash-stat .stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.dash-stat .stat-footer {
    font-size: 0.82rem; padding: 12px 28px; background: transparent;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.dash-stat .stat-footer a { color: inherit; text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
.dash-stat .stat-footer a:hover { color: var(--primary); }

/* ── Gradient Icon Backgrounds ───────────────────────────────── */
.icon-grad-primary { background: linear-gradient(135deg, #6366f1, #818cf8); box-shadow: 0 6px 16px rgba(99,102,241,0.35); }
.icon-grad-success { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 6px 16px rgba(16,185,129,0.35); }
.icon-grad-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 6px 16px rgba(245,158,11,0.35); }
.icon-grad-info    { background: linear-gradient(135deg, #06b6d4, #22d3ee); box-shadow: 0 6px 16px rgba(6,182,212,0.35); }
.icon-grad-danger  { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 6px 16px rgba(239,68,68,0.35); }

/* Inset icon variants */
.icon-primary { background: var(--card-bg); color: var(--primary); box-shadow: var(--neo-inset-sm); }
.icon-success { background: var(--card-bg); color: var(--success); box-shadow: var(--neo-inset-sm); }
.icon-warning { background: var(--card-bg); color: var(--warning); box-shadow: var(--neo-inset-sm); }
.icon-info    { background: var(--card-bg); color: var(--info); box-shadow: var(--neo-inset-sm); }
.icon-danger  { background: var(--card-bg); color: var(--danger); box-shadow: var(--neo-inset-sm); }

/* ── Snapshot Cards ──────────────────────────────────────────── */
.snapshot-card {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg); transition: all 0.3s ease;
}
.snapshot-card:hover { box-shadow: var(--neo-shadow-lg); transform: translateY(-2px); }
.snapshot-card .card-body { padding: 22px 24px; }
.snapshot-value { font-size: 1.65rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }
.snapshot-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--text-muted); }
.snapshot-sub { font-size: 0.82rem; color: var(--text-muted); }

/* ── Financial Cards ─────────────────────────────────────────── */
.fin-card {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg);
    transition: all 0.3s ease; border-left: 4px solid transparent;
    position: relative; overflow: hidden;
}
.fin-card:hover { box-shadow: var(--neo-shadow-lg); transform: translateY(-2px); }
.fin-card.border-success { border-left-color: var(--success); }
.fin-card.border-danger  { border-left-color: var(--danger); }
.fin-card.border-info    { border-left-color: var(--info); }
.fin-card.border-warning { border-left-color: var(--warning); }
.fin-card .card-body { padding: 22px 26px; }
.fin-card .fin-value { font-size: 1.55rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }
.fin-card .fin-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }

/* ── KPI Cards ───────────────────────────────────────────────── */
.kpi-card {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg);
}
.kpi-item {
    padding: 18px 24px; display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: background 0.2s ease;
}
.kpi-item:hover { background: rgba(99,102,241,0.03); }
.kpi-item:last-child { border-bottom: none; }
.kpi-icon-circle {
    width: 46px; height: 46px; min-width: 46px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
    box-shadow: var(--neo-shadow-sm); background: var(--card-bg);
    transition: var(--transition);
}
.kpi-item:hover .kpi-icon-circle { transform: scale(1.05); }
.kpi-change { font-size: 0.8rem; font-weight: 700; }
.kpi-change-desc { font-size: 0.7rem; color: var(--text-muted); }

/* ── Chart Cards ─────────────────────────────────────────────── */
.chart-card {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg); overflow: hidden;
    transition: all 0.3s ease;
}
.chart-card:hover { box-shadow: var(--neo-shadow-lg); }
.chart-card .card-header, .chart-card-header {
    background: transparent; border-bottom: 1px solid rgba(0,0,0,0.06); padding: 18px 24px;
}
.chart-card .card-header h5, .chart-card-header h6 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.chart-card .card-body, .chart-card-body { padding: 20px 24px; }
.chart-container { position: relative; height: 260px; }

/* ── Quick Actions Grid ──────────────────────────────────────── */
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qa-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 18px 10px; border-radius: 12px;
    background: var(--card-bg); border: none; text-decoration: none;
    color: var(--text-primary); font-size: 0.82rem; font-weight: 600;
    transition: all 0.25s ease; gap: 8px;
    box-shadow: var(--neo-shadow-sm);
}
.qa-item:hover {
    box-shadow: var(--neo-inset-sm); text-decoration: none; color: var(--primary);
}
.qa-item i { font-size: 1.3rem; opacity: 0.9; }

/* ── Recent/Table Cards ──────────────────────────────────────── */
.recent-card {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg); overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.recent-card:hover { box-shadow: var(--neo-shadow-md); }
.recent-card .card-header {
    background: transparent; border-bottom: 1px solid rgba(0,0,0,0.06); padding: 16px 22px;
}
.recent-card .card-header h5 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.recent-card .table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; border-top: none; background: transparent; }
.recent-card .table td { font-size: 0.85rem; vertical-align: middle; color: var(--text-primary); }

/* ── Superadmin Stats ────────────────────────────────────────── */
.sa-stat {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg); transition: all 0.3s ease;
    overflow: hidden; position: relative;
}
.sa-stat:hover { box-shadow: var(--neo-shadow-lg); transform: translateY(-3px); }
.sa-stat .card-body { padding: 26px 28px; }
.sa-stat .stat-value { letter-spacing: -0.5px; }
.sa-stat .stat-label { letter-spacing: 0.6px; }
.sa-stat .stat-footer { font-size: 0.82rem; padding: 12px 28px; }

/* ── Gender Bar ──────────────────────────────────────────────── */
.gender-bar-container { margin-top: 8px; }
.gender-bar {
    display: flex; height: 8px; border-radius: 4px; overflow: hidden;
    background: var(--body-bg); border: none;
}
.gender-bar .male { background: linear-gradient(90deg, #6366f1, #818cf8); border-radius: 4px 0 0 4px; transition: width 0.6s ease; }
.gender-bar .female { background: linear-gradient(90deg, #ec4899, #f472b6); border-radius: 0 4px 4px 0; transition: width 0.6s ease; }
.gender-legend { display: flex; gap: 16px; margin-top: 6px; font-size: 0.78rem; color: var(--text-secondary); }
.gender-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.gender-legend .dot-male { background: #6366f1; }
.gender-legend .dot-female { background: #ec4899; }

/* ── Progress Circle ─────────────────────────────────────────── */
.progress-ring { width: 48px; height: 48px; position: relative; }
.progress-ring svg { transform: rotate(-90deg); }

/* ============================================================
   PROFESSIONAL PROFILE/DETAIL CARDS
   ============================================================ */

/* ── Profile Header Card ─────────────────────────────────────── */
.profile-header-card {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg);
    margin-bottom: 1.5rem; overflow: hidden;
}
.profile-header-card .profile-banner {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 50%, #4f46e5 100%);
    padding: 28px 28px 60px; position: relative; overflow: hidden;
}
.profile-header-card .profile-banner::before {
    content: ''; position: absolute; top: -50%; right: -15%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.profile-header-card .profile-banner.banner-cyan { background: linear-gradient(135deg, #0891b2 0%, #22d3ee 50%, #06b6d4 100%); }
.profile-header-card .profile-banner.banner-emerald { background: linear-gradient(135deg, #059669 0%, #34d399 50%, #10b981 100%); }
.profile-header-card .profile-banner.banner-amber { background: linear-gradient(135deg, #d97706 0%, #fbbf24 50%, #f59e0b 100%); }
.profile-header-card .profile-body {
    padding: 0 28px 24px; margin-top: -40px; position: relative; z-index: 1;
}
.profile-header-card .profile-avatar {
    width: 92px; height: 92px; border-radius: 50%;
    box-shadow: var(--neo-shadow), 0 0 0 4px var(--card-bg);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: #fff; flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.profile-header-card .profile-avatar:hover { transform: scale(1.06); }
.profile-header-card .profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-header-card .profile-meta { margin-top: 14px; }
.profile-header-card .profile-name { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.profile-header-card .profile-role { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.profile-header-card .profile-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.profile-header-card .profile-stat-row {
    display: flex; gap: 1.5rem; margin-top: 16px; padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.profile-header-card .profile-stat-item { text-align: center; }
.profile-header-card .profile-stat-value { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }
.profile-header-card .profile-stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--text-muted); }

/* ── Info/Detail Cards ───────────────────────────────────────── */
.info-card {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow); background: var(--card-bg);
    margin-bottom: 1.25rem; overflow: hidden;
}
.info-card .info-card-header {
    padding: 14px 20px; border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex; align-items: center; gap: 10px;
}
.info-card .info-card-header .info-icon {
    width: 36px; height: 36px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; font-size: 0.9rem;
    box-shadow: none; background: var(--body-bg); border: none;
}
.info-card .info-card-header h6 {
    font-size: 0.85rem; font-weight: 700; color: var(--text-primary); margin: 0;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.info-card .info-card-body { padding: 0; }

/* ── Info Table (label-value pairs) ──────────────────────────── */
.info-table { width: 100%; margin: 0; border-collapse: collapse; }
.info-table tr { border-bottom: 1px solid rgba(0,0,0,0.04); }
.info-table tr:last-child { border-bottom: none; }
.info-table th {
    padding: 11px 20px; width: 180px; font-size: 0.78rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;
    vertical-align: top; background: transparent; border: none;
    white-space: nowrap;
}
.info-table td {
    padding: 11px 20px; font-size: 0.85rem; color: var(--text-primary);
    vertical-align: top; border: none;
}
.info-table td strong { font-weight: 700; }

/* ── Profile Tabs (Pill style) ───────────────────────────────── */
.profile-tabs {
    margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem;
    padding: 6px; border-radius: var(--radius); background: var(--card-bg);
    box-shadow: var(--neo-inset-sm);
}
.profile-tabs .nav-link {
    border-radius: 10px; padding: 8px 18px; font-size: 0.82rem; font-weight: 600;
    color: var(--text-secondary); border: none; transition: all 0.25s ease;
    display: flex; align-items: center; gap: 6px;
}
.profile-tabs .nav-link:hover { color: var(--primary); }
.profile-tabs .nav-link.active {
    background: var(--card-bg); color: var(--primary);
    box-shadow: var(--neo-shadow-sm); font-weight: 700;
}
.profile-tabs .nav-link i { font-size: 0.85rem; }

/* ── Mini Stat Cards (for profile pages) ─────────────────────── */
.mini-stat {
    border: none; border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--neo-shadow-sm); background: var(--card-bg);
    text-align: center; transition: all 0.25s ease;
}
.mini-stat:hover { box-shadow: var(--neo-shadow); transform: translateY(-1px); }
.mini-stat .mini-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.mini-stat .mini-stat-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-top: 4px; }
.mini-stat .mini-stat-icon { font-size: 1.1rem; margin-bottom: 6px; }
.mini-stat.mini-stat-primary .mini-stat-icon { color: var(--primary); }
.mini-stat.mini-stat-success .mini-stat-icon { color: var(--success); }
.mini-stat.mini-stat-warning .mini-stat-icon { color: var(--warning); }
.mini-stat.mini-stat-danger  .mini-stat-icon { color: var(--danger); }
.mini-stat.mini-stat-info    .mini-stat-icon { color: var(--info); }

/* ── Enhanced Card Header Variants ───────────────────────────── */
.card-header-accent { border-bottom: 2px solid var(--primary); }
.card-header-accent.accent-success { border-bottom-color: var(--success); }
.card-header-accent.accent-info { border-bottom-color: var(--info); }
.card-header-accent.accent-warning { border-bottom-color: var(--warning); }
.card-header-accent.accent-danger { border-bottom-color: var(--danger); }

.card-header .card-header-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem; margin-right: 8px;
    box-shadow: var(--neo-shadow-sm); background: var(--card-bg);
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
    padding: 48px 24px; text-align: center;
}
.empty-state .empty-icon {
    width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--text-muted);
    box-shadow: var(--neo-inset-sm); background: var(--card-bg);
}
.empty-state h6 { font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* ── Dashboard responsive additions ──────────────────────────── */
@media (max-width: 768px) {
    .welcome-banner { padding: 20px; }
    .welcome-banner .greeting { font-size: 1.2rem; }
    .qa-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-container { height: 220px; }
    .profile-header-card .profile-body { padding: 0 16px 16px; }
    .profile-header-card .profile-avatar { width: 72px; height: 72px; }
    .info-table th { width: 140px; padding: 10px 14px; }
    .info-table td { padding: 10px 14px; }
}
@media (max-width: 575.98px) {
    .profile-header-card .profile-stat-row { flex-wrap: wrap; gap: 1rem; }
    .info-table th { display: block; width: 100%; padding-bottom: 0; }
    .info-table td { display: block; width: 100%; padding-top: 2px; }
}

/* ============================================================
   TABLET RESPONSIVE (768px - 991px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container-fluid { padding: 1rem !important; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .stat-card .stat-label { font-size: 0.72rem; }
    .dash-stat .stat-value { font-size: 1.6rem; }
    .dash-stat .stat-icon-circle { width: 52px; height: 52px; min-width: 52px; }
    .navbar .d-flex.align-items-center > .mr-2, .navbar .d-flex.align-items-center > .mr-3 { margin-right: 0.35rem !important; }
    .main-footer { padding: 0.6rem 1rem; font-size: 0.75rem; }
}

/* ============================================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ============================================================ */
@media (max-width: 767.98px) {
    .btn-sm { min-height: 36px; padding: 0.4rem 0.75rem; }
    #sidebar { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
    #sidebar .sidebar-menu > .nav-item > .nav-link { padding: 0.55rem 0.85rem; font-size: 0.84rem; }
    .main-footer { font-size: 0.72rem; padding: 0.6rem 1rem; padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)); }
    .card { border-radius: var(--radius) !important; }
    .sa-stat .card-body { padding: 18px 20px; }
}

@media (max-width: 575.98px) {
    .main-footer .d-flex { flex-direction: column; text-align: center; gap: 0.25rem; }
    .stat-card { margin-bottom: 0.5rem; }
    .stat-card .card-body { padding: 1rem 1.25rem; }
    .stat-card .stat-value { font-size: 1.35rem; }
    .stat-card .stat-icon { width: 44px; height: 44px; font-size: 1rem; }
    .dash-stat .card-body { padding: 16px 18px; }
    .dash-stat .stat-value { font-size: 1.35rem; }
    .dash-stat .stat-icon-circle { width: 44px; height: 44px; min-width: 44px; font-size: 1.1rem; border-radius: 12px; }
    .summary-stat-item { padding: 1rem 1.15rem; }
    .summary-stat-item .stat-text .stat-number { font-size: 1.2rem; }
    .kpi-item { padding: 14px 16px; }
    .kpi-icon-circle { width: 38px; height: 38px; min-width: 38px; }
}

/* ============================================================
   PREFERS-REDUCED-MOTION (Accessibility)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important; scroll-behavior: auto !important;
    }
}

/* ============================================================
   ROLES & PERMISSIONS UI
   ============================================================ */

/* ── Role Stats Card (Index Page) ── */
.role-stat-card {
    display: flex;
    align-items: center;
    padding: 22px 28px;
    background: var(--card-bg, #e0e5ec);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--neo-shadow);
    gap: 18px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.role-stat-card:hover { box-shadow: var(--neo-shadow-lg); transform: translateY(-2px); }
.role-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.role-stat-card:hover .role-stat-icon { transform: scale(1.05); }
.role-stat-info h4 {
    margin: 0;
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--text-primary, #1a365d);
    line-height: 1.15;
    letter-spacing: -0.5px;
}
.role-stat-info small {
    color: var(--text-muted, #5a80a8);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ── Role Card (Index Page Grid) ── */
.role-card {
    background: var(--card-bg, #e0e5ec);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--neo-shadow);
    padding: 26px;
    border-left: 4px solid #6366f1;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.role-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--neo-shadow-lg);
}
.role-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.role-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}
.role-card-name {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: #333;
}
.role-card-desc {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 12px;
    line-height: 1.5;
}
.role-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}
.role-card-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: #555;
}
.role-card-stat i {
    font-size: 0.8rem;
}
.role-card-coverage {
    margin-bottom: 14px;
}
.role-card-coverage .progress {
    border-radius: 3px;
    background: #f0f0f0;
}
.role-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-wrap: wrap;
}
.badge-outline-secondary {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    font-weight: 500;
}

/* ── Compare Table (Modal) ── */
.role-compare-table {
    font-size: 0.85rem;
}
.role-compare-table thead th {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
}
.compare-module-col {
    min-width: 220px;
}
.compare-role-col {
    min-width: 120px;
}
.compare-module-row td {
    background: #f0f4ff !important;
    font-size: 0.82rem;
}

/* ── Module Quick-Filter Pills ── */
.module-pills-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.module-pills {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    padding: 2px 0;
    min-width: max-content;
}
.module-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 50px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #555;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.module-pill:hover {
    background: #f0f4ff;
    border-color: #6366f1;
    color: #6366f1;
}
.module-pill.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}
.module-pill i {
    font-size: 0.75rem;
}

/* ── Module Coverage Bar ── */
.module-coverage-bar {
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding-bottom: 8px;
}
.module-coverage-bar .progress {
    border-radius: 2px;
    background: #f0f0f0;
    height: 4px;
}
.module-coverage-bar .progress-bar {
    transition: width 0.3s ease;
}

/* ── Module Highlight Animation ── */
.perm-module-highlight {
    animation: moduleHighlightPulse 1.5s ease;
}
@keyframes moduleHighlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(99,102,241,0.15); }
    100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

/* ── Badge Pulse Animation ── */
.badge-pulse {
    animation: badgePop 0.4s ease;
}
@keyframes badgePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ── Unsaved Changes Badge ── */
#unsavedBadge {
    font-size: 0.75rem;
    padding: 5px 10px;
    animation: unsavedPulse 2s ease-in-out infinite;
}
@keyframes unsavedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Print for Roles ── */
@media print {
    .role-stat-card { box-shadow: none !important; border: 1px solid #dee2e6; }
    .role-card { box-shadow: none !important; border: 1px solid #dee2e6; transform: none !important; }
    .module-pills-wrapper { display: none !important; }
    #unsavedBadge, #toggleAllModules, #compareModal { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   Chart of Accounts – Professional Tree View
   ═══════════════════════════════════════════════════════════════ */

/* ── Stats Cards ── */
.coa-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg, 16px);
    background: var(--card-bg, #e0e5ec);
    box-shadow: var(--neo-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.coa-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--neo-shadow-lg);
}
.coa-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.coa-stat-card:hover .coa-stat-icon { transform: scale(1.05); }
.coa-stat-info h4 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.15;
    color: var(--text-primary, #1a365d);
    letter-spacing: -0.3px;
}
.coa-stat-info small {
    font-size: 0.75rem;
    color: var(--text-muted, #5a80a8);
    font-weight: 600;
}
.coa-stat-balance {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
}

/* ── Toolbar ── */
.coa-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: var(--card-bg, #fff);
    box-shadow: var(--neo-shadow); border: none;
    margin-bottom: 1.25rem;
}
.coa-search {
    flex: 1;
    min-width: 200px;
}

/* ── Tree Container ── */
.coa-tree-card {
    border-radius: 12px;
    background: var(--card-bg, #fff);
    box-shadow: var(--neo-shadow);
    overflow: hidden;
}
.coa-tree-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Tree Table ── */
.coa-tree-table {
    width: 100%;
    border-collapse: collapse;
}
.coa-tree-table thead th {
    padding: 0.65rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    border-bottom: 2px solid rgba(0,0,0,0.08);
    white-space: nowrap;
    background: rgba(240,244,248,0.5);
}
.coa-tree-table tbody tr {
    transition: background 0.15s ease;
}
.coa-tree-table tbody tr:hover {
    background: rgba(99,102,241,0.04);
}
.coa-tree-table tbody td {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}

/* ── Type-colored left border ── */
.coa-row-asset     { border-left: 3px solid #6366f1; }
.coa-row-liability { border-left: 3px solid #f59e0b; }
.coa-row-equity    { border-left: 3px solid #06b6d4; }
.coa-row-revenue   { border-left: 3px solid #10b981; }
.coa-row-expense   { border-left: 3px solid #ef4444; }

/* ── Header account rows ── */
.coa-tree-table tr.coa-is-header > td {
    background: rgba(240,244,248,0.6);
    font-weight: 600;
}
.coa-tree-table tr.coa-is-header .coa-account-name {
    font-weight: 700;
    color: #1f2937;
}

/* ── Tree indentation/connectors ── */
.coa-name-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}
.coa-indent {
    display: inline-flex;
    align-items: center;
    position: relative;
}
.coa-indent-level {
    width: 24px;
    height: 100%;
    display: inline-block;
    position: relative;
}
.coa-indent-level.coa-has-line::before {
    content: '';
    position: absolute;
    left: 11px;
    top: -12px;
    bottom: -12px;
    width: 1px;
    background: #cbd5e1;
}
[dir="rtl"] .coa-indent-level.coa-has-line::before {
    left: auto;
    right: 11px;
}
.coa-indent-connector {
    width: 24px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    position: relative;
}
.coa-indent-connector::before {
    content: '';
    position: absolute;
    left: 11px;
    top: -12px;
    height: 50%;
    width: 1px;
    background: #cbd5e1;
}
.coa-indent-connector::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 50%;
    width: 12px;
    height: 1px;
    background: #cbd5e1;
}
[dir="rtl"] .coa-indent-connector::before {
    left: auto;
    right: 11px;
}
[dir="rtl"] .coa-indent-connector::after {
    left: auto;
    right: 11px;
}
.coa-indent-connector.coa-last::before {
    height: calc(50% + 1px);
    border-bottom-left-radius: 3px;
}

/* ── Toggle Arrow ── */
.coa-toggle {
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(99,102,241,0.08);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    color: #6366f1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.coa-toggle:hover {
    background: rgba(99,102,241,0.18);
}
.coa-toggle.collapsed i {
    transform: rotate(-90deg);
}
[dir="rtl"] .coa-toggle.collapsed i {
    transform: rotate(90deg);
}
.coa-toggle i {
    transition: transform 0.2s ease;
}
.coa-spacer {
    width: 22px;
    height: 22px;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Account Name Group ── */
.coa-account-name {
    font-weight: 500;
    color: #374151;
}
.coa-account-name-ar {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 1px;
}
.coa-code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(99,102,241,0.08);
    color: #6366f1;
    letter-spacing: 0.02em;
}

/* ── Hidden rows (collapsed) ── */
.coa-tree-table tr.coa-hidden {
    display: none;
}

/* ── Search Highlight ── */
.coa-tree-table tr.coa-search-hide {
    display: none;
}
.coa-search-highlight {
    background: rgba(251,191,36,0.3);
    border-radius: 2px;
    padding: 0 2px;
}

/* ── Empty State ── */
.coa-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.coa-empty-icon {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

/* ── Print styles ── */
@media print {
    .coa-stat-card { box-shadow: none !important; border: 1px solid #dee2e6; }
    .coa-toolbar { display: none !important; }
    .coa-tree-card { box-shadow: none !important; border: 1px solid #dee2e6; }
    .coa-toggle { display: none !important; }
    .coa-tree-table tr.coa-hidden { display: table-row !important; }
    .action-btns { display: none !important; }
    .page-actions { display: none !important; }
    .coa-tree-table tbody td { padding: 0.35rem 0.5rem; font-size: 0.78rem; }
    .coa-tree-card-header .btn { display: none !important; }
}

/* ============================================================
   NEUMORPHIC ANIMATIONS & EFFECTS
   ============================================================ */

/* ── Button Ripple Effect ── */
.btn {
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}
.btn:active::after {
    width: 200px; height: 200px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}

/* ── Nav Tab Smooth Indicator ── */
.nav-tabs {
    border-bottom: none;
    gap: 0.35rem;
    padding: 0.35rem;
    background: var(--body-bg);
    border-radius: 14px;
    box-shadow: var(--neo-inset-sm);
    display: inline-flex;
    flex-wrap: wrap;
}
.nav-tabs .nav-link {
    border: none;
    border-radius: 11px;
    padding: 0.5rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    transition: color 0.3s ease, box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}
.nav-tabs .nav-link.active {
    color: var(--primary);
    background: var(--card-bg);
    box-shadow: var(--neo-shadow-sm);
}
.nav-tabs .nav-link:not(.active):hover {
    color: var(--text-primary);
    background: rgba(0,0,0,0.02);
}
.nav-tabs .nav-item .badge { font-size: 0.65rem; margin-left: 0.35rem; }

/* ── Tooltip neumorphic ── */
.tooltip-inner {
    background: var(--body-bg);
    color: var(--text-primary);
    box-shadow: var(--neo-shadow-sm);
    border-radius: 10px;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}
.tooltip .tooltip-arrow::before { border-top-color: var(--body-bg); }

/* ── Badge Pulse for notifications ── */
.badge-notification {
    animation: shadowBreath 2s ease-in-out infinite;
}

/* ── Smooth page content entry ── */
#content {
    animation: fadeIn 0.35s ease-out both;
}

/* ── Dark mode skeleton override ── */
[data-theme="dark"] .neo-skeleton::after {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
    background-size: 200% 100%;
}

/* ── Reduced Motion (Accessibility) ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .animate-float, .animate-pulse, .animate-glow, .badge-notification {
        animation: none !important;
    }
}

/* ============================================================
   AUTO-ENHANCE: Cards with filters/forms (consistency fallback)
   ============================================================ */
.card:has(> .card-body > form[method="GET"]),
.card:has(> .card-body > form.d-flex) {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.card:has(> .card-body > form[method="GET"]) .card-body,
.card:has(> .card-body > form.d-flex) .card-body {
    padding: 1.5rem;
}
.card:has(> .card-body > form[method="GET"]) .form-group,
.card:has(> .card-body > form.d-flex) .form-group {
    flex: 1;
    min-width: 160px;
}
.card:has(> .card-body > form[method="GET"]) .form-group label,
.card:has(> .card-body > form.d-flex) .form-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

/* Auto-enhance: Cards with tables */
.card:has(> .card-body > .table-responsive),
.card:has(> .card-body > table),
.card:has(> .table-responsive) {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
    overflow: visible;
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
.card:has(> .card-body > .table-responsive):hover,
.card:has(> .card-body > table):hover,
.card:has(> .table-responsive):hover {
    box-shadow: var(--neo-shadow-md);
}

/* Auto-enhance: Card headers consistency */
.card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card .card-header h5,
.card .card-header h6,
.card .card-header .card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin: 0;
}
.card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 0.85rem 1.5rem;
}

/* ============================================================
   ENHANCED FORM ELEMENTS (global consistency)
   ============================================================ */
.form-group {
    margin-bottom: 1.15rem;
    position: relative;
}
.form-group label:not(.form-check-label) {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
    letter-spacing: 0.2px;
    display: block;
}
.form-group .form-control,
.form-group .form-select {
    border: none;
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: var(--neo-inset-sm);
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    color: var(--text-primary);
}
.form-group .form-control:focus,
.form-group .form-select:focus {
    border-color: transparent;
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.15);
    outline: none;
}
.form-group .input-group-text {
    background: var(--card-bg);
    border: none;
    box-shadow: var(--neo-shadow-sm);
    color: var(--primary);
    font-size: 0.85rem;
}
.form-group .form-text,
.form-group .help-block {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* BS4 form-row → modern flex row with gap */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-left: 0;
    margin-right: 0;
}
.form-row > [class*="col"] {
    padding-left: 0;
    padding-right: 0;
}

/* BS4 custom-file → modern file input */
.custom-file {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.custom-file-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 42px;
    opacity: 0;
    cursor: pointer;
}
.custom-file-label {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 42px;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius);
    box-shadow: var(--neo-inset);
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: all 0.25s ease;
    cursor: pointer;
}
.custom-file-label::after {
    content: 'استعراض';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius) 0 0 var(--radius);
}
.custom-file-input:focus ~ .custom-file-label {
    border-color: var(--primary);
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.1);
}

/* select.form-control → auto-style as form-select */
select.form-control {
    appearance: auto;
    -webkit-appearance: auto;
    padding-right: 2rem;
}

textarea.form-control { min-height: 80px; resize: vertical; }

/* ── Global Consistency Overrides ──────────────────────────── */
/* Normalize form-control-sm to match standard size */
.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: var(--neo-inset);
    height: auto;
    min-height: 38px;
}
.form-control-sm:focus {
    border-color: var(--primary);
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.1);
}

/* Normalize btn-info to match primary gradient */
.btn-info {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
}
.btn-info:hover, .btn-info:focus {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-primary);
    transform: translateY(-1px);
}

/* Normalize btn-sm inside page areas */
.filters-card .btn-sm,
.table-card .btn-sm,
.page-actions .btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
}

/* Action buttons in tables */
.btn-action, .action-btns .btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    font-size: 0.82rem;
    transition: all 0.25s ease;
}
.action-btns .btn:hover, .btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.action-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Global table styling consistency */
.table > thead > tr > th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    white-space: nowrap;
    border-bottom-width: 2px;
}
.table > tbody > tr > td {
    font-size: 0.85rem;
    vertical-align: middle;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Escape hatch: opt a specific cell back into text wrapping when it holds
   genuinely long free-form text (e.g. a description/notes column) where
   forcing nowrap would be worse than wrapping. */
.cell-wrap {
    white-space: normal !important;
}
.table > tbody > tr {
    transition: background 0.2s ease;
}

/* Badge consistency - old badge-* → modern look */
.badge-primary   { background: rgba(99,102,241,0.15) !important; color: var(--primary) !important; }
.badge-success   { background: rgba(16,185,129,0.15) !important; color: var(--success) !important; }
.badge-danger    { background: rgba(239,68,68,0.15) !important; color: var(--danger) !important; }
.badge-warning   { background: rgba(245,158,11,0.18) !important; color: #b45309 !important; }
.badge-info      { background: rgba(6,182,212,0.15) !important; color: #0e7490 !important; }
.badge-secondary { background: rgba(100,116,139,0.15) !important; color: var(--secondary) !important; }

/* Consistent card transitions */
.table-card, .form-card, .filters-card {
    transition: box-shadow 0.3s ease;
}

/* Enhanced select2 to match neumorphic style */
.select2-container--default .select2-selection--single {
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: var(--radius) !important;
    background: var(--card-bg) !important;
    box-shadow: var(--neo-inset) !important;
    height: 42px !important;
    padding: 6px 12px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    color: var(--text-primary) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
}
.select2-dropdown {
    border: none !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--neo-shadow-md) !important;
    background: var(--card-bg) !important;
}
.select2-container--default .select2-selection--multiple {
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: var(--radius) !important;
    background: var(--card-bg) !important;
    box-shadow: var(--neo-inset) !important;
    min-height: 42px !important;
}

/* Enhanced DataTables search and controls */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
    padding: 0.4rem 0.8rem;
    transition: all 0.3s ease;
}
.dataTables_wrapper .dataTables_filter input:focus {
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.15);
    outline: none;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
    padding: 0.3rem 0.6rem;
}

/* ============================================================
   ENHANCED TAB PANELS (consistency)
   ============================================================ */
.tab-content > .tab-pane { padding: 1.25rem 0; }
.tab-content > .tab-pane .card { margin-bottom: 1rem; }

/* ============================================================
   ENHANCED BREADCRUMBS (neumorphic)
   ============================================================ */
.breadcrumb {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--neo-inset);
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
}
.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb-item.active {
    color: var(--text-muted);
    font-weight: 600;
}

/* ============================================================
   ENHANCED STATUS LABELS & INDICATORS
   ============================================================ */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.status-dot.active, .status-dot.success { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.status-dot.inactive, .status-dot.danger { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.status-dot.pending, .status-dot.warning { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }

/* Text truncation utility */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   ENHANCED PAGE CONTENT SPACING
   ============================================================ */
.content-wrapper { padding: 1.5rem; }
@media (max-width: 768px) {
    .content-wrapper { padding: 1rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .page-actions { width: 100%; }
    .page-actions .btn { width: 100%; justify-content: center; }
}

/* Dark mode: auto-enhanced elements */
[data-theme="dark"] .card .card-header { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .card .card-footer { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .breadcrumb {
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
}
/* Dark mode: select2 default theme (legacy) */
[data-theme="dark"] .select2-container--default .select2-selection--single {
    background: var(--card-bg) !important;
    box-shadow: var(--neo-inset) !important;
    border-color: rgba(255,255,255,0.08) !important;
    border-right-color: var(--primary) !important;
}
[data-theme="dark"] .select2-container--default .select2-selection--single:hover {
    border-color: rgba(129,140,248,0.3) !important;
    border-right-color: var(--primary) !important;
}
[data-theme="dark"] .input-group .select2-container--default .select2-selection--single {
    border-right-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .select2-dropdown {
    background: var(--card-bg) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background: var(--card-bg) !important;
    box-shadow: var(--neo-inset) !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-primary);
}
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   COMPREHENSIVE GLOBAL ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ---- Enhanced form-card Styles ---- */
.form-card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 1.1rem 1.5rem;
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius) var(--radius) 0 0;
}
.form-card-header h5, .form-card-header h6 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-card-header h5 i, .form-card-header h6 i { color: var(--primary); }
.form-card-body { padding: 1.5rem; }
.form-card-footer {
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---- Enhanced table-card Styles ---- */
.table-card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 1.1rem 1.5rem;
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius) var(--radius) 0 0;
}
.table-card-header h5, .table-card-header h6, .table-card-header .card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.table-card-header h5 i, .table-card-header h6 i { color: var(--primary); }
.table-card-body { padding: 1.5rem; }
.table-card-body.p-0 { padding: 0 !important; }
.table-card-footer {
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---- Form Enhancements (Horizontal Forms) ---- */
.form-group.row {
    margin-bottom: 0;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    align-items: center;
}
.form-group.row:last-of-type,
.form-group.row.mb-0 {
    border-bottom: none;
}
.form-group.row > .col-form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
    padding-top: 0;
    padding-bottom: 0;
}
.form-group.row > .col-form-label .text-danger {
    font-size: 0.9em;
}
.form-group.row > [class*="col-sm-"],
.form-group.row > [class*="col-md-"] {
    padding-top: 0;
    padding-bottom: 0;
}
.form-horizontal .form-group:last-child { margin-bottom: 0; }
/* Horizontal form submit area */
.form-group.row .offset-sm-3 {
    padding-top: 0.5rem;
}
.form-group.row .offset-sm-3 .btn-primary {
    padding: 0.55rem 1.75rem;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}
.form-group.row .offset-sm-3 .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99,102,241,0.35);
}
/* Better horizontal form on small forms (inside form-card) */
.form-card-body .form-horizontal .form-group.row,
.form-card-body > form > .form-group.row {
    padding: 0.75rem 0.25rem;
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.form-card-body .form-horizontal .form-group.row:hover,
.form-card-body > form > .form-group.row:hover {
    background: rgba(99,102,241,0.03);
}
.form-card .form-control,
.form-card .form-select,
.form-card-body .form-control,
.form-card-body .form-select {
    border-radius: 12px;
    border: none;
    box-shadow: var(--neo-inset-sm);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
}
.form-card .form-control:focus,
.form-card .form-select:focus,
.form-card-body .form-control:focus,
.form-card-body .form-select:focus {
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.15);
    border-color: transparent;
}
.form-card .form-control::placeholder { color: var(--text-muted); opacity: 0.6; }
.form-card .form-check-input {
    width: 1.15em; height: 1.15em;
    box-shadow: var(--neo-inset);
    border-color: rgba(0,0,0,0.1);
}
.form-card .form-check-label { font-size: 0.85rem; color: var(--text-secondary); }
.form-card textarea.form-control { min-height: 80px; resize: vertical; }

/* ---- Submit/Action Area in Forms ---- */
.form-card .form-group.row:last-child .col-sm-9,
.form-card .form-card-body > form > .row:last-child > div:last-child,
.form-card .form-card-body > form > .text-end,
.form-card .form-card-body > form > .text-right {
    padding-top: 0.5rem;
}
.form-card .btn-primary,
.form-card-body .btn-primary {
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: var(--neo-shadow-sm);
    transition: all 0.25s ease;
}
.form-card .btn-primary:hover,
.form-card-body .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--neo-shadow);
}

/* ============================================================
   FORM CONSISTENCY: Auto-enhance all forms to unified design
   (footer now handled by horizontal grid system)
   ============================================================ */

/* ---- Consistent submit buttons in all forms ---- */
.form-card .btn[type="submit"],
.form-card-body .btn[type="submit"],
.form-card form .btn[type="submit"] {
    padding: 0.55rem 1.75rem;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    letter-spacing: 0.3px;
}
.form-card .btn[type="submit"]:hover,
.form-card-body .btn[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

/* ---- Consistent cancel/back buttons ---- */
.form-card .btn-outline-secondary,
.form-card .btn-secondary,
.form-card-body .btn-outline-secondary,
.form-card-body .btn-secondary {
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
}

/* ---- Consistent form labels everywhere ---- */
.form-card .col-form-label,
.form-card .form-label,
.form-card-body .col-form-label,
.form-card-body .form-label,
.form-card label:not(.form-check-label):not(.btn) {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}
.form-card .text-danger,
.form-card-body .text-danger {
    font-weight: 700;
}

/* ---- Consistent input-group styling ---- */
.form-card .input-group-text,
.form-card-body .input-group-text {
    background: var(--card-bg);
    border: none;
    box-shadow: var(--neo-shadow-sm);
    color: var(--primary);
    font-size: 0.85rem;
    border-radius: 12px 0 0 12px;
    min-width: 42px;
    justify-content: center;
}
[dir="rtl"] .form-card .input-group-text,
[dir="rtl"] .form-card-body .input-group-text {
    border-radius: 0 12px 12px 0;
}
.form-card .input-group > .form-control,
.form-card .input-group > .form-select,
.form-card-body .input-group > .form-control,
.form-card-body .input-group > .form-select {
    border-radius: 0 12px 12px 0;
}
[dir="rtl"] .form-card .input-group > .form-control,
[dir="rtl"] .form-card .input-group > .form-select,
[dir="rtl"] .form-card-body .input-group > .form-control,
[dir="rtl"] .form-card-body .input-group > .form-select {
    border-radius: 12px 0 0 12px;
}

/* ---- Consistent invalid-feedback ---- */
.form-card .invalid-feedback,
.form-card-body .invalid-feedback,
.form-card .is-invalid ~ .invalid-feedback {
    font-size: 0.76rem;
    font-weight: 500;
    margin-top: 0.35rem;
}
.form-card .is-invalid,
.form-card-body .is-invalid {
    border-color: #ef4444 !important;
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(239,68,68,0.1) !important;
}

/* ---- Consistent form horizontal spacing ---- */
.form-card .form-group.row {
    margin-bottom: 0;
}

/* ---- Consistent section separators inside forms ---- */
.form-card hr,
.form-card-body hr {
    border: none;
    border-top: 1px solid rgba(99,102,241,0.1);
    margin: 0.5rem 0;
    opacity: 1;
}

/* ---- Consistent small/help text ---- */
.form-card .form-text,
.form-card-body .form-text,
.form-card small.text-muted {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ---- Consistent select2 inside form-cards ---- */
.form-card .select2-container--default .select2-selection--single,
.form-card-body .select2-container--default .select2-selection--single {
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.08);
    border-right: 3px solid var(--primary);
    box-shadow: var(--neo-inset-sm);
    height: auto;
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.form-card .select2-container--default .select2-selection--single:hover,
.form-card-body .select2-container--default .select2-selection--single:hover {
    border-color: rgba(99,102,241,0.25);
    border-right-color: var(--primary);
}
.form-card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: auto;
    left: 8px;
    display: flex;
    align-items: center;
    color: var(--primary);
}
/* Input-group select2 inside form-card */
.form-card .input-group .select2-container--default .select2-selection--single,
.form-card-body .input-group .select2-container--default .select2-selection--single {
    border-right: 1px solid rgba(0,0,0,0.08);
}

/* ---- Auto-enhance info-card to match form-card ---- */
.info-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
    margin-bottom: 1.25rem;
}
.info-card-header,
.info-card .info-card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.info-card-header h5, .info-card-header h6 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.info-card-header h5 i, .info-card-header h6 i { color: var(--primary); }
.info-card-body,
.info-card .info-card-body {
    padding: 1.5rem;
}
.info-card .form-control,
.info-card .form-select {
    border-radius: 12px;
    border: none;
    box-shadow: var(--neo-inset-sm);
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.info-card .form-control:focus,
.info-card .form-select:focus {
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.15);
    border-color: transparent;
}

/* ---- Auto-enhance aform-card (alerts) to match ---- */
.aform-card {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--neo-shadow) !important;
    background: var(--card-bg) !important;
}
.aform-card .form-control,
.aform-card .form-select {
    border-radius: 12px;
    border: none;
    box-shadow: var(--neo-inset-sm);
    font-size: 0.85rem;
}

/* ---- Validation errors block styling ---- */
.form-card ~ .alert-danger,
.page-header ~ .alert-danger,
.alert-danger:has(+ .form-card) {
    border: none;
    border-radius: var(--radius);
    background: rgba(239,68,68,0.08);
    color: #dc2626;
    box-shadow: var(--neo-shadow-sm);
    font-size: 0.85rem;
    padding: 1rem 1.25rem;
}

/* ---- Dark mode form consistency ---- */
[data-theme="dark"] .form-card .input-group-text,
[data-theme="dark"] .form-card-body .input-group-text {
    background: var(--card-bg);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-muted);
}
[data-theme="dark"] .form-card .is-invalid {
    border-color: #f87171 !important;
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(248,113,113,0.15) !important;
}
[data-theme="dark"] .info-card { box-shadow: var(--neo-shadow); background: var(--card-bg); }
[data-theme="dark"] .info-card-header { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .info-card .form-control,
[data-theme="dark"] .info-card .form-select {
    border: none;
    box-shadow: var(--neo-inset-sm);
}

/* ---- Table Enhancements ---- */
.table-card .table,
.table-card-body .table {
    margin-bottom: 0;
}
.table-card .table thead th,
.table-card-body .table thead th {
    background: transparent;
    border-top: none;
    border-bottom: 2px solid rgba(0,0,0,0.06);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0.85rem 1.25rem;
    white-space: nowrap;
}
.table-card .table tbody td,
.table-card-body .table tbody td {
    vertical-align: middle;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.88rem;
    color: var(--text-primary);
}
.table-card .table tbody tr:last-child td { border-bottom: none; }
.table-card .table tbody tr {
    transition: background 0.2s ease;
}
.table-card .table tbody tr:hover {
    background: rgba(99,102,241,0.03);
}

/* ---- Action Buttons in Tables ---- */
.table .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 8px;
}
.table .btn-group .btn-sm { border-radius: 0; }
.table .btn-group .btn-sm:first-child { border-radius: 8px 0 0 8px; }
.table .btn-group .btn-sm:last-child { border-radius: 0 8px 8px 0; }
.table .btn-outline-primary,
.table .btn-outline-info,
.table .btn-outline-success,
.table .btn-outline-warning,
.table .btn-outline-danger {
    border-width: 1px;
    box-shadow: none;
}

/* ---- Status Badges Enhanced ---- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    padding: 0.35em 0.75em;
    border-radius: 6px;
}
.badge.rounded-pill { border-radius: 50rem; }
.badge i { font-size: 0.65rem; }

/* ---- Enhanced Alerts ---- */
.alert {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-sm);
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
    animation: fadeInUp 0.3s ease both;
}
.alert-success { background: rgba(16,185,129,0.08); color: #065f46; }
.alert-danger { background: rgba(239,68,68,0.08); color: #991b1b; }
.alert-warning { background: rgba(245,158,11,0.08); color: #92400e; }
.alert-info { background: rgba(6,182,212,0.08); color: #155e75; }
.alert .btn-close { opacity: 0.5; }

/* ---- Enhanced Modals ---- */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    background: var(--card-bg);
}
.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 1.25rem 1.5rem;
}
.modal-header .modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 1rem 1.5rem;
}
.modal-footer .btn { border-radius: 10px; font-weight: 600; }

/* ---- Empty States ---- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}
.empty-state .empty-icon,
.empty-state > i:first-child {
    font-size: 2.5rem;
    opacity: 0.15;
    margin-bottom: 1rem;
    display: block;
}
.empty-state h6 {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-size: 0.85rem;
    max-width: 300px;
    margin: 0 auto;
}

/* ---- Responsive Table Scroll Indicator ---- */
.table-responsive {
    position: relative;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---- Pagination Enhanced ---- */
.pagination {
    gap: 4px;
}
.page-item .page-link {
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    box-shadow: var(--neo-shadow-sm);
    padding: 0.4rem 0.75rem;
    transition: all 0.2s ease;
}
.page-item .page-link:hover {
    transform: translateY(-1px);
    box-shadow: var(--neo-shadow);
    color: var(--primary);
}
.page-item.active .page-link {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.page-item.disabled .page-link {
    opacity: 0.4;
    box-shadow: none;
}

/* ---- Tab Nav Enhanced ---- */
.nav-tabs {
    border-bottom: 2px solid rgba(0,0,0,0.06);
    gap: 4px;
}
.nav-tabs .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: all 0.25s ease;
    position: relative;
}
.nav-tabs .nav-link:hover { color: var(--primary); background: rgba(99,102,241,0.04); }
.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
}
.nav-pills .nav-link {
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: all 0.25s ease;
}
.nav-pills .nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ---- Print Preview Styles ---- */
.print-card,
.invoice-print,
.receipt-print,
.salary-slip,
.id-card-container {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
    overflow: hidden;
}

/* ---- Quick Action Grid (dashboards) ---- */
.qa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--neo-shadow-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.25s ease;
}
.qa-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--neo-shadow);
    text-decoration: none;
    color: var(--primary);
}
.qa-item i { font-size: 1.1rem; }

/* ---- Dashboard Stat Cards Enhanced ---- */
.dash-stat {
    border: none;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    box-shadow: var(--neo-shadow);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.dash-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--neo-shadow-md);
}
.stat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon-circle {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
}
.icon-grad-primary { background: linear-gradient(135deg, #6366f1, #818cf8); box-shadow: 0 6px 16px rgba(99,102,241,0.3); }
.icon-grad-success { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 6px 16px rgba(16,185,129,0.3); }
.icon-grad-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 6px 16px rgba(245,158,11,0.3); }
.icon-grad-info    { background: linear-gradient(135deg, #06b6d4, #22d3ee); box-shadow: 0 6px 16px rgba(6,182,212,0.3); }
.icon-grad-danger  { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 6px 16px rgba(239,68,68,0.3); }
.stat-info .stat-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
}
.stat-info .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.stat-footer {
    padding: 0.6rem 1.25rem;
    border-top: 1px solid rgba(0,0,0,0.04);
    background: rgba(0,0,0,0.01);
}
.stat-footer a {
    font-size: 0.78rem; font-weight: 600; color: var(--primary); text-decoration: none;
}
.stat-footer a:hover { text-decoration: underline; }

/* ---- Validation Errors Enhanced ---- */
.alert-danger ul { padding-left: 1rem; margin-bottom: 0; }
.alert-danger ul li { margin-bottom: 0.25rem; }
.is-invalid { box-shadow: var(--neo-inset), 0 0 0 3px rgba(239,68,68,0.1) !important; }
.invalid-feedback { font-size: 0.78rem; margin-top: 0.4rem; }

/* ---- Breadcrumb Enhanced ---- */
.breadcrumb {
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.breadcrumb-item { font-weight: 500; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }

/* ---- Dropdown Enhanced ---- */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-md);
    background: var(--card-bg);
    padding: 0.5rem;
    animation: fadeInUp 0.2s ease both;
}
.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
}
.dropdown-item:hover {
    background: rgba(99,102,241,0.06);
    color: var(--primary);
}
.dropdown-item i { width: 20px; text-align: center; margin-right: 0.5rem; }

/* ---- Tooltip Enhanced ---- */
.tooltip-inner {
    background: var(--text-primary);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ---- Report Cards Layout ---- */
.report-filter-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.report-filter-card label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 0.3rem;
}

/* ---- Welcome Banners ---- */
.welcome-banner {
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -15%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-banner .greeting {
    font-size: 1.3rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}
.welcome-banner .sub-greeting {
    font-size: 0.9rem;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}
.welcome-teacher {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    box-shadow: 6px 6px 14px rgba(99,102,241,0.35), -6px -6px 14px rgba(255,255,255,0.5);
}
.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}

/* ---- Chart Container ---- */
.chart-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    background: var(--card-bg);
    overflow: hidden;
}
.chart-container { position: relative; }

/* ---- Recent Card (dashboard lists) ---- */
.recent-card {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--neo-shadow) !important;
    background: var(--card-bg) !important;
    overflow: hidden;
}

/* ---- Stagger Animation for Rows ---- */
.row > [class*="col-"]:nth-child(1) > .form-card,
.row > [class*="col-"]:nth-child(1) > .table-card,
.row > [class*="col-"]:nth-child(1) > .dash-stat { animation-delay: 0.05s; }
.row > [class*="col-"]:nth-child(2) > .form-card,
.row > [class*="col-"]:nth-child(2) > .table-card,
.row > [class*="col-"]:nth-child(2) > .dash-stat { animation-delay: 0.1s; }
.row > [class*="col-"]:nth-child(3) > .form-card,
.row > [class*="col-"]:nth-child(3) > .table-card,
.row > [class*="col-"]:nth-child(3) > .dash-stat { animation-delay: 0.15s; }
.row > [class*="col-"]:nth-child(4) > .form-card,
.row > [class*="col-"]:nth-child(4) > .table-card,
.row > [class*="col-"]:nth-child(4) > .dash-stat { animation-delay: 0.2s; }

/* ---- Responsive Enhancements ---- */
@media (max-width: 768px) {
    .form-card-body,
    .table-card-body { padding: 1rem; }
    .form-card-header,
    .table-card-header { padding: 0.85rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .form-group.row > .col-form-label { padding-bottom: 0.25rem; }
    .page-header { padding: 1rem; }
    .page-actions { gap: 0.35rem; }
    .page-actions .btn { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
    .welcome-banner { padding: 20px; }
    .welcome-banner .greeting { font-size: 1.1rem; }
    .sp-stat-row { gap: 12px; }
    .sp-stat { min-width: 140px; padding: 18px 16px; }
    .qa-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dash-stat .card-body { padding: 18px 16px; }
    .stat-icon-circle { width: 42px; height: 42px; font-size: 1rem; }
    .stat-info .stat-value { font-size: 1.3rem; }
}
@media (max-width: 576px) {
    .page-header { flex-direction: column; text-align: center; }
    .page-actions { justify-content: center; }
    .sp-stat-row { flex-direction: column; }
    .sp-stat { min-width: auto; }
}

/* ---- Dark Mode for All New Elements ---- */
[data-theme="dark"] .form-card-header,
[data-theme="dark"] .table-card-header { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .form-card-footer,
[data-theme="dark"] .table-card-footer { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,0.12); color: #6ee7b7; }
[data-theme="dark"] .alert-danger { background: rgba(239,68,68,0.12); color: #fca5a5; }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,0.12); color: #fcd34d; }
[data-theme="dark"] .alert-info { background: rgba(6,182,212,0.12); color: #67e8f9; }
[data-theme="dark"] .modal-content {
    background: var(--card-bg);
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .dropdown-menu {
    background: var(--card-bg);
    box-shadow: var(--neo-shadow-md);
}
[data-theme="dark"] .dropdown-item:hover { background: rgba(99,102,241,0.12); }
[data-theme="dark"] .page-item .page-link {
    background: var(--card-bg);
    color: var(--text-secondary);
    box-shadow: var(--neo-shadow-sm);
}
[data-theme="dark"] .page-item.active .page-link { background: var(--primary); color: #fff; }
[data-theme="dark"] .breadcrumb {
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
}
[data-theme="dark"] .stat-footer { border-top-color: rgba(255,255,255,0.04); background: rgba(255,255,255,0.02); }
[data-theme="dark"] .qa-item { box-shadow: var(--neo-shadow-sm); }
[data-theme="dark"] .qa-item:hover { box-shadow: var(--neo-shadow); }
[data-theme="dark"] .nav-tabs { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .nav-tabs .nav-link:hover { background: rgba(99,102,241,0.08); }
[data-theme="dark"] .table-card .table thead th,
[data-theme="dark"] .table-card-body .table thead th { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .table-card .table tbody td,
[data-theme="dark"] .table-card-body .table tbody td { border-bottom-color: rgba(255,255,255,0.04); }
[data-theme="dark"] .table-card .table tbody tr:hover { background: rgba(99,102,241,0.06); }
[data-theme="dark"] .is-invalid { box-shadow: var(--neo-inset), 0 0 0 3px rgba(239,68,68,0.15) !important; }

/* ---- List Group Neumorphic ---- */
.list-group { border-radius: var(--radius); overflow: hidden; }
.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    background: transparent;
    transition: all 0.2s ease;
}
.list-group-item:last-child { border-bottom: none; }
.list-group-item-action:hover { background: rgba(99,102,241,0.04); }
.list-group-item-action:active { background: rgba(99,102,241,0.08); }
.list-group-item .fw-bold { font-size: 0.85rem; color: var(--text-primary); }
.list-group-item small { font-size: 0.75rem; }
.list-group-item i { opacity: 0.8; }
[data-theme="dark"] .list-group-item { border-bottom-color: rgba(255,255,255,0.04); }
[data-theme="dark"] .list-group-item-action:hover { background: rgba(99,102,241,0.08); }

/* ---- Accordion Neumorphic ---- */
.accordion-item {
    border: none;
    background: var(--card-bg);
    border-radius: var(--radius) !important;
    box-shadow: var(--neo-shadow-sm);
    margin-bottom: 0.75rem;
}
.accordion-button {
    background: transparent;
    border-radius: var(--radius) !important;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
    background: rgba(99,102,241,0.04);
    color: var(--primary);
}
.accordion-body { font-size: 0.88rem; }

/* ---- Progress Bar Neumorphic ---- */
.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--card-bg);
    box-shadow: var(--neo-inset);
    overflow: hidden;
}
.progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ---- Form Switch Neumorphic ---- */
.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    border-radius: 1rem;
    background-color: var(--card-bg);
    box-shadow: var(--neo-inset);
    border: none;
    cursor: pointer;
}
.form-switch .form-check-input:checked {
    background-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* ---- Avatar Circle (used in tables) ---- */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.avatar-circle.avatar-sm { width: 32px; height: 32px; font-size: 0.65rem; }
.avatar-circle.avatar-md { width: 42px; height: 42px; font-size: 0.78rem; }
.avatar-circle.avatar-lg { width: 56px; height: 56px; font-size: 1rem; }

/* ---- Color Utilities ---- */
.bg-purple-light { background: rgba(139,92,246,0.12); }
.text-purple { color: #8b5cf6; }
.bg-teal-light { background: rgba(20,184,166,0.12); }
.text-teal { color: #14b8a6; }
.bg-orange-light { background: rgba(249,115,22,0.12); }
.text-orange { color: #f97316; }
.bg-primary-light { background: rgba(99,102,241,0.12); }

/* ---- Skeleton Loading ---- */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--card-bg) 25%, rgba(0,0,0,0.04) 50%, var(--card-bg) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ---- Scrollbar Neumorphic ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---- Selection Color ---- */
::selection { background: rgba(99,102,241,0.2); color: var(--text-primary); }

/* ---- Focus Ring ---- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   PROFESSIONAL PAGE DESIGN SYSTEM (Match Student Form Style)
   ═══════════════════════════════════════════════════════════════ */

/* ---- Page Icon Enhancement ---- */
.page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 80%, #000));
    color: #fff;
    font-size: 1.1rem;
    margin-left: 0.75rem;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
    flex-shrink: 0;
}
.page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}
.page-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
    padding-right: 3.25rem;
}

/* ---- Enhanced Page Header ---- */
.page-header {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--neo-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.page-actions .btn {
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    box-shadow: var(--neo-shadow-sm);
}

/* ---- Enhanced form-card Header ---- */
.form-card .form-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid rgba(99,102,241,0.08);
    background: linear-gradient(135deg, rgba(99,102,241,0.03), rgba(99,102,241,0.01));
}
.form-card .form-card-header h6 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.form-card .form-card-header h6 i {
    font-size: 1rem;
    color: var(--primary);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.1);
    border-radius: 8px;
}

/* ---- Enhanced Form Layout ---- */
.form-card .form-card-body .form-group.row {
    padding: 0.65rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.form-card .form-card-body .form-group.row:last-of-type {
    border-bottom: none;
}
.form-card .form-card-body .col-form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.form-card .form-card-body .col-form-label .text-danger {
    font-size: 0.7rem;
    vertical-align: super;
}

/* ---- Enhanced Form Controls ---- */
.form-card .form-control,
.form-card .form-select {
    border-radius: 12px;
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    border: none;
    background: var(--card-bg);
    box-shadow: var(--neo-inset-sm);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.form-card .form-control:focus,
.form-card .form-select:focus {
    border-color: transparent;
    box-shadow: var(--neo-inset), 0 0 0 3px rgba(99,102,241,0.15);
}

/* ---- Input Group Icon Styling ---- */
.form-card .input-group .input-group-text {
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.03));
    border: none;
    border-radius: 12px 0 0 12px;
    color: var(--primary);
    font-size: 0.85rem;
    min-width: 42px;
    justify-content: center;
    box-shadow: var(--neo-shadow-sm);
}
[dir="rtl"] .form-card .input-group .input-group-text {
    border-radius: 0 12px 12px 0;
}

/* ---- Enhanced Table Card Header ---- */
.table-card .table-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid rgba(99,102,241,0.08);
    background: linear-gradient(135deg, rgba(99,102,241,0.03), rgba(99,102,241,0.01));
}
.table-card .table-card-header h6 i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.1);
    border-radius: 8px;
    font-size: 0.85rem;
}

/* ---- Auto Form Footer (handled by horizontal grid system below) ---- */
.form-card .form-card-body form > hr {
    border-color: rgba(99,102,241,0.08);
    margin: 0.25rem 0;
    opacity: 1;
}

/* ---- Submit Button Enhancement ---- */
.form-card .btn-primary {
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 85%, #000));
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.55rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
    transition: all 0.3s ease;
}
.form-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
}

/* ---- Info Card Enhancement (view/detail pages) ---- */
.info-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    border: none;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.info-card .card-header,
.info-card .info-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid rgba(99,102,241,0.08);
    background: linear-gradient(135deg, rgba(99,102,241,0.03), rgba(99,102,241,0.01));
    font-weight: 700;
    font-size: 0.92rem;
}
.info-card .card-header i,
.info-card .info-card-header i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.1);
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.85rem;
}

/* ---- Enhanced Detail Table (th/td pairs) ---- */
.info-card table.table th {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    width: 35%;
    padding: 0.85rem 1rem;
    background: rgba(0,0,0,0.01);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.info-card table.table td {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* ---- Form Text & Hints ---- */
.form-card .form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.form-card .form-text::before {
    content: '\f05a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: var(--primary);
    opacity: 0.6;
}

/* ---- Validation Error Styling ---- */
.alert-danger {
    border-radius: var(--radius);
    border: none;
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.04));
    color: var(--danger, #dc3545);
    box-shadow: var(--neo-shadow-sm);
    font-size: 0.85rem;
    padding: 1rem 1.25rem;
}
.alert-danger strong {
    font-weight: 700;
    display: block;
    margin-bottom: 0.35rem;
}

/* ---- Enhanced Stat/Summary Cards ---- */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--neo-shadow-lg, var(--neo-shadow));
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ---- Empty State Enhancement ---- */
.dataTables_empty,
.empty-state {
    padding: 3rem 1rem !important;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 768px) {
    .page-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .page-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .page-title {
        font-size: 1.1rem;
    }
    .form-card .form-card-body {
        padding: 1rem;
    }
    .form-card .form-card-body .form-group.row {
        padding: 0.5rem 0;
    }
    .form-card .form-card-body .col-form-label {
        margin-bottom: 0.35rem;
    }
}

/* ---- Dark Mode Professional Enhancements ---- */
[data-theme="dark"] .page-icon {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
[data-theme="dark"] .page-header {
    box-shadow: var(--neo-shadow);
    border: 1px solid rgba(255,255,255,0.05);
}
[data-theme="dark"] .form-card .form-card-header {
    border-bottom-color: rgba(255,255,255,0.06);
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02));
}
[data-theme="dark"] .form-card .form-card-header h6 i {
    background: rgba(99,102,241,0.15);
}
[data-theme="dark"] .form-card .form-card-body .form-group.row {
    border-bottom-color: rgba(255,255,255,0.04);
}
[data-theme="dark"] .form-card .input-group .input-group-text {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.05));
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .table-card .table-card-header,
[data-theme="dark"] .info-card .card-header,
[data-theme="dark"] .info-card .info-card-header {
    border-bottom-color: rgba(255,255,255,0.06);
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02));
}
[data-theme="dark"] .info-card table.table th {
    background: rgba(255,255,255,0.02);
    border-bottom-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .info-card table.table td {
    border-bottom-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .alert-danger {
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06));
}
[data-theme="dark"] .form-card .form-card-body form > .form-group.row:last-child,
[data-theme="dark"] .form-card .form-card-body form > hr + .form-group.row {
    background: linear-gradient(135deg, rgba(99,102,241,0.04), transparent);
    border-top-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .form-card .form-card-body form > hr {
    border-color: rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════════════════════════════
   HORIZONTAL MULTI-COLUMN LAYOUT SYSTEM
   Converts vertical form-group rows to horizontal grid layout
   ═══════════════════════════════════════════════════════════════ */

/* ---- Form Grid: 2-column layout for all forms ---- */
.form-card-body > form,
.form-card-body > form.form-horizontal {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 1.5rem;
    align-items: start;
}

/* Each form-group becomes a grid cell with label on top */
.form-card-body > form > .form-group.row {
    display: flex;
    flex-direction: column;
    padding: 0.65rem 0;
    margin: 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    align-items: stretch;
}

/* Override Bootstrap col-sm-3/col-sm-9 to be full width within cell */
.form-card-body > form > .form-group.row > .col-sm-3,
.form-card-body > form > .form-group.row > label.col-sm-3,
.form-card-body > form > .form-group.row > label[class*="col-sm-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}
.form-card-body > form > .form-group.row > .col-sm-9,
.form-card-body > form > .form-group.row > .col-sm-6,
.form-card-body > form > .form-group.row > .col-sm-4,
.form-card-body > form > .form-group.row > .col-sm-8,
.form-card-body > form > .form-group.row > div[class*="col-sm-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
}

/* Full-width elements spanning both columns */
.form-card-body > form > hr {
    grid-column: 1 / -1;
    border-color: rgba(99,102,241,0.1);
    margin: 0.5rem 0;
    opacity: 1;
}

/* Submit/action row → full width */
.form-card-body > form > .form-group.row:last-child,
.form-card-body > form > .form-group.row.mb-0 {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0 0.25rem;
    margin-top: 0.5rem;
    border-top: 2px solid rgba(99,102,241,0.08);
    border-bottom: none;
    background: linear-gradient(135deg, rgba(99,102,241,0.02), transparent);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.form-card-body > form > .form-group.row:last-child > .col-sm-3,
.form-card-body > form > .form-group.row.mb-0 > .col-sm-3 {
    display: none !important;
}
.form-card-body > form > .form-group.row:last-child > .col-sm-9,
.form-card-body > form > .form-group.row:last-child > div[class*="col-sm-"],
.form-card-body > form > .form-group.row:last-child > div[class*="offset-"],
.form-card-body > form > .form-group.row.mb-0 > .col-sm-9,
.form-card-body > form > .form-group.row.mb-0 > div[class*="col-sm-"],
.form-card-body > form > .form-group.row.mb-0 > div[class*="offset-"] {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Textarea fields → full width spanning both columns */
.form-card-body > form > .form-group.row:has(textarea) {
    grid-column: 1 / -1;
}

/* File upload fields → full width */
.form-card-body > form > .form-group.row:has(input[type="file"]) {
    grid-column: 1 / -1;
}

/* Custom content rows → full width */
.form-card-body > form > .row,
.form-card-body > form > .row.g-3,
.form-card-body > form > .mb-3,
.form-card-body > form > .mb-4,
.form-card-body > form > .alert,
.form-card-body > form > p,
.form-card-body > form > h5,
.form-card-body > form > h6,
.form-card-body > form > .form-section-title,
.form-card-body > form > div:not(.form-group) {
    grid-column: 1 / -1;
}

/* ---- Detail/View Pages: Horizontal info-table ---- */
.info-table {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}
.info-table tr {
    display: flex;
    flex-direction: column;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.info-table tr th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0 0.3rem 0;
    border: none;
    background: transparent;
    white-space: nowrap;
}
.info-table tr td {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0;
    border: none;
    background: transparent;
    word-break: break-word;
}

/* Detail tables inside info-card (key-value pairs only, not data tables with thead) */
.info-card .info-table,
.info-card table.info-table {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    width: 100%;
}
.info-card .info-table tr,
.info-card table.info-table tr {
    display: flex;
    flex-direction: column;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.info-card .info-table tr th,
.info-card table.info-table tr th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0 0.25rem 0;
    border: none;
    background: transparent;
}
.info-card .info-table tr td,
.info-card table.info-table tr td {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0;
    border: none;
    background: transparent;
}

/* Detail-table (admission view) already horizontal - enhance */
.detail-table {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1.5rem;
}
.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ---- Standard DataTables list pages → full width ---- */
.table-card .table-responsive {
    overflow-x: auto;
}
.table-card table.dataTable {
    width: 100% !important;
}

/* ---- Responsive: Single column on mobile ---- */
@media (max-width: 768px) {
    .form-card-body > form,
    .form-card-body > form.form-horizontal {
        grid-template-columns: 1fr;
    }
    .form-card-body > form > .form-group.row:has(textarea),
    .form-card-body > form > .form-group.row:has(input[type="file"]) {
        grid-column: 1;
    }
    .info-table,
    .info-card .info-table,
    .detail-table {
        grid-template-columns: 1fr;
    }
}

/* ---- 3-column layout for wide screens ---- */
@media (min-width: 1400px) {
    .form-card-body > form,
    .form-card-body > form.form-horizontal {
        grid-template-columns: repeat(3, 1fr);
    }
    .form-card-body > form > .form-group.row:last-child,
    .form-card-body > form > .form-group.row.mb-0,
    .form-card-body > form > .form-group.row:has(textarea),
    .form-card-body > form > .form-group.row:has(input[type="file"]),
    .form-card-body > form > hr,
    .form-card-body > form > .row,
    .form-card-body > form > div:not(.form-group) {
        grid-column: 1 / -1;
    }
}

/* ---- Dark mode for horizontal layout ---- */
[data-theme="dark"] .form-card-body > form > .form-group.row {
    border-bottom-color: rgba(255,255,255,0.04);
}
[data-theme="dark"] .form-card-body > form > .form-group.row:last-child,
[data-theme="dark"] .form-card-body > form > .form-group.row.mb-0 {
    border-top-color: rgba(255,255,255,0.08);
    background: linear-gradient(135deg, rgba(99,102,241,0.04), transparent);
}
[data-theme="dark"] .form-card-body > form > hr {
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .info-table tr,
[data-theme="dark"] .info-card .info-table tr {
    border-bottom-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .detail-table .detail-row {
    border-bottom-color: rgba(255,255,255,0.05);
}

/* ═══════════════════════════════════════════════════════════════
   PROFESSIONAL DESIGN POLISH — System-wide enhancement layer
   ═══════════════════════════════════════════════════════════════ */

/* ---- Refined Content Wrapper ---- */
.content-wrapper {
    padding: 1.75rem 2rem;
    animation: fadeIn 0.4s ease-out;
}

/* ---- Sidebar Polish ---- */
#sidebar {
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    border-right: 1px solid var(--border-color);
}
#sidebar .sidebar-header h5 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.1rem;
}
#sidebar .sidebar-header h5 i {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
#sidebar .sidebar-menu > .nav-item > .nav-link:hover {
    background: rgba(0,0,0,0.04);
    box-shadow: var(--neo-shadow-sm);
    color: var(--primary);
    padding-left: 1.15rem;
    border-left-color: rgba(99,102,241,0.3);
}
#sidebar.collapsed .sidebar-menu > .nav-item > .nav-link:hover {
    padding-left: 0;
}
#sidebar .sidebar-menu > .nav-item > .nav-link.active {
    position: relative;
}
#sidebar .sidebar-menu > .nav-item > .nav-link.active::before {
    content: '';
    position: absolute;
    top: 6px; bottom: 6px; left: 0;
    width: 3px;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}
.sidebar-user-widget .user-avatar-initials {
    background: var(--gradient-accent);
    box-shadow: 0 3px 10px rgba(99,102,241,0.3);
}

/* ---- Navbar Professional ---- */
.navbar .nav-link {
    position: relative;
    transition: var(--transition);
}
.navbar .nav-link:hover {
    color: var(--primary) !important;
}
.navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--neo-shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
    padding: 0.5rem 0;
    animation: dropdownFadeIn 0.25s ease-out;
}
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Table Rows Polish ---- */
.table tbody tr {
    transition: all 0.2s ease;
}
.table-hover tbody tr:hover {
    background: rgba(99,102,241,0.05);
    box-shadow: inset 3px 0 0 var(--primary);
}
.table-hover tbody tr:hover td:first-child {
    color: var(--primary);
    font-weight: 600;
}

/* ---- Card Header Icons Gradient ---- */
.card-header h5 i,
.card-header h6 i,
.form-card-header h5 i,
.form-card-header h6 i,
.table-card-header h5 i,
.table-card-header h6 i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Enhanced Stat Card (Dashboard) ---- */
.dash-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient-primary);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.dash-stat:hover::before { opacity: 1; }
.dash-stat .stat-icon-circle {
    border-radius: 16px;
    transition: var(--transition-bounce);
}
.dash-stat:hover .stat-icon-circle {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.dash-stat .stat-value {
    background: var(--gradient-dark);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Filters Card Polish ---- */
.filters-card::before {
    height: 3px;
    background: var(--gradient-accent);
    background-size: 200% 100%;
}
.filters-card .filter-item label {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.filters-card .filter-actions .btn-primary {
    background: var(--gradient-primary);
    box-shadow: var(--glow-primary);
}

/* ---- Form Controls Enhanced Focus ---- */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--neo-inset-sm), 0 0 0 3px rgba(99,102,241,0.12), var(--glow-primary);
}
.form-select:focus {
    border-color: var(--primary);
    box-shadow: var(--neo-inset-sm), 0 0 0 3px rgba(99,102,241,0.12), var(--glow-primary);
}

/* ---- Input Group Polish ---- */
.input-group .input-group-text {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px 0 0 12px;
    box-shadow: var(--glow-primary);
}
[dir="rtl"] .input-group .input-group-text {
    border-radius: 0 12px 12px 0;
}

/* ---- Pagination Polish ---- */
.pagination .page-link {
    border: none;
    border-radius: 10px !important;
    margin: 0 2px;
    box-shadow: var(--neo-shadow-sm);
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
    padding: 0.4rem 0.75rem;
}
.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-primary);
    border: none;
}
.pagination .page-link:hover {
    box-shadow: var(--neo-inset-sm);
    color: var(--primary);
}
.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    box-shadow: none;
}

/* ---- Progress Bar Polish ---- */
.progress {
    background: var(--body-bg);
    box-shadow: var(--neo-inset-sm);
    border-radius: 50px;
    overflow: hidden;
}
.progress-bar {
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.72rem;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-bar.bg-success { background: var(--gradient-success) !important; }
.progress-bar.bg-warning { background: var(--gradient-warning) !important; }
.progress-bar.bg-danger { background: var(--gradient-danger) !important; }
.progress-bar.bg-info { background: var(--gradient-info) !important; }
.progress-bar.bg-primary { background: var(--gradient-primary) !important; }

/* ---- Alert Polish ---- */
.alert {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-sm);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 1rem 1.25rem;
}
.alert-success {
    background: rgba(16,185,129,0.1);
    color: #065f46;
    border-left: 4px solid var(--success);
}
.alert-danger {
    background: rgba(239,68,68,0.1);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}
.alert-warning {
    background: rgba(245,158,11,0.1);
    color: #92400e;
    border-left: 4px solid var(--warning);
}
.alert-info {
    background: rgba(6,182,212,0.1);
    color: #155e75;
    border-left: 4px solid var(--info);
}

/* ---- Modal Polish ---- */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--neo-shadow-lg), 0 25px 50px rgba(0,0,0,0.12);
    background: var(--card-bg);
    overflow: hidden;
}
.modal-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(129,140,248,0.03));
    border-bottom: 1px solid rgba(99,102,241,0.08);
    padding: 1.15rem 1.5rem;
}
.modal-header .modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem;
    background: transparent;
}

/* ---- Dropdown Menu Polish ---- */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--neo-shadow-lg);
    background: var(--card-bg);
    padding: 0.5rem;
    animation: dropdownFadeIn 0.2s ease-out;
}
.dropdown-item {
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}
.dropdown-item:hover {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
}
.dropdown-item.active,
.dropdown-item:active {
    background: var(--gradient-primary);
    color: #fff;
}

/* ---- Empty State Polish ---- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.5s ease-out;
}
.empty-state .empty-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--body-bg);
    box-shadow: var(--neo-shadow);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 2rem;
    color: var(--text-muted);
    transition: var(--transition-bounce);
}
.empty-state:hover .empty-icon {
    box-shadow: var(--neo-shadow-md);
    transform: translateY(-4px);
    color: var(--primary);
}
.empty-state h6 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.empty-state p {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 400px;
    margin: 0 auto 1rem;
}
.empty-state .btn {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-primary);
}

/* ---- Tooltip Polish ---- */
.tooltip-inner {
    background: var(--gradient-dark);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ---- Scrollbar Global Polish ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.2);
    border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99,102,241,0.35);
}

/* ---- Nav Tabs Polish ---- */
.nav-tabs {
    border-bottom: 2px solid rgba(99,102,241,0.08);
    gap: 0.25rem;
}
.nav-tabs .nav-link {
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-secondary);
    background: transparent;
    transition: var(--transition);
    position: relative;
}
.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: rgba(99,102,241,0.05);
}
.nav-tabs .nav-link.active {
    color: var(--primary);
    background: var(--card-bg);
    box-shadow: var(--neo-shadow-sm);
    font-weight: 700;
}
.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0; height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px 3px 0 0;
}

/* ---- Nav Pills Polish ---- */
.nav-pills .nav-link {
    border-radius: 12px;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-secondary);
    box-shadow: var(--neo-shadow-sm);
    background: var(--card-bg);
    transition: var(--transition);
    margin: 0 3px;
}
.nav-pills .nav-link.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-primary);
}
.nav-pills .nav-link:hover:not(.active) {
    box-shadow: var(--neo-inset-sm);
    color: var(--primary);
}

/* ---- Form Check / Switch Polish ---- */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}
.form-switch .form-check-input {
    border-radius: 50px;
    height: 1.4em;
    width: 2.6em;
    background-color: var(--body-bg);
    box-shadow: var(--neo-inset-sm);
    border: none;
    transition: var(--transition);
}
.form-switch .form-check-input:checked {
    background: var(--gradient-primary);
    box-shadow: var(--glow-primary);
}

/* ---- Selection Highlight ---- */
::selection {
    background: rgba(99,102,241,0.2);
    color: var(--text-primary);
}

/* ---- Links Polish ---- */
a {
    transition: var(--transition);
}
a:hover {
    text-decoration: none;
}

/* ---- Table Action Buttons Enhanced ---- */
.action-btns .btn-action {
    transition: var(--transition-bounce);
}
.action-btns .btn-action:hover {
    transform: scale(1.1);
    box-shadow: var(--neo-inset-sm);
}

/* ---- Breadcrumb Enhanced ---- */
.breadcrumb {
    font-size: 0.78rem;
}
.breadcrumb-item a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}
.breadcrumb-item a:hover {
    color: var(--primary);
}

/* ---- Card Group Spacing ---- */
.row > [class*="col-"] > .card,
.row > [class*="col-"] > .stat-card,
.row > [class*="col-"] > .dash-stat {
    height: 100%;
}

/* ---- Loading Overlay Polish ---- */
.loading-overlay {
    background: rgba(224,229,236,0.85);
    backdrop-filter: blur(4px);
}

/* ---- Toastr Polish ---- */
.toast-success { background: var(--gradient-success) !important; background-repeat: no-repeat !important; background-position: 15px center !important; border-radius: var(--radius) !important; box-shadow: var(--glow-success) !important; }
.toast-error { background: var(--gradient-danger) !important; background-repeat: no-repeat !important; background-position: 15px center !important; border-radius: var(--radius) !important; box-shadow: var(--glow-danger) !important; }
.toast-warning { background: var(--gradient-warning) !important; background-repeat: no-repeat !important; background-position: 15px center !important; border-radius: var(--radius) !important; box-shadow: var(--glow-warning) !important; }
.toast-info { background: var(--gradient-info) !important; background-repeat: no-repeat !important; background-position: 15px center !important; border-radius: var(--radius) !important; }

/* ---- SweetAlert2 Polish ---- */
.swal2-popup {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--neo-shadow-lg) !important;
    background: var(--card-bg) !important;
}
.swal2-title {
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}
.swal2-confirm {
    background: var(--gradient-primary) !important;
    border-radius: 12px !important;
    box-shadow: var(--glow-primary) !important;
    font-weight: 600 !important;
    padding: 0.6rem 2rem !important;
}
.swal2-cancel {
    border-radius: 12px !important;
    box-shadow: var(--neo-shadow-sm) !important;
    font-weight: 600 !important;
}

/* ---- Quick Actions Grid Polish ---- */
.qa-item {
    position: relative;
    overflow: hidden;
}
.qa-item::after {
    content: '';
    position: absolute; bottom: 0; left: 25%; right: 25%;
    height: 2px; background: var(--gradient-primary);
    opacity: 0; transition: all 0.3s ease;
    border-radius: 2px;
}
.qa-item:hover::after {
    opacity: 0.7;
    left: 10%; right: 10%;
}
.qa-item:hover i {
    color: var(--primary);
    transform: scale(1.15);
    transition: var(--transition-bounce);
}

/* ---- Welcome Banner Polish ---- */
.welcome-banner {
    background: var(--gradient-accent) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--neo-shadow-md), 0 8px 30px rgba(99,102,241,0.2);
    position: relative;
    overflow: hidden;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 250px; height: 250px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}

/* ---- Profile Card Polish ---- */
.profile-header-card .profile-banner {
    background: var(--gradient-accent) !important;
}

/* ---- Attendance Stat Cards Polish ---- */
.att-stat-card {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.att-stat-card:hover {
    transform: translateY(-3px) scale(1.02);
}
.att-stat-icon {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.att-stat-card:hover .att-stat-icon {
    transform: scale(1.12) rotate(-5deg);
}

/* ---- Micro-interactions ---- */
@keyframes pulseGlow {
    0%, 100% { box-shadow: var(--neo-shadow); }
    50% { box-shadow: var(--neo-shadow-md), 0 0 20px rgba(99,102,241,0.1); }
}
.notification-bell .badge-count {
    animation: pulseGlow 2s ease-in-out infinite;
    background: var(--gradient-danger) !important;
}

/* ---- Footer Polish ---- */
.main-footer {
    background: var(--body-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: none;
    padding: 0.85rem 1.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Dark Mode Polish Overrides ---- */
[data-theme="dark"] .card::before,
[data-theme="dark"] .table-card::before,
[data-theme="dark"] .form-card::before,
[data-theme="dark"] .filters-card::before {
    opacity: 0.4;
}
[data-theme="dark"] .navbar {
    background: var(--card-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
}
[data-theme="dark"] .sidebar-user-widget {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(129,140,248,0.04));
    border-color: rgba(99,102,241,0.1);
}
[data-theme="dark"] #sidebar .sidebar-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(129,140,248,0.05));
}
[data-theme="dark"] #sidebar .sidebar-header::after {
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.2), transparent);
}
[data-theme="dark"] .input-group .input-group-text {
    background: var(--gradient-primary);
    color: #fff;
}
[data-theme="dark"] .table-hover tbody tr:hover {
    background: rgba(99,102,241,0.06);
    box-shadow: inset 3px 0 0 var(--primary);
}
[data-theme="dark"] .empty-state .empty-icon {
    color: var(--text-muted);
}
[data-theme="dark"] .dropdown-item:hover {
    background: rgba(99,102,241,0.1);
}
[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(129,140,248,0.05));
    border-bottom-color: rgba(99,102,241,0.1);
}
[data-theme="dark"] .loading-overlay {
    background: rgba(15,23,42,0.85);
}
[data-theme="dark"] ::selection {
    background: rgba(99,102,241,0.3);
    color: #fff;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.25);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(99,102,241,0.4);
}
[data-theme="dark"] .nav-tabs {
    border-bottom-color: rgba(99,102,241,0.1);
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--card-bg);
}
[data-theme="dark"] .dash-stat .stat-value {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .alert-success { background: rgba(16,185,129,0.15); color: #6ee7b7; }
[data-theme="dark"] .alert-danger { background: rgba(239,68,68,0.15); color: #fca5a5; }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,0.15); color: #fcd34d; }
[data-theme="dark"] .alert-info { background: rgba(6,182,212,0.15); color: #67e8f9; }
[data-theme="dark"] .swal2-popup {
    background: var(--card-bg) !important;
}
[data-theme="dark"] .swal2-title {
    color: var(--text-primary) !important;
}

/* ---- Responsive Polish ---- */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }
    .page-header {
        padding: 0.5rem 0;
    }
    .page-icon {
        width: 32px; height: 32px;
        font-size: 0.82rem;
    }
    .filters-card .filter-group {
        flex-direction: column;
    }
    .table-card .table-card-header,
    .form-card .form-card-header {
        padding: 0.85rem 1rem;
    }
    .dash-stat .card-body {
        padding: 18px 20px;
    }
    .dash-stat .stat-icon-circle {
        width: 48px; height: 48px; min-width: 48px;
        font-size: 1.1rem;
    }
    .qa-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1400px) {
    .content-wrapper {
        padding: 2rem 2.5rem;
    }
}

/* ── Dashboard Enhancements ─────────────────────────────── */

/* Live clock in welcome banner */
#dash-live-clock {
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Activity feed new-item highlight */
@keyframes pulse-highlight {
    0%   { background-color: rgba(79, 70, 229, 0.08); }
    100% { background-color: transparent; }
}
.bg-light-pulse {
    animation: pulse-highlight 3s ease-out forwards;
}

/* Spin animation for refresh button */
.fa-spin {
    animation: fa-spin 0.8s linear infinite;
}
@keyframes fa-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Extra stats row – reuse existing dash-stat */
.icon-grad-danger {
    background: linear-gradient(135deg, #ef4444, #fca5a5) !important;
}

/* Upcoming events/exams list spacing */
#upcoming-events-list .list-group-item,
#upcoming-exams-list .list-group-item {
    border-left: none;
    border-right: none;
    transition: background 0.2s;
}
#upcoming-events-list .list-group-item:hover,
#upcoming-exams-list .list-group-item:hover {
    background: #f8f9fc;
}
