/* ===================================
   SISTEM ABSENSI ONLINE - STYLESHEET
   =================================== */

/* CSS Variables - Design Tokens */
:root {
    /* Colors - Modern Blue Theme */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Status Colors */
    --success-50: #ecfdf5;
    --success-500: #10b981;
    --success-600: #059669;
    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --danger-50: #fef2f2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --info-50: #eff6ff;
    --info-500: #3b82f6;
    --info-600: #2563eb;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --card-bg: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
}

/* Light Mode Variables (default) */
[data-theme="light"],
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-bg: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
}

/* ===================================
   PRELOADER STYLES - LOGO ORBIT ANIMATION
   =================================== */
/* Failsafe: Auto hide preloader after 8s if JS fails */
@keyframes autoHideFailsafe {
    0% {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    90% {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    /* Only remove preloader via autoHideFailsafe, NO bgShift flickering */
    animation: autoHideFailsafe 1s 5s forwards;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.1);
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

/* Logo Orbit Container */
.logo-orbit-container {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Orbit Rings */
.orbit {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: orbitRotate linear infinite;
}

.orbit-1 {
    width: 100%;
    height: 100%;
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: rgba(59, 130, 246, 0.8);
    border-right-color: rgba(59, 130, 246, 0.4);
    animation-duration: 3s;
}

.orbit-2 {
    width: 80%;
    height: 80%;
    border-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(147, 197, 253, 0.6);
    border-left-color: rgba(147, 197, 253, 0.3);
    animation-duration: 4s;
    animation-direction: reverse;
}

.orbit-3 {
    width: 60%;
    height: 60%;
    border-color: rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.5);
    animation-duration: 2.5s;
}

@keyframes orbitRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Orbit Dots */
.orbit-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(59, 130, 246, 0.6);
}

.dot-1 {
    animation: dotOrbit1 3s linear infinite;
}

.dot-2 {
    animation: dotOrbit2 4s linear infinite reverse;
}

.dot-3 {
    animation: dotOrbit3 2.5s linear infinite;
}

@keyframes dotOrbit1 {
    from {
        transform: rotate(0deg) translateX(110px) rotate(0deg);
    }

    to {
        transform: rotate(360deg) translateX(110px) rotate(-360deg);
    }
}

@keyframes dotOrbit2 {
    from {
        transform: rotate(0deg) translateX(88px) rotate(0deg);
    }

    to {
        transform: rotate(360deg) translateX(88px) rotate(-360deg);
    }
}

@keyframes dotOrbit3 {
    from {
        transform: rotate(0deg) translateX(66px) rotate(0deg);
    }

    to {
        transform: rotate(360deg) translateX(66px) rotate(-360deg);
    }
}

/* Center Logo */
.preloader-logo {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.2),
        0 0 60px rgba(59, 130, 246, 0.4),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
    animation: logoPulse 2s ease-in-out infinite;
}

.preloader-logo::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from {
        transform: scale(0.8);
        opacity: 0.5;
    }

    to {
        transform: scale(1.2);
        opacity: 1;
    }
}

.preloader-logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

.preloader-icon-fallback {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.preloader-icon-fallback svg {
    width: 50px;
    height: 50px;
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 4px rgba(255, 255, 255, 0.2),
            0 0 60px rgba(59, 130, 246, 0.4),
            inset 0 0 40px rgba(255, 255, 255, 0.1);
    }

    50% {
        transform: scale(1.05);
        box-shadow:
            0 0 0 6px rgba(255, 255, 255, 0.3),
            0 0 80px rgba(59, 130, 246, 0.6),
            inset 0 0 50px rgba(255, 255, 255, 0.15);
    }
}

/* School Name */
.preloader-school-name {
    text-align: center;
}

.preloader-school-name span {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 20px rgba(59, 130, 246, 0.5);
    animation: textReveal 1.5s ease-out forwards, textGlow 2s ease-in-out infinite 1.5s;
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
        letter-spacing: 0.3em;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.1em;
    }
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 2px 20px rgba(59, 130, 246, 0.5);
    }

    50% {
        text-shadow: 0 2px 40px rgba(59, 130, 246, 0.8), 0 0 60px rgba(147, 197, 253, 0.4);
    }
}

/* Loading Bar */
.preloader-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 280px;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #93c5fd, #3b82f6);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: loadingProgress 1.5s ease-in-out infinite, shimmer 1.5s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.loading-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05em;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ===================================
   BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-600);
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

/* ===================================
   LAYOUT COMPONENTS
   =================================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   LOGIN PAGE STYLES
   =================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 50%, var(--primary-500) 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-10);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bgShift {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    box-shadow: var(--shadow-lg);
}

.login-logo svg {
    width: 48px;
    height: 48px;
    color: white;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===================================
   FORM STYLES
   =================================== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-icon {
    position: relative;
}

.form-input-icon .form-input {
    padding-left: 2.75rem;
}

.form-input-icon svg {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

/* Role Selection */
.role-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.role-option {
    position: relative;
}

.role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.role-option label:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.role-option input:checked+label {
    border-color: var(--primary-500);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .role-option label:hover,
[data-theme="dark"] .role-option input:checked+label {
    background: rgba(59, 130, 246, 0.15);
}

.role-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-600);
}

.role-option input:checked+label .role-icon {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
}

.role-option input:checked+label .role-icon svg {
    color: white;
}

.role-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ===================================
   NAVIGATION & SIDEBAR
   =================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-brand-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    margin-bottom: var(--space-1);
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-link svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-link-text {
    font-size: 0.9375rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar footer action buttons - larger icons */
.user-info .btn-icon {
    width: 44px;
    height: 44px;
}

.user-info .btn-icon svg {
    width: 24px;
    height: 24px;
}

/* ===================================
   MAIN CONTENT AREA
   =================================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.mobile-menu-btn {
    display: none;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.content-body {
    flex: 1;
    padding: var(--space-6);
}

/* ===================================
   CARDS
   =================================== */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.hadir {
    background: var(--success-50);
    color: var(--success-500);
}

.stat-icon.izin {
    background: var(--info-50);
    color: var(--info-500);
}

.stat-icon.sakit {
    background: var(--warning-50);
    color: var(--warning-500);
}

.stat-icon.alpha {
    background: var(--danger-50);
    color: var(--danger-500);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

/* ===================================
   TABLE STYLES
   =================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table with selection */
.table .checkbox-cell {
    width: 40px;
    text-align: center;
}

.table .actions-cell {
    width: 100px;
    text-align: center;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.badge-hadir {
    background: var(--success-50);
    color: var(--success-600);
}

.badge-izin {
    background: var(--info-50);
    color: var(--info-600);
}

.badge-sakit {
    background: var(--warning-50);
    color: var(--warning-600);
}

.badge-alpha {
    background: var(--danger-50);
    color: var(--danger-600);
}

/* ===================================
   ATTENDANCE INPUT STYLES
   =================================== */
.attendance-form {
    margin-top: var(--space-4);
}

.attendance-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input[type="date"] {
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-width: 180px;
}

.bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
}

[data-theme="dark"] .bulk-actions {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.bulk-actions-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    margin-right: var(--space-2);
}

/* Status Radio Buttons */
.status-options {
    display: flex;
    gap: var(--space-2);
}

.status-option {
    position: relative;
}

.status-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.status-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.status-option label:hover {
    border-color: var(--gray-400);
}

.status-option input:checked+label.status-hadir {
    background: var(--success-500);
    border-color: var(--success-500);
    color: white;
}

.status-option input:checked+label.status-izin {
    background: var(--info-500);
    border-color: var(--info-500);
    color: white;
}

.status-option input:checked+label.status-sakit {
    background: var(--warning-500);
    border-color: var(--warning-500);
    color: white;
}

.status-option input:checked+label.status-alpha {
    background: var(--danger-500);
    border-color: var(--danger-500);
    color: white;
}

/* ===================================
   MODAL STYLES
   =================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ===================================
   CHECKBOX STYLES
   =================================== */
.checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.checkbox input:checked+.checkbox-mark {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox input:checked+.checkbox-mark svg {
    display: block;
}

.checkbox-mark svg {
    display: none;
    width: 12px;
    height: 12px;
    color: white;
}

.checkbox:hover .checkbox-mark {
    border-color: var(--primary-400);
}

/* ===================================
   ALERT & TOAST
   =================================== */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.alert-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-50);
    border: 1px solid var(--success-500);
    color: var(--success-600);
}

.alert-danger {
    background: var(--danger-50);
    border: 1px solid var(--danger-500);
    color: var(--danger-600);
}

.alert-warning {
    background: var(--warning-50);
    border: 1px solid var(--warning-500);
    color: var(--warning-600);
}

.alert-info {
    background: var(--info-50);
    border: 1px solid var(--info-500);
    color: var(--info-600);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--primary-500);
    pointer-events: auto;
}

.toast.success {
    border-left-color: var(--success-500);
}

.toast.error {
    border-left-color: var(--danger-500);
}

.toast.warning {
    border-left-color: var(--warning-500);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ===================================
   LOADING STATES
   =================================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.8);
}

/* ===================================
   EMPTY STATE
   =================================== */
.empty-state {
    text-align: center;
    padding: var(--space-12);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===================================
   RESPONSIVE STYLES - MOBILE OPTIMIZED
   =================================== */

/* Tablet Landscape & Below */
/* ===================================
   UTILITY CLASSES
   =================================== */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-muted);
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

/* ===================================
   RESPONSIVE STYLES - MOBILE OPTIMIZED
   =================================== */

/* Tablet and Below (max-width: 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait and Below (max-width: 768px) */
@media (max-width: 768px) {

    /* Typography scaling */
    html {
        font-size: 15px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Content spacing */
    .content-body {
        padding: var(--space-4);
    }

    .content-header {
        padding: var(--space-3) var(--space-4);
    }

    .page-title {
        font-size: 1.125rem;
    }

    /* Cards */
    .card-header {
        padding: var(--space-4);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .card-body {
        padding: var(--space-4);
    }

    .card-title {
        font-size: 1rem;
    }

    /* Stat cards - 2 column grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .stat-card {
        padding: var(--space-4);
        gap: var(--space-3);
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .stat-value {
        font-size: 1.375rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Tables */
    .table-container {
        margin: 0 calc(-1 * var(--space-4));
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .table th,
    .table td {
        padding: var(--space-2) var(--space-3);
        font-size: 0.8125rem;
    }

    /* Bulk actions */
    .bulk-actions {
        flex-direction: column;
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .bulk-actions-label {
        margin-bottom: var(--space-1);
    }

    .bulk-actions .btn {
        flex: 1;
        min-width: 0;
    }

    /* Filter groups */
    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input[type="date"] {
        width: 100%;
        min-width: unset;
    }

    /* Buttons */
    .btn-lg {
        padding: var(--space-3) var(--space-6);
    }

    /* Flex gap utilities */
    .flex.gap-3 {
        flex-direction: column;
    }

    .flex.gap-3 .btn {
        width: 100%;
        justify-content: center;
    }

    /* Login specific */
    .login-card {
        padding: var(--space-6);
        margin: var(--space-2);
    }

    .login-title {
        font-size: 1.375rem;
    }

    .login-subtitle {
        font-size: 0.875rem;
    }

    .role-icon {
        width: 40px;
        height: 40px;
    }

    .role-icon svg {
        width: 20px;
        height: 20px;
    }

    .role-label {
        font-size: 0.8125rem;
    }

    /* Preloader */
    .logo-orbit-container {
        width: 180px;
        height: 180px;
    }

    .preloader-logo {
        width: 80px;
        height: 80px;
    }

    .preloader-logo img {
        width: 56px;
        height: 56px;
    }

    .preloader-school-name span {
        font-size: 1.375rem;
    }

    .preloader-loading {
        width: 240px;
    }

    @keyframes dotOrbit1 {
        from {
            transform: rotate(0deg) translateX(90px) rotate(0deg);
        }

        to {
            transform: rotate(360deg) translateX(90px) rotate(-360deg);
        }
    }

    @keyframes dotOrbit2 {
        from {
            transform: rotate(0deg) translateX(72px) rotate(0deg);
        }

        to {
            transform: rotate(360deg) translateX(72px) rotate(-360deg);
        }
    }

    @keyframes dotOrbit3 {
        from {
            transform: rotate(0deg) translateX(54px) rotate(0deg);
        }

        to {
            transform: rotate(360deg) translateX(54px) rotate(-360deg);
        }
    }

    /* Modal */
    .modal {
        margin: var(--space-4);
        max-width: calc(100% - var(--space-8));
    }

    .modal-header,
    .modal-footer {
        padding: var(--space-4);
    }

    .modal-body {
        padding: var(--space-4);
    }

    /* Toast */
    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
    }

    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}

/* Mobile Phones (max-width: 480px) */
@media (max-width: 480px) {

    /* Base typography */
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    /* Compact spacing */
    .content-body {
        padding: var(--space-3);
    }

    .content-header {
        padding: var(--space-2) var(--space-3);
    }

    .page-title {
        font-size: 1rem;
    }

    /* Sidebar */
    .sidebar {
        width: 85vw;
        max-width: 300px;
    }

    .sidebar-header {
        padding: var(--space-4);
    }

    .sidebar-brand-text {
        font-size: 1rem;
    }

    .sidebar-logo {
        width: 36px;
        height: 36px;
    }

    .sidebar-nav {
        padding: var(--space-3);
    }

    .nav-section {
        margin-bottom: var(--space-4);
    }

    .nav-link {
        padding: var(--space-3);
    }

    .nav-link-text {
        font-size: 0.875rem;
    }

    .sidebar-footer {
        padding: var(--space-3);
    }

    .user-info {
        padding: var(--space-2);
        gap: var(--space-2);
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }

    .user-name {
        font-size: 0.8125rem;
    }

    .user-role {
        font-size: 0.6875rem;
    }

    /* Cards */
    .card {
        border-radius: var(--radius-lg);
    }

    .card-header {
        padding: var(--space-3);
    }

    .card-body {
        padding: var(--space-3);
    }

    .card-title {
        font-size: 0.9375rem;
    }

    /* Stat cards - Stack on very small screens */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .stat-card {
        padding: var(--space-3);
        gap: var(--space-2);
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        margin: 0 auto;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.6875rem;
    }

    /* Tables - Compact mode */
    .table th,
    .table td {
        padding: var(--space-2);
        font-size: 0.75rem;
    }

    /* Status options - 2x2 grid */
    .status-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .status-option label {
        min-width: unset;
        width: 100%;
        padding: var(--space-2);
        font-size: 0.6875rem;
    }

    /* Buttons - Touch friendly */
    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
        min-height: 44px;
    }

    .btn-sm {
        padding: var(--space-2);
        font-size: 0.75rem;
        min-height: 36px;
    }

    .btn-lg {
        padding: var(--space-3) var(--space-4);
        font-size: 0.9375rem;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }

    .btn-icon svg {
        width: 18px;
        height: 18px;
    }

    /* Bulk actions - Stack vertically with grid */
    .bulk-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .bulk-actions-label {
        grid-column: 1 / -1;
        text-align: center;
        margin: 0;
    }

    .bulk-actions .btn {
        padding: var(--space-2);
        font-size: 0.75rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: var(--space-4);
    }

    .form-label {
        font-size: 0.8125rem;
    }

    .form-input {
        padding: var(--space-3);
        font-size: 0.9375rem;
    }

    .form-input-icon .form-input {
        padding-left: 2.5rem;
    }

    .form-input-icon svg {
        width: 18px;
        height: 18px;
    }

    /* Role selection */
    .role-selection {
        gap: var(--space-2);
    }

    .role-option label {
        padding: var(--space-3);
    }

    .role-icon {
        width: 36px;
        height: 36px;
    }

    .role-icon svg {
        width: 18px;
        height: 18px;
    }

    .role-label {
        font-size: 0.75rem;
    }

    /* Login */
    .login-container {
        padding: var(--space-3);
    }

    .login-card {
        padding: var(--space-5);
        border-radius: var(--radius-xl);
    }

    .login-header {
        margin-bottom: var(--space-6);
    }

    .login-logo {
        width: 64px;
        height: 64px;
    }

    .login-logo svg {
        width: 36px;
        height: 36px;
    }

    .login-title {
        font-size: 1.25rem;
    }

    .login-subtitle {
        font-size: 0.8125rem;
    }

    /* Preloader */
    .logo-orbit-container {
        width: 150px;
        height: 150px;
    }

    .preloader-logo {
        width: 70px;
        height: 70px;
    }

    .preloader-logo img {
        width: 48px;
        height: 48px;
    }

    .preloader-school-name span {
        font-size: 1.125rem;
        letter-spacing: 0.05em;
    }

    .preloader-loading {
        width: 200px;
    }

    .loading-text {
        font-size: 0.75rem;
    }

    .orbit-dot {
        width: 8px;
        height: 8px;
    }

    @keyframes dotOrbit1 {
        from {
            transform: rotate(0deg) translateX(75px) rotate(0deg);
        }

        to {
            transform: rotate(360deg) translateX(75px) rotate(-360deg);
        }
    }

    @keyframes dotOrbit2 {
        from {
            transform: rotate(0deg) translateX(60px) rotate(0deg);
        }

        to {
            transform: rotate(360deg) translateX(60px) rotate(-360deg);
        }
    }

    @keyframes dotOrbit3 {
        from {
            transform: rotate(0deg) translateX(45px) rotate(0deg);
        }

        to {
            transform: rotate(360deg) translateX(45px) rotate(-360deg);
        }
    }

    /* Theme toggle */
    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }

    /* Alerts */
    .alert {
        padding: var(--space-3);
        font-size: 0.8125rem;
    }

    .alert-icon svg {
        width: 18px;
        height: 18px;
    }

    /* Modal */
    .modal {
        margin: var(--space-3);
        max-width: calc(100% - var(--space-6));
        border-radius: var(--radius-lg);
    }

    .modal-header {
        padding: var(--space-3);
    }

    .modal-title {
        font-size: 1rem;
    }

    .modal-body {
        padding: var(--space-3);
        max-height: calc(80vh - 120px);
    }

    .modal-footer {
        padding: var(--space-3);
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Toast - Bottom position on mobile */
    .toast-container {
        top: auto;
        bottom: var(--space-4);
        left: var(--space-3);
        right: var(--space-3);
    }

    .toast {
        padding: var(--space-3);
    }

    .toast-icon svg {
        width: 18px;
        height: 18px;
    }

    .toast-message {
        font-size: 0.8125rem;
    }

    /* Empty state */
    .empty-state {
        padding: var(--space-8);
    }

    .empty-state-icon {
        width: 60px;
        height: 60px;
    }

    .empty-state-icon svg {
        width: 30px;
        height: 30px;
    }

    .empty-state-title {
        font-size: 1rem;
    }

    .empty-state-desc {
        font-size: 0.8125rem;
    }

    /* Loading */
    .loading-spinner {
        width: 32px;
        height: 32px;
    }

    /* Quick actions card */
    .flex.gap-3 {
        gap: var(--space-2);
    }
}

/* Very Small Phones (max-width: 360px) */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    .sidebar {
        width: 90vw;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: var(--space-2);
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .status-options {
        grid-template-columns: repeat(4, 1fr);
    }

    .status-option label {
        padding: var(--space-1) var(--space-2);
        font-size: 0.625rem;
    }

    .login-card {
        padding: var(--space-4);
    }

    .preloader-school-name span {
        font-size: 1rem;
    }
}

/* Landscape mode optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        padding: var(--space-2);
    }

    .login-card {
        padding: var(--space-4);
    }

    .login-header {
        margin-bottom: var(--space-4);
    }

    .login-logo {
        width: 48px;
        height: 48px;
        margin-bottom: var(--space-2);
    }

    .login-title {
        font-size: 1.125rem;
    }

    .role-selection {
        margin-bottom: var(--space-4);
    }

    .preloader-content {
        gap: 1rem;
        flex-direction: row;
        align-items: center;
    }

    .logo-orbit-container {
        width: 120px;
        height: 120px;
    }

    .preloader-logo {
        width: 50px;
        height: 50px;
    }

    .preloader-logo img {
        width: 36px;
        height: 36px;
    }

    .preloader-school-name span {
        font-size: 1rem;
    }

    .preloader-loading {
        width: 150px;
    }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
    .sidebar-footer {
        padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
    }

    .content-body {
        padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
    }

    .toast-container {
        bottom: max(var(--space-4), env(safe-area-inset-bottom));
    }
}

/* Touch-specific optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger tap targets */
    .nav-link {
        min-height: 48px;
    }

    .btn {
        min-height: 44px;
    }

    .status-option label {
        min-height: 40px;
    }

    .checkbox-mark {
        width: 22px;
        height: 22px;
    }

    /* Remove hover effects for touch */
    .stat-card:hover {
        transform: none;
    }

    .btn:hover:not(:disabled) {
        transform: none;
    }

    /* Add active states instead */
    .btn:active:not(:disabled) {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .nav-link:active {
        background: var(--bg-tertiary);
    }

    .stat-card:active {
        transform: scale(0.98);
    }
}

/* ===================================
   MOBILE HUB NAVIGATION SYSTEM
   Desktop is NOT affected by these styles
   =================================== */

/* Hide mobile elements on desktop */
.mobile-hub,
.mobile-back-btn {
    display: none;
}

/* Mobile-only styles */
@media (max-width: 768px) {

    /* Hide sidebar and desktop elements on mobile when hub is active */
    body.mobile-hub-active .sidebar,
    body.mobile-hub-active .sidebar-backdrop,
    body.mobile-hub-active .main-content {
        display: none !important;
    }

    /* Prevent body scroll when hub is active */
    body.mobile-hub-active {
        overflow: hidden;
        height: 100vh;
    }

    /* Show mobile hub */
    body.mobile-hub-active .mobile-hub {
        display: flex !important;
    }

    /* Mobile Hub Container */
    .mobile-hub {
        display: none;
        flex-direction: column;
        height: 100vh;
        max-height: 100vh;
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    [data-theme="dark"] .mobile-hub {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }

    /* Liquid Wave Background */
    .mobile-hub-liquid {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70%;
        pointer-events: none;
        z-index: 0;
        overflow: hidden;
    }

    .mobile-hub-liquid canvas {
        width: 100%;
        height: 100%;
        display: block;
    }

    /* Admin Hub Background (simplified, no liquid wave) */
    .mobile-hub-admin-bg {
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
        z-index: 0;
    }

    [data-theme="dark"] .mobile-hub-admin-bg {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    }

    /* Admin menu grid - larger cards for 2-item layout */
    .mobile-menu-grid.admin-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mobile-menu-grid.admin-grid .mobile-menu-card {
        flex-direction: row;
        justify-content: flex-start;
        padding: 20px 24px;
        gap: 16px;
    }

    .mobile-menu-grid.admin-grid .mobile-menu-label {
        font-size: 1rem;
    }


    /* Ensure content is above liquid */
    .mobile-hub .mobile-header {
        position: relative;
        z-index: 10;
    }

    .mobile-hub .mobile-content {
        position: relative;
        z-index: 5;
    }

    .mobile-hub .mobile-footer {
        position: relative;
        z-index: 10;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    [data-theme="dark"] .mobile-hub .mobile-footer {
        background: rgba(15, 23, 42, 0.8);
    }


    /* Mobile Header */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
        color: white;
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mobile-user-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-user-name {
        font-size: 1.1rem;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

    .mobile-user-role {
        font-size: 0.8rem;
        opacity: 0.9;
        background: rgba(255, 255, 255, 0.2);
        padding: 2px 10px;
        border-radius: 12px;
        display: inline-block;
        width: fit-content;
    }

    .mobile-header-actions {
        display: flex;
        gap: 8px;
    }

    .mobile-header-actions button {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        border: none;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        backdrop-filter: blur(10px);
    }

    .mobile-header-actions button:active {
        transform: scale(0.92);
        background: rgba(255, 255, 255, 0.3);
    }

    .mobile-header-actions button svg {
        width: 20px;
        height: 20px;
    }

    /* Mobile Content Area */
    .mobile-content {
        flex: 1;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Statistics Cards */
    .mobile-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 24px;
    }

    /* Stats Section Title */
    .mobile-stats-title {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-bottom: 8px;
        padding: 0;
    }

    .mobile-stats-title::before,
    .mobile-stats-title::after {
        content: '';
        flex: 1;
        height: 2px;
        background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.08) 20%, rgba(16, 185, 129, 0.3) 50%, rgba(0, 0, 0, 0.08) 80%, transparent 100%);
        border-radius: 1px;
    }

    [data-theme="dark"] .mobile-stats-title::before,
    [data-theme="dark"] .mobile-stats-title::after {
        background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(16, 185, 129, 0.4) 50%, rgba(255, 255, 255, 0.1) 80%, transparent 100%);
    }

    .mobile-stats-title span {
        background: rgba(16, 185, 129, 0.1);
        padding: 4px 14px;
        border-radius: 12px;
        border: 1px solid rgba(16, 185, 129, 0.25);
        white-space: nowrap;
    }

    [data-theme="dark"] .mobile-stats-title span {
        background: rgba(16, 185, 129, 0.15);
        border-color: rgba(16, 185, 129, 0.35);
    }

    .mobile-stat-card {
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 20px;
        padding: 14px 16px;
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.5);
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    .mobile-stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
        pointer-events: none;
    }

    [data-theme="dark"] .mobile-stat-card {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .mobile-stat-card::before {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    }

    .mobile-stat-card:active {
        transform: scale(0.96);
        box-shadow:
            0 2px 12px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }

    .mobile-stat-card .mobile-stat-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
    }

    .mobile-stat-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
    }

    .mobile-stat-icon svg {
        width: 24px;
        height: 24px;
    }

    .mobile-stat-icon.primary {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    }

    .mobile-stat-icon.success {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    }

    .mobile-stat-icon.warning {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    }

    .mobile-stat-icon.danger {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    }

    .mobile-stat-value {
        font-size: 1.4rem;
        font-weight: 800;
        color: var(--text-primary);
        line-height: 1;
        position: relative;
        z-index: 1;
    }

    .mobile-stat-label {
        font-size: 0.65rem;
        color: var(--text-secondary);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        position: relative;
        z-index: 1;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* BK Stat Label with Swing Animation */
    .mobile-stat-label.marquee {
        display: block;
        overflow: hidden;
        line-height: 1.3;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
        white-space: normal;
    }

    .mobile-stat-label.marquee span {
        display: inline-block;
        animation: swing-horizontal 6s ease-in-out infinite;
        animation-delay: 0s;
    }

    .mobile-stat-label.marquee:hover span {
        animation-play-state: paused;
    }

    @keyframes swing-horizontal {

        0%,
        30% {
            transform: translateX(0);
        }

        50% {
            transform: translateX(-20px);
        }

        70%,
        100% {
            transform: translateX(0);
        }
    }

    /* Separator between stat sections */
    .mobile-stats-separator {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
        margin: 8px 0;
    }

    .mobile-stats-separator::before,
    .mobile-stats-separator::after {
        content: '';
        flex: 1;
        height: 2px;
        background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.08) 20%, rgba(249, 115, 22, 0.3) 50%, rgba(0, 0, 0, 0.08) 80%, transparent 100%);
        border-radius: 1px;
    }

    [data-theme="dark"] .mobile-stats-separator::before,
    [data-theme="dark"] .mobile-stats-separator::after {
        background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(249, 115, 22, 0.4) 50%, rgba(255, 255, 255, 0.1) 80%, transparent 100%);
    }

    .mobile-stats-separator span {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
        white-space: nowrap;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        background: rgba(249, 115, 22, 0.1);
        padding: 4px 14px;
        border-radius: 12px;
        border: 1px solid rgba(249, 115, 22, 0.25);
    }

    [data-theme="dark"] .mobile-stats-separator span {
        background: rgba(249, 115, 22, 0.15);
        border-color: rgba(249, 115, 22, 0.35);
    }

    /* Menu Section Title */
    .mobile-menu-section {
        margin-bottom: 16px;
    }

    .mobile-menu-title {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-bottom: 16px;
        padding: 0;
    }

    .mobile-menu-title::before,
    .mobile-menu-title::after {
        content: '';
        flex: 1;
        height: 2px;
        background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.08) 20%, rgba(59, 130, 246, 0.3) 50%, rgba(0, 0, 0, 0.08) 80%, transparent 100%);
        border-radius: 1px;
    }

    [data-theme="dark"] .mobile-menu-title::before,
    [data-theme="dark"] .mobile-menu-title::after {
        background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(59, 130, 246, 0.4) 50%, rgba(255, 255, 255, 0.1) 80%, transparent 100%);
    }

    .mobile-menu-title span {
        background: rgba(59, 130, 246, 0.1);
        padding: 4px 14px;
        border-radius: 12px;
        border: 1px solid rgba(59, 130, 246, 0.25);
        white-space: nowrap;
    }

    [data-theme="dark"] .mobile-menu-title span {
        background: rgba(59, 130, 246, 0.15);
        border-color: rgba(59, 130, 246, 0.35);
    }

    /* Menu Cards Grid */
    .mobile-menu-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mobile-menu-card {
        border-radius: 20px;
        padding: 20px 16px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: inherit;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    }

    .mobile-menu-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .mobile-menu-card:active {
        transform: scale(0.95);
    }

    .mobile-menu-card:active::before {
        opacity: 1;
    }

    .mobile-menu-icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .mobile-menu-icon svg {
        width: 28px;
        height: 28px;
    }

    /* Menu Card Color Variants with Accent Background */
    .mobile-menu-card.blue {
        background: linear-gradient(135deg, rgba(219, 234, 254, 1) 0%, rgba(191, 219, 254, 0.85) 100%);
        border-color: rgba(59, 130, 246, 0.2);
    }

    .mobile-menu-card.blue::before {
        background: linear-gradient(90deg, #3b82f6, #2563eb);
    }

    .mobile-menu-card.blue .mobile-menu-icon {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.blue {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
        border-color: rgba(59, 130, 246, 0.3);
    }

    .mobile-menu-card.green {
        background: linear-gradient(135deg, rgba(209, 250, 229, 1) 0%, rgba(167, 243, 208, 0.85) 100%);
        border-color: rgba(16, 185, 129, 0.2);
    }

    .mobile-menu-card.green::before {
        background: linear-gradient(90deg, #10b981, #059669);
    }

    .mobile-menu-card.green .mobile-menu-icon {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.green {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
        border-color: rgba(16, 185, 129, 0.3);
    }

    .mobile-menu-card.purple {
        background: linear-gradient(135deg, rgba(237, 233, 254, 1) 0%, rgba(221, 214, 254, 0.85) 100%);
        border-color: rgba(124, 58, 237, 0.2);
    }

    .mobile-menu-card.purple::before {
        background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    }

    .mobile-menu-card.purple .mobile-menu-icon {
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.purple {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.15) 100%);
        border-color: rgba(124, 58, 237, 0.3);
    }

    .mobile-menu-card.orange {
        background: linear-gradient(135deg, rgba(255, 237, 213, 1) 0%, rgba(254, 215, 170, 0.85) 100%);
        border-color: rgba(234, 88, 12, 0.2);
    }

    .mobile-menu-card.orange::before {
        background: linear-gradient(90deg, #f97316, #ea580c);
    }

    .mobile-menu-card.orange .mobile-menu-icon {
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.orange {
        background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.15) 100%);
        border-color: rgba(234, 88, 12, 0.3);
    }

    .mobile-menu-card.red {
        background: linear-gradient(135deg, rgba(254, 226, 226, 1) 0%, rgba(254, 202, 202, 0.85) 100%);
        border-color: rgba(220, 38, 38, 0.2);
    }

    .mobile-menu-card.red::before {
        background: linear-gradient(90deg, #ef4444, #dc2626);
    }

    .mobile-menu-card.red .mobile-menu-icon {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.red {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.15) 100%);
        border-color: rgba(220, 38, 38, 0.3);
    }

    .mobile-menu-card.cyan {
        background: linear-gradient(135deg, rgba(207, 250, 254, 1) 0%, rgba(165, 243, 252, 0.85) 100%);
        border-color: rgba(8, 145, 178, 0.2);
    }

    .mobile-menu-card.cyan::before {
        background: linear-gradient(90deg, #06b6d4, #0891b2);
    }

    .mobile-menu-card.cyan .mobile-menu-icon {
        background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.cyan {
        background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(8, 145, 178, 0.15) 100%);
        border-color: rgba(8, 145, 178, 0.3);
    }

    .mobile-menu-card.pink {
        background: linear-gradient(135deg, rgba(252, 231, 243, 1) 0%, rgba(251, 207, 232, 0.85) 100%);
        border-color: rgba(219, 39, 119, 0.2);
    }

    .mobile-menu-card.pink::before {
        background: linear-gradient(90deg, #ec4899, #db2777);
    }

    .mobile-menu-card.pink .mobile-menu-icon {
        background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.pink {
        background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(219, 39, 119, 0.15) 100%);
        border-color: rgba(219, 39, 119, 0.3);
    }

    .mobile-menu-card.yellow {
        background: linear-gradient(135deg, rgba(254, 243, 199, 1) 0%, rgba(253, 230, 138, 0.85) 100%);
        border-color: rgba(217, 119, 6, 0.2);
    }

    .mobile-menu-card.yellow::before {
        background: linear-gradient(90deg, #f59e0b, #d97706);
    }

    .mobile-menu-card.yellow .mobile-menu-icon {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    }

    [data-theme="dark"] .mobile-menu-card.yellow {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.15) 100%);
        border-color: rgba(217, 119, 6, 0.3);
    }

    .mobile-menu-label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-primary);
        text-align: center;
        line-height: 1.3;
    }

    /* Mobile Back Button */
    .mobile-back-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        color: var(--text-primary);
        font-size: 0.85rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-right: auto;
    }

    .mobile-back-btn:active {
        transform: scale(0.95);
        background: var(--bg-tertiary);
    }

    .mobile-back-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Hide page title on mobile when back button present */
    .content-header .mobile-back-btn+.page-title {
        display: none;
    }

    /* Mobile Footer */
    .mobile-footer {
        padding: 16px 20px;
        text-align: center;
        font-size: 0.75rem;
        color: var(--text-muted);
        border-top: 1px solid var(--border-color);
        background: var(--bg-secondary);
        flex-shrink: 0;
    }

    .mobile-footer a {
        color: var(--primary-500);
        text-decoration: none;
        font-weight: 600;
    }

    /* Logout Confirmation Modal - Mobile optimized */
    .mobile-logout-modal {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-logout-modal.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-logout-content {
        background: white;
        border-radius: 20px;
        padding: 24px;
        margin: 20px;
        max-width: 320px;
        width: 100%;
        text-align: center;
        transform: scale(0.9);
        transition: transform 0.3s ease;
    }

    [data-theme="dark"] .mobile-logout-content {
        background: #1e293b;
    }

    .mobile-logout-modal.active .mobile-logout-content {
        transform: scale(1);
    }

    .mobile-logout-icon {
        width: 64px;
        height: 64px;
        margin: 0 auto 16px;
        background: #fee2e2;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #dc2626;
    }

    .mobile-logout-icon svg {
        width: 32px;
        height: 32px;
    }

    .mobile-logout-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 8px;
    }

    .mobile-logout-desc {
        font-size: 0.9rem;
        color: var(--text-secondary);
        margin-bottom: 24px;
    }

    .mobile-logout-actions {
        display: flex;
        gap: 12px;
    }

    .mobile-logout-actions button {
        flex: 1;
        padding: 12px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-cancel-logout {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
    }

    .btn-confirm-logout {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        border: none;
        color: white;
    }

    .btn-confirm-logout:active {
        transform: scale(0.97);
    }

    /* Clickable stat cards */
    .mobile-stat-card.clickable {
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-stat-card.clickable:active {
        transform: scale(0.95);
        opacity: 0.9;
    }

    /* Detail Modal */
    .mobile-detail-modal {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 10000;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-detail-modal.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-detail-content {
        width: 100%;
        max-height: 80vh;
        background: white;
        border-radius: 24px 24px 0 0;
        overflow: hidden;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    [data-theme="dark"] .mobile-detail-content {
        background: #1e293b;
    }

    .mobile-detail-modal.active .mobile-detail-content {
        transform: translateY(0);
    }

    .mobile-detail-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .mobile-detail-header h3 {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
    }

    .mobile-detail-close {
        width: 32px;
        height: 32px;
        border: none;
        background: var(--bg-secondary);
        border-radius: 50%;
        font-size: 1rem;
        cursor: pointer;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-detail-body {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
    }

    /* BK Detail Items */
    .bk-detail-item {
        padding: 14px;
        background: var(--bg-secondary);
        border-radius: 12px;
        margin-bottom: 10px;
        position: relative;
    }

    .bk-detail-name {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 0.95rem;
        margin-bottom: 4px;
    }

    .bk-detail-sub {
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .bk-detail-meta {
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-top: 6px;
    }

    .bk-detail-poin {
        position: absolute;
        top: 14px;
        right: 14px;
        background: #fef3c7;
        color: #92400e;
        padding: 4px 10px;
        border-radius: 10px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    [data-theme="dark"] .bk-detail-poin {
        background: #78350f;
        color: #fef3c7;
    }

    /* Wave Transition Overlay - Ultra Realistic */
    .wave-transition-overlay {
        position: fixed;
        inset: 0;
        z-index: 99999;
        pointer-events: none;
        overflow: hidden;
    }

    .wave-transition-overlay .wave-layer {
        position: absolute;
        top: 0;
        height: 100%;
        width: 250%;
        animation-fill-mode: forwards;
    }

    /* Wave 1 - Main wave with smooth organic curve */
    .wave-transition-overlay .wave-1 {
        left: -250%;
        background: linear-gradient(to right,
                rgba(59, 130, 246, 0.95) 0%,
                rgba(59, 130, 246, 0.9) 30%,
                rgba(59, 130, 246, 0.7) 60%,
                rgba(59, 130, 246, 0.3) 85%,
                rgba(59, 130, 246, 0) 100%);
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L1200,0 L1200,800 L0,800 Z M1000,0 Q1050,100 1020,200 Q990,300 1040,400 Q1090,500 1030,600 Q980,700 1020,800 L1200,800 L1200,0 Z' fill='white'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L1200,0 L1200,800 L0,800 Z M1000,0 Q1050,100 1020,200 Q990,300 1040,400 Q1090,500 1030,600 Q980,700 1020,800 L1200,800 L1200,0 Z' fill='white'/%3E%3C/svg%3E");
        -webkit-mask-size: 100% 100%;
        mask-size: 100% 100%;
        animation: oceanWave 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    /* Wave 2 - Secondary wave */
    .wave-transition-overlay .wave-2 {
        left: -250%;
        background: linear-gradient(to right,
                rgba(99, 102, 241, 0.85) 0%,
                rgba(99, 102, 241, 0.75) 25%,
                rgba(99, 102, 241, 0.5) 55%,
                rgba(99, 102, 241, 0.2) 80%,
                rgba(99, 102, 241, 0) 100%);
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L1200,0 L1200,800 L0,800 Z M950,0 Q1010,80 970,180 Q930,280 1000,380 Q1070,480 990,580 Q920,680 980,800 L1200,800 L1200,0 Z' fill='white'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L1200,0 L1200,800 L0,800 Z M950,0 Q1010,80 970,180 Q930,280 1000,380 Q1070,480 990,580 Q920,680 980,800 L1200,800 L1200,0 Z' fill='white'/%3E%3C/svg%3E");
        -webkit-mask-size: 100% 100%;
        mask-size: 100% 100%;
        animation: oceanWave 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.08s forwards;
    }

    /* Wave 3 - Foam/spray effect */
    .wave-transition-overlay .wave-3 {
        left: -250%;
        background: linear-gradient(to right,
                rgba(147, 197, 253, 0.7) 0%,
                rgba(147, 197, 253, 0.5) 20%,
                rgba(147, 197, 253, 0.25) 50%,
                rgba(147, 197, 253, 0.05) 75%,
                rgba(147, 197, 253, 0) 100%);
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L1200,0 L1200,800 L0,800 Z M900,0 Q980,60 920,160 Q870,260 950,360 Q1020,460 940,560 Q870,660 930,800 L1200,800 L1200,0 Z' fill='white'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L1200,0 L1200,800 L0,800 Z M900,0 Q980,60 920,160 Q870,260 950,360 Q1020,460 940,560 Q870,660 930,800 L1200,800 L1200,0 Z' fill='white'/%3E%3C/svg%3E");
        -webkit-mask-size: 100% 100%;
        mask-size: 100% 100%;
        animation: oceanWave 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s forwards;
    }

    /* Ocean wave animation - smooth sweep with natural easing */
    @keyframes oceanWave {
        0% {
            transform: translateX(0);
            opacity: 1;
        }

        60% {
            opacity: 1;
        }

        100% {
            transform: translateX(140%);
            opacity: 0;
        }
    }

    /* Role-based color themes for wave transition */
    .wave-transition-overlay.guru_mapel .wave-1 {
        background: linear-gradient(to right,
                rgba(34, 197, 94, 0.95) 0%, rgba(34, 197, 94, 0.9) 30%, rgba(34, 197, 94, 0.7) 60%, rgba(34, 197, 94, 0.3) 85%, rgba(34, 197, 94, 0) 100%);
    }

    .wave-transition-overlay.guru_mapel .wave-2 {
        background: linear-gradient(to right,
                rgba(16, 185, 129, 0.85) 0%, rgba(16, 185, 129, 0.75) 25%, rgba(16, 185, 129, 0.5) 55%, rgba(16, 185, 129, 0.2) 80%, rgba(16, 185, 129, 0) 100%);
    }

    .wave-transition-overlay.guru_mapel .wave-3 {
        background: linear-gradient(to right,
                rgba(167, 243, 208, 0.7) 0%, rgba(167, 243, 208, 0.5) 20%, rgba(167, 243, 208, 0.25) 50%, rgba(167, 243, 208, 0.05) 75%, rgba(167, 243, 208, 0) 100%);
    }

    .wave-transition-overlay.guru_bk .wave-1 {
        background: linear-gradient(to right,
                rgba(249, 115, 22, 0.95) 0%, rgba(249, 115, 22, 0.9) 30%, rgba(249, 115, 22, 0.7) 60%, rgba(249, 115, 22, 0.3) 85%, rgba(249, 115, 22, 0) 100%);
    }

    .wave-transition-overlay.guru_bk .wave-2 {
        background: linear-gradient(to right,
                rgba(245, 158, 11, 0.85) 0%, rgba(245, 158, 11, 0.75) 25%, rgba(245, 158, 11, 0.5) 55%, rgba(245, 158, 11, 0.2) 80%, rgba(245, 158, 11, 0) 100%);
    }

    .wave-transition-overlay.guru_bk .wave-3 {
        background: linear-gradient(to right,
                rgba(254, 215, 170, 0.7) 0%, rgba(254, 215, 170, 0.5) 20%, rgba(254, 215, 170, 0.25) 50%, rgba(254, 215, 170, 0.05) 75%, rgba(254, 215, 170, 0) 100%);
    }

    .wave-transition-overlay.kepala_sekolah .wave-1 {
        background: linear-gradient(to right,
                rgba(139, 92, 246, 0.95) 0%, rgba(139, 92, 246, 0.9) 30%, rgba(139, 92, 246, 0.7) 60%, rgba(139, 92, 246, 0.3) 85%, rgba(139, 92, 246, 0) 100%);
    }

    .wave-transition-overlay.kepala_sekolah .wave-2 {
        background: linear-gradient(to right,
                rgba(168, 85, 247, 0.85) 0%, rgba(168, 85, 247, 0.75) 25%, rgba(168, 85, 247, 0.5) 55%, rgba(168, 85, 247, 0.2) 80%, rgba(168, 85, 247, 0) 100%);
    }

    .wave-transition-overlay.kepala_sekolah .wave-3 {
        background: linear-gradient(to right,
                rgba(221, 214, 254, 0.7) 0%, rgba(221, 214, 254, 0.5) 20%, rgba(221, 214, 254, 0.25) 50%, rgba(221, 214, 254, 0.05) 75%, rgba(221, 214, 254, 0) 100%);
    }

    /* Foam Bubbles Container */
    .foam-container {
        position: absolute;
        inset: 0;
        pointer-events: none;
        overflow: hidden;
    }

    /* Individual Foam Bubble */
    .foam-bubble {
        position: absolute;
        left: -80px;
        border-radius: 50%;
        background: radial-gradient(circle at 30% 30%,
                rgba(255, 255, 255, 0.95) 0%,
                rgba(255, 255, 255, 0.7) 30%,
                rgba(200, 220, 255, 0.5) 70%,
                rgba(150, 200, 255, 0.3) 100%);
        box-shadow:
            inset -3px -3px 8px rgba(100, 150, 200, 0.3),
            inset 2px 2px 5px rgba(255, 255, 255, 0.8),
            0 2px 10px rgba(100, 150, 200, 0.2);
        animation: foamFloat 0.8s ease-out forwards;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .foam-bubble img {
        width: 60%;
        height: 60%;
        object-fit: contain;
        opacity: 0.7;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    }

    /* Foam bubble animation - sweeps with wave */
    @keyframes foamFloat {
        0% {
            transform: translateX(0) translateY(0) scale(0.5) rotate(0deg);
            opacity: 0;
        }

        15% {
            opacity: 1;
            transform: translateX(100px) translateY(-10px) scale(1) rotate(20deg);
        }

        50% {
            opacity: 0.9;
            transform: translateX(50vw) translateY(10px) scale(0.95) rotate(-10deg);
        }

        85% {
            opacity: 0.6;
            transform: translateX(90vw) translateY(-5px) scale(0.8) rotate(15deg);
        }

        100% {
            transform: translateX(120vw) translateY(0) scale(0.5) rotate(30deg);
            opacity: 0;
        }
    }

    /* Role-based bubble colors */
    .wave-transition-overlay.guru_mapel .foam-bubble {
        background: radial-gradient(circle at 30% 30%,
                rgba(255, 255, 255, 0.95) 0%,
                rgba(255, 255, 255, 0.7) 30%,
                rgba(200, 255, 220, 0.5) 70%,
                rgba(150, 255, 180, 0.3) 100%);
    }

    .wave-transition-overlay.guru_bk .foam-bubble {
        background: radial-gradient(circle at 30% 30%,
                rgba(255, 255, 255, 0.95) 0%,
                rgba(255, 255, 255, 0.7) 30%,
                rgba(255, 220, 200, 0.5) 70%,
                rgba(255, 180, 150, 0.3) 100%);
    }

    .wave-transition-overlay.kepala_sekolah .foam-bubble {
        background: radial-gradient(circle at 30% 30%,
                rgba(255, 255, 255, 0.95) 0%,
                rgba(255, 255, 255, 0.7) 30%,
                rgba(230, 220, 255, 0.5) 70%,
                rgba(200, 180, 255, 0.3) 100%);
    }
}