/* ========================================
   PJSD LMSP — PREMIUM PWA STYLES
   ======================================== */

:root {
    --primary: #0b5ede;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #0b5ede 100%);
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-w: 260px;
    --sidebar-w-collapsed: 72px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* ========================================
   SPLASH
   ======================================== */
.splash-screen {
    position: fixed; inset: 0;
    background: var(--primary-gradient);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    animation: fadeOut 0.5s ease-out 1.5s forwards;
}
.splash-content { text-align: center; color: #fff; }
.splash-logo {
    width: 80px; height: 80px;
    background: rgba(255,255,255,.2);
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    backdrop-filter: blur(10px);
}
.splash-logo i { font-size: 40px; }
.splash-content h1 { font-size: 28px; margin-bottom: 8px; }
.splash-content p { font-size: 14px; opacity: .9; }
.splash-loader {
    width: 40px; height: 40px;
    margin: 30px auto 0;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 500;
    overflow-y: auto;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 28px 28px;
    box-shadow: var(--shadow-xl);
    animation: loginFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- LOGO ---------- */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo i {
    font-size: 44px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    display: inline-block;
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ---------- FORM ---------- */
.login-form {
    margin-top: 0;
}

.form-group {
    margin-bottom: 18px;
}

.form-group > label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.1px;
}

/* ---------- INPUT WRAPPER ---------- */
.input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* Icon — fixed to the left */
.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
    width: 18px;
    text-align: center;
}

/* Input field — proper padding on both sides */
.input-wrapper input {
   width: 100%;
    height: 52px;
    padding: 0 46px 0 52px !important;   /* ← 52px left = icon space + 4px buffer */
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.input-wrapper input:hover {
    border-color: var(--primary-light);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* Password toggle button on right */
.input-wrapper .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.input-wrapper .password-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* ---------- FORM OPTIONS ---------- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
    font-size: 13px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: opacity 0.2s;
}

.forgot-link:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ---------- SUBMIT BUTTON ---------- */
.btn-login {
    width: 100%;
    height: 52px;
    padding: 0 20px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
    letter-spacing: 0.2px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.4);
}

.btn-login:active {
    transform: translateY(0) scale(0.99);
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-login i {
    font-size: 15px;
}

/* ---------- ERROR ---------- */
.login-error {
    margin-top: 16px;
    padding: 12px 14px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid #dc2626;
    animation: errorShake 0.4s ease;
}

.login-error i {
    font-size: 16px;
    flex-shrink: 0;
}

[data-theme="dark"] .login-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-left-color: #ef4444;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

/* ---------- FOOTER ---------- */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}

.login-footer p {
    margin: 0 0 6px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-footer .version {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
}

/* ---------- DARK MODE ---------- */
[data-theme="dark"] .input-wrapper input {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color);
}

[data-theme="dark"] .input-wrapper input:focus {
    background: var(--bg-primary);
    border-color: var(--primary);
}

[data-theme="dark"] .input-wrapper .password-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- MOBILE ---------- */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 20px 24px;
        border-radius: 20px;
    }

    .login-logo i {
        font-size: 38px;
    }

    .login-logo h1 {
        font-size: 22px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-options {
        font-size: 12px;
    }
}

/* ========================================
   APP CONTAINER
   ======================================== */
.app {
    height: 100vh;
    display: flex; flex-direction: column;
    background: var(--bg-secondary);
    position: relative;
}

/* Status Bar */
.status-bar {
    height: 44px;
    background: var(--bg-primary);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px;
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.status-icons { display: flex; gap: 4px; }
.status-icons i { font-size: 10px; }

/* Header */
.app-header {
    background: var(--bg-primary);
    padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; z-index: 100;
    flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: var(--radius-md);
    transition: var(--transition-fast);
}
.menu-toggle:hover { background: var(--bg-secondary); }
.menu-toggle i { font-size: 20px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo i {
    font-size: 24px;
    background: var(--primary-gradient);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo span {
    font-size: 18px; font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.header-icon {
    width: 40px; height: 40px;
    background: none; border: 1px solid var(--border-color);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    position: relative; color: var(--text-secondary);
    transition: var(--transition-fast);
}
.header-icon:hover { background: var(--bg-secondary); color: var(--primary); }
.notification-badge {
    position: absolute; top: -5px; right: -8px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: 20px;
    min-width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
}
.user-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer; overflow: hidden;
    border: 2px solid var(--primary);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ========================================
   DRAWER / SIDEBAR
   ======================================== */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 998;
    opacity: 0; visibility: hidden;
    transition: var(--transition-base);
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer-menu {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-primary);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform var(--transition-base), width var(--transition-base);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-xl);
}
.drawer-menu.open { transform: translateX(0); }

.drawer-header {
    padding: 40px 20px 20px;
    background: var(--primary-gradient);
    color: #fff;
    position: relative;
    flex-shrink: 0;
    min-height: 180px;
}
.drawer-user { text-align: center; }
.drawer-avatar {
    width: 80px; height: 80px;
    border-radius: var(--radius-full);
    border: 3px solid rgba(255,255,255,.3);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}
.drawer-user h3 { font-size: 18px; margin-bottom: 4px; }
.drawer-user p { font-size: 12px; opacity: .8; text-transform: capitalize; }

.drawer-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.drawer-item {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer; background: none; border: none;
    width: 100%; text-align: left; font-size: 15px;
    position: relative;
}
.drawer-item:hover { background: var(--bg-secondary); }
.drawer-item.active { background: var(--bg-secondary); color: var(--primary); }
.drawer-item i { width: 24px; font-size: 20px; color: var(--text-secondary); text-align: center; flex-shrink: 0; }
.drawer-item.active i { color: var(--primary); }
.drawer-item.logout { color: var(--danger); margin-top: auto; }
.drawer-item.logout i { color: var(--danger); }
.drawer-divider { height: 1px; background: var(--border-light); margin: 12px 20px; }

/* ========================================
   MAIN CONTENT
   ======================================== */
.app-main {
    flex: 1; overflow-y: auto;
    padding-bottom: 70px;
    -webkit-overflow-scrolling: touch;
    transition: margin-left var(--transition-base);
}
.page-container { animation: fadeInUp .4s ease-out; padding: 16px; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    border-top: 1px solid var(--border-light);
    z-index: 99;
    transition: margin-left var(--transition-base);
    box-sizing: border-box;
}

.nav-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    text-decoration: none; color: var(--text-tertiary);
    transition: var(--transition-fast);
    padding: 6px 12px; border-radius: var(--radius-md);
    cursor: pointer; background: none; border: none;
    font-family: inherit;
}
.nav-item i { font-size: 22px; }
.nav-item span { font-size: 11px; font-weight: 500; }
.nav-item.active { color: var(--primary); background: var(--bg-secondary); }
.nav-item:hover { color: var(--primary); transform: translateY(-2px); }

/* ========================================
   COMPONENT STYLES
   ======================================== */

.welcome-section {
    background: var(--primary-gradient);
    padding: 24px;
    border-radius: var(--radius-xl);
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%; right: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
}
.welcome-section h2 { font-size: 22px; margin-bottom: 6px; position: relative; }
.welcome-section p { font-size: 13px; opacity: .9; position: relative; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    cursor: pointer;
    border: 1px solid var(--border-color);
}
.stat-card:active { transform: scale(.98); }
.stat-info h3 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.stat-info p { font-size: 11px; color: var(--text-secondary); }
.stat-icon {
    width: 44px; height: 44px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
}
.stat-icon i { font-size: 22px }

/* Section Title */
.section-title {
    display: flex; justify-content: space-between; align-items: center;
    margin: 20px 0 12px;
}
.section-title h3 { font-size: 17px; font-weight: 600; }
.section-title a { color: var(--primary); text-decoration: none; font-size: 13px; font-weight: 500; }

/* Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}
.card:active { transform: scale(.99); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-progress { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-live { background: #fee2e2; color: #dc2626; }
.badge-video { background: #dbeafe; color: #1e40af; }

/* Button */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: none; cursor: pointer;
    font-weight: 600; font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
    width: 100%;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary-gradient); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

/* Form */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

/* Progress Bar */
.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 10px;
}
.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 6px;
    transition: width .6s ease;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 80px; left: 16px; right: 16px;
    z-index: 1001;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: toastSlideUp .3s ease-out;
    pointer-events: auto;
    border-left: 4px solid var(--primary);
    font-size: 13px;
    font-weight: 500;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast i { font-size: 18px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-container {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-container.active { display: flex; }
.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 100%; max-width: 500px;
    max-height: 85vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp .3s ease-out;
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex; gap: 10px;
    justify-content: flex-end;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 56px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    display: block;
    opacity: .5;
}
.empty-state h3 { font-size: 17px; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { font-size: 13px; }

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}
.loading-spinner i { font-size: 28px; display: block; margin-bottom: 8px; }

/* Smooth theme transition */
body, .app, .card, .bottom-nav, .app-header, .drawer-menu, .modal-content {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

@media (max-width: 380px) {
    .stats-grid { gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-info h3 { font-size: 18px; }
    .logo span { font-size: 16px; }
}

/* ========================================
   DESKTOP FOOTER
   ======================================== */
.app-footer {
    display: none;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 20px 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    transition: margin-left var(--transition-base);
    flex-shrink: 0;
}
.app-footer .footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.app-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary);
}
.app-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}
.app-footer .footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .2s;
}
.app-footer .footer-links a:hover { color: var(--primary); }
.app-footer .footer-copy {
    font-size: 12px;
    color: var(--text-tertiary);
}
.app-footer .footer-copy i {
    color: var(--danger);
    margin: 0 2px;
}

/* ========================================
   SIDEBAR COLLAPSE BUTTON
   ======================================== */
.drawer-collapse-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
    padding: 0;
    font-size: 0;
}
.drawer-collapse-btn i {
    font-size: 14px;
    line-height: 1;
    display: block;
    color: #ffffff !important;
}
.drawer-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}
.drawer-collapse-btn:active {
    transform: scale(0.95);
}

/* ========================================
   THEME SWITCH
   ======================================== */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.theme-switch-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 28px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.theme-switch-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.theme-switch input:checked + .theme-switch-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.theme-switch input:checked + .theme-switch-slider::before {
    transform: translateX(24px);
    background: #ffffff;
}
.theme-switch input:focus + .theme-switch-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
[data-theme="dark"] .theme-switch-slider {
    background: #475569;
}
[data-theme="dark"] .theme-switch input:checked + .theme-switch-slider {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
}

/* ========================================
   DESKTOP LAYOUT (≥1025px)
   ======================================== */
@media (min-width: 1025px) {

    /* Hide bottom nav + hamburger */
    .bottom-nav { display: none !important; }
    .menu-toggle { display: none !important; }
    .drawer-overlay { display: none !important; }

    /* Sidebar: fixed, visible, offset content */
    .drawer-menu {
        transform: translateX(0) !important;
        box-shadow: none;
        border-right: 1px solid var(--border-color);
    }

    /* Content pushed right by sidebar width */
    .app-header,
    .app-main,
    .app-footer {
        margin-left: var(--sidebar-w);
    }

    .app-header {
        padding-left: 24px;
    }

    /* Hide logo in header (already shown in sidebar) */
    .app-header .logo {
        display: none;
    }

    /* Wider page container */
    .page-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 24px 32px;
    }

    /* Show footer */
    .app-footer {
        display: block;
    }

    /* Collapse button visible */
    .drawer-collapse-btn {
        display: inline-flex;
    }

    /* Grid stats for desktop */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* ---------- COLLAPSED STATE ---------- */
    body.sidebar-collapsed .drawer-menu {
        width: var(--sidebar-w-collapsed);
    }
    body.sidebar-collapsed .app-header,
    body.sidebar-collapsed .app-main,
    body.sidebar-collapsed .app-footer {
        margin-left: var(--sidebar-w-collapsed);
    }

    body.sidebar-collapsed .drawer-collapse-btn {
        right: 50%;
        transform: translateX(50%);
    }
    body.sidebar-collapsed .drawer-collapse-btn:hover {
        transform: translateX(50%) scale(1.1);
    }
    body.sidebar-collapsed .drawer-collapse-btn i {
        transform: rotate(180deg);
    }

    body.sidebar-collapsed .drawer-user h3,
    body.sidebar-collapsed .drawer-user p,
    body.sidebar-collapsed .drawer-item span,
    body.sidebar-collapsed .drawer-divider {
        display: none;
    }
    body.sidebar-collapsed .drawer-avatar {
        width: 40px;
        height: 40px;
        margin: 0 auto;
    }
    body.sidebar-collapsed .drawer-header {
        padding: 16px 8px;
        min-height: 100px;
    }
    body.sidebar-collapsed .drawer-user {
        margin-top: 30px;
    }
    body.sidebar-collapsed .drawer-item {
        justify-content: center;
        padding: 14px 0;
    }
    body.sidebar-collapsed .drawer-item i {
        margin: 0;
    }

    
    body.sidebar-collapsed .drawer-item:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(14px);
    }
    body.sidebar-collapsed .drawer-item:hover::before {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(8px);
    }
    [data-theme="dark"] body.sidebar-collapsed .drawer-item::after {
        background: #f1f5f9;
        color: #0f172a;
    }
    [data-theme="dark"] body.sidebar-collapsed .drawer-item::before {
        border-right-color: #f1f5f9;
    }
}

/* ========================================
   TABLET (769px – 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .bottom-nav { display: flex; }
    .drawer-menu { transform: translateX(-100%); }
    .drawer-menu.open { transform: translateX(0); }
    .menu-toggle { display: flex; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .app-footer { display: none; }
}

/* ========================================
   MOBILE (≤768px)
   ======================================== */
@media (max-width: 768px) {
    .bottom-nav { display: flex; }
    .drawer-menu { transform: translateX(-100%); }
    .drawer-menu.open { transform: translateX(0); }
    .menu-toggle { display: flex; }
    .app-main { padding-bottom: 70px; }
    .app-footer { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   SIDEBAR TOOLTIP (JS-driven) — 100% Reliable
   ============================================ */

#sidebarTooltip {
    position: fixed;
    background: #0f172a;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 999999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-50%) translateX(-4px);
    letter-spacing: 0.2px;
}

#sidebarTooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Arrow on the left */
#sidebarTooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right-color: #0f172a;
}

/* Dark mode variant */
[data-theme="dark"] #sidebarTooltip {
    background: #f8fafc;
    color: #0f172a;
}
[data-theme="dark"] #sidebarTooltip::before {
    border-right-color: #f8fafc;
}

/* ============================================
   ROUND COLLAPSE ARROW
   ============================================ */

.drawer-collapse-btn {
    position: absolute;
    top: 14px;
    right: -16px;                                /* ← floats over the edge */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    color: var(--primary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 100;
    padding: 0;
    font-size: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.drawer-collapse-btn i {
    font-size: 12px;
    line-height: 1;
    display: block;
    color: var(--primary) !important;
    transition: transform 0.3s ease;
}

.drawer-collapse-btn:hover {
    background: var(--primary);
    color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.drawer-collapse-btn:hover i {
    color: #ffffff !important;
}

.drawer-collapse-btn:active {
    transform: scale(0.95);
}

@media (min-width: 1025px) {
    .drawer-collapse-btn {
        display: inline-flex;
    }
}

/* Collapsed state — recenter to sidebar center */
body.sidebar-collapsed .drawer-collapse-btn {
    right: 0px;
}

body.sidebar-collapsed .drawer-collapse-btn i {
    transform: rotate(180deg);
}

/* ================================================================
    ====================  ANIMATED EFFECTS ======================== */
/* Theme Animation Glow */
.theme-ripple {
    position: fixed;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    transform: scale(0);
    animation: themeRipple 0.7s ease-out forwards;
    pointer-events: none;
    z-index: 99999;
}
@keyframes themeRipple {
    to { transform: scale(3); opacity: 0; }
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    to { background-position: -200% 0; }
}

/* Success Confetti */
.confetti {
    position: fixed;
    width: 8px; height: 8px;
    border-radius: 2px;
    pointer-events: none;
    animation: confettiFly 1.2s ease-out forwards;
}
@keyframes confettiFly {
    to { transform: translate(var(--x), var(--y)) rotate(720deg); opacity: 0; }
}

/* Page Transition Animations */
.page-enter {
    animation: pageIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animated Notification Bell */
.notification-icon.has-new i {
    animation: bellRing 0.8s ease-in-out;
}
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-14deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}

/*  Ripple Effect on Buttons */
.btn { position: relative; overflow: hidden; }
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* Gradient Animated Avatar Ring */
.user-avatar {
    position: relative;
    padding: 2px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899, #6366f1);
    background-size: 300% 300%;
    animation: gradientRotate 3s ease infinite;
    border-radius: 50%;
}
@keyframes gradientRotate {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Star Rating Animations */
.star {
    animation: starPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) backwards;
}
.star:nth-child(1) { animation-delay: 0.1s; }
.star:nth-child(2) { animation-delay: 0.2s; }
.star:nth-child(3) { animation-delay: 0.3s; }
.star:nth-child(4) { animation-delay: 0.4s; }
.star:nth-child(5) { animation-delay: 0.5s; }
@keyframes starPop {
    from { transform: scale(0) rotate(-180deg); }
    to { transform: scale(1) rotate(0); }
}

/* Offline Mode Banner */
.offline-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #f59e0b;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 99999;
}
.offline-banner.show { transform: translateY(0); }

mark {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 3px;
    animation: highlightPulse 0.3s ease;
}

/* Animated Attendance Clock */
.clock-colon {
    animation: blink 1s infinite;
}
@keyframes blink {
    50% { opacity: 0.3; }
}

/*  Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 20px rgba(99,102,241,.4);
    transition: transform 0.3s ease;
    z-index: 1000;
}
.fab.open { transform: rotate(45deg); }

.fab-option {
    position: absolute;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.fab.open .fab-option {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   FLOATING ACTION BUTTON (FAB) MENU — REFINED
   ============================================ */

.fab-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 900;    
}

@media (max-width: 1024px) {
    .fab-container {
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        right: 18px;
    }
}

/* ---------- MAIN FAB ---------- */
.fab-main {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #0b5ede 100%);
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
    z-index: 902;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fab-main i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    font-size: 22px;
}

.fab-main:active {
    transform: scale(0.92);
}

/* Rotate + when open */
.fab-container.open .fab-main {
    transform: rotate(135deg);
    box-shadow:
        0 8px 32px rgba(99, 102, 241, 0.55),
        0 4px 16px rgba(0, 0, 0, 0.18);
}

/* ---------- FAB OPTIONS ---------- */
.fab-options {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 58px;
    height: 58px;
    pointer-events: none;
}

.fab-option {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--primary);
    font-size: 17px;
    cursor: pointer;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.3) translate(0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(99, 102, 241, 0.15);
    will-change: transform, opacity;
}

.fab-option:active {
    transform: scale(0.92) !important;
}

/* ========================================
   ARC POSITIONING — 4 options at
   90° (up), 45°, 0° (left), and -45° (up-left)
   ======================================== */

/* Open state */
.fab-container.open .fab-options {
    pointer-events: auto;
}

/* Option 1 — Straight up */
.fab-container.open .fab-option:nth-child(1) {
    opacity: 1;
    transform: scale(1) translate(0, -78px);
    transition-delay: 0.05s;
}

/* Option 2 — Up-left at 45° */
.fab-container.open .fab-option:nth-child(2) {
    opacity: 1;
    transform: scale(1) translate(-55px, -55px);
    transition-delay: 0.1s;
}

/* Option 3 — Left */
.fab-container.open .fab-option:nth-child(3) {
    opacity: 1;
    transform: scale(1) translate(-78px, 0);
    transition-delay: 0.15s;
}

/* Option 4 — Down-left */
.fab-container.open .fab-option:nth-child(4) {
    opacity: 1;
    transform: scale(1) translate(-55px, 55px);
    transition-delay: 0.2s;
}

/* ---------- TOOLTIP ---------- */
.fab-option::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
}

.fab-option::before {
    content: '';
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #0f172a;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
}

.fab-option:hover::after,
.fab-option:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ---------- BACKDROP (much lighter) ---------- */
.fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(1px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    z-index: 901;              /* ← keep */
    pointer-events: none;
}

/* Main FAB — ABOVE the backdrop */
.fab-main {
    /* ...existing styles... */
    z-index: 999 !important;   /* ← force above backdrop */
}

/* Options — also ABOVE the backdrop */
.fab-options {
    /* ...existing... */
    z-index: 998 !important;
}

.fab-option {
    /* ...existing... */
    z-index: 998 !important;
}

/* Container — above everything */
.fab-container {
    /* ...existing... */
    z-index: 1000;
}

.fab-container.open .fab-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---------- PULSE ANIMATION (idle) ---------- */
@keyframes fabPulse {
    0%, 100% {
        box-shadow:
            0 6px 20px rgba(99, 102, 241, 0.45),
            0 0 0 0 rgba(99, 102, 241, 0.5);
    }
    50% {
        box-shadow:
            0 6px 20px rgba(99, 102, 241, 0.45),
            0 0 0 14px rgba(99, 102, 241, 0);
    }
}

.fab-container:not(.open) .fab-main {
    animation: fabPulse 2.5s ease-out infinite;
}

.fab-container.open .fab-main {
    animation: none;
}

/* ---------- DARK MODE ---------- */
[data-theme="dark"] .fab-option {
    background: #1e293b;
    color: #a5b4fc;
    border-color: #334155;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .fab-option:hover {
    background: #6366f1;
    color: #ffffff;
}

/* ---------- HOVER ---------- */
.fab-option:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

.fab-container.hidden-while-drawer {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: all 0.25s ease;
}

/* ============================================
   COURSE PROGRESS MAP
   ============================================ */

.course-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    padding: 20px 24px;
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.course-map-title h2 {
    font-size: 20px;
    margin: 0 0 4px;
    font-weight: 700;
}

.course-map-title p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.progress-ring-svg {
    transform: rotate(-90deg);
}

.progress-ring-svg .ring-bg {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 5;
}

.progress-ring-svg .ring-fill {
    fill: transparent;
    stroke: #ffffff;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring-svg .ring-text {
    fill: #fff;
    font-size: 14px;
    font-weight: 700;
    transform: rotate(90deg);
    transform-origin: 35px 35px;
}

/* ---------- MAP CONTAINER ---------- */
.course-map {
    position: relative;
    padding: 30px 0 60px;
}

/* Vertical path line */
.map-path {
    position: absolute;
    left: 50%;
    top: 40px;
    bottom: 100px;
    width: 3px;
    background: var(--border-color);
    transform: translateX(-50%);
    border-radius: 2px;
    z-index: 0;
}

/* Animated fill */
.map-path-fill {
    position: absolute;
    left: 50%;
    top: 40px;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    transform: translateX(-50%);
    border-radius: 2px;
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* ---------- NODE ---------- */
.map-node {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 2;
}

.map-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.map-node[data-side="left"] {
    flex-direction: row;
    padding-right: calc(50% + 30px);
    justify-content: flex-end;
}

.map-node[data-side="right"] {
    flex-direction: row-reverse;
    padding-left: calc(50% + 30px);
    justify-content: flex-end;
}

/* ---------- MARKER ---------- */
.node-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Completed — green with check */
.map-node.completed .node-marker {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

/* Active — pulsing purple */
.map-node.active .node-marker {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #6366f1;
    color: #fff;
    animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(99, 102, 241, 0.15);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Locked — grey */
.map-node.locked .node-marker {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-tertiary);
    opacity: 0.7;
}

/* ---------- NODE CONTENT ---------- */
.node-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 18px;
    max-width: 320px;
    min-width: 220px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
}

.map-node.completed .node-content {
    border-left: 4px solid #10b981;
}

.map-node.active .node-content {
    border-left: 4px solid #6366f1;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.map-node.locked .node-content {
    opacity: 0.6;
    cursor: not-allowed;
    border-left: 4px solid var(--border-color);
}

.node-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.map-node.locked .node-content:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.node-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.node-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.node-meta i {
    font-size: 11px;
}

.node-status {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.node-status.done {
    background: #d1fae5;
    color: #065f46;
}

.node-status.active-status {
    background: #dbeafe;
    color: #1e40af;
    animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.node-status.locked-status {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}

/* Node mini progress bar */
.node-progress-bar {
    margin-top: 10px;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.node-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* ---------- FINISH FLAG ---------- */
.map-finish {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.map-finish.reached {
    opacity: 1;
}

.finish-flag {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 20px;
    transition: all 0.5s ease;
}

.map-finish.reached .finish-flag {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 3px solid #f59e0b;
    color: #fff;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2);
    animation: flagWave 2s ease-in-out infinite;
}

@keyframes flagWave {
    0%, 100% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.05) rotate(-5deg); }
    75% { transform: scale(1.05) rotate(5deg); }
}

.finish-text {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.map-finish.reached .finish-text {
    color: #d97706;
}

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {

    .course-map-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    /* On mobile, all nodes go on right side for simplicity */
    .map-path,
    .map-path-fill {
        left: 24px;
    }

    .map-node[data-side="left"],
    .map-node[data-side="right"] {
        flex-direction: row;
        padding-left: 60px;
        padding-right: 0;
        justify-content: flex-start;
    }

    .node-marker {
        left: 24px;
        transform: translate(-50%, -50%);
    }

    .map-node.active .node-marker {
        animation: none;
        transform: translate(-50%, -50%);
    }

    .node-content {
        max-width: 100%;
        min-width: 0;
        flex: 1;
    }
}

/* ---------- DARK MODE ---------- */
[data-theme="dark"] .node-content {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .map-node.completed .node-marker {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .map-node.active .node-marker {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.btn-map-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-bottom: 16px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-map-back:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateX(-3px);
}

/* ============================================
   SKELETON LOADER PAGE
   ============================================ */

.skeleton-page {
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

.skeleton-hero {
    height: 100px;
    margin-bottom: 16px;
    border-radius: var(--radius-xl);
}

.skeleton-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 1025px) {
    .skeleton-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.skeleton-stat {
    height: 80px;
    border-radius: var(--radius-lg);
}

.skeleton-title {
    height: 20px;
    width: 40%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-card {
    height: 80px;
    margin-bottom: 12px;
    border-radius: var(--radius-lg);
}

/* Ensure skeleton uses existing shimmer class */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   BUTTON RIPPLE EFFECT
   ============================================ */

.btn, .btn-primary, .btn-ghost, .btn-danger, .btn-success, .btn-sm, .nav-item, .drawer-item {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
    z-index: 1;
}

.btn-ghost .ripple-effect,
.btn-outline .ripple-effect {
    background: rgba(99, 102, 241, 0.25);
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   DASHBOARD CHARTS
   ============================================ */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (min-width: 900px) {
    .charts-grid {
        grid-template-columns: 1.5fr 1fr;
    }
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-xs);
    animation: fadeInUp 0.4s ease-out;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.chart-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.chart-header h3 i {
    color: var(--primary);
    font-size: 14px;
}

.chart-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
}

@media (max-width: 480px) {
    .chart-wrapper {
        height: 180px;
    }
}

.chart-wrapper canvas {
    max-height: 100%;
}

/* ============================================
   FORGOT PASSWORD MODAL
   ============================================ */

.forgot-modal {
    max-width: 460px;
    border-radius: 24px;
    overflow: hidden;
    animation: modalSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- HEADER ---------- */
.forgot-header {
    position: relative;
    text-align: center;
    padding: 32px 24px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.forgot-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    animation: iconPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.forgot-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes iconPop {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.forgot-icon-wrapper i {
    font-size: 28px;
    color: #ffffff;
}

.forgot-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.3px;
}

.forgot-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.4;
    max-width: 320px;
}

.forgot-header .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 32px;
    height: 32px;
}

.forgot-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
    color: #ffffff;
}

/* ---------- BODY ---------- */
.forgot-modal .modal-body {
    padding: 24px;
    background: var(--bg-primary);
}

.forgot-modal .form-group {
    margin-bottom: 0;
}

.forgot-modal .form-group > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.forgot-modal .input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.forgot-modal .input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

.forgot-modal .input-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.forgot-modal .input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.forgot-modal .input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.form-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-hint i {
    color: var(--primary);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ---------- FOOTER ---------- */
.forgot-footer {
    padding: 16px 24px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
}

.forgot-footer .btn {
    flex: 1;
}

.forgot-footer .btn i {
    font-size: 13px;
}

/* ---------- SUCCESS STATE ---------- */
.forgot-modal.success-state {
    overflow: visible;
}

.forgot-success {
    padding: 40px 28px 32px;
    text-align: center;
    background: var(--bg-primary);
}

/* Animated checkmark (SVG-free, pure CSS) */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #10b981;
    background: transparent;
    animation: checkScale 0.5s ease-out;
}

.check-icon .icon-line {
    height: 5px;
    background: #10b981;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.check-icon .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: iconLineTip 0.75s 0.3s ease-out forwards;
    transform-origin: 100% 100%;
    opacity: 0;
}

.check-icon .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: iconLineLong 0.75s 0.3s ease-out forwards;
    transform-origin: 0 100%;
    opacity: 0;
}

.check-icon .icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    top: -4px;
    left: -4px;
    z-index: 1;
}

.check-icon .icon-fix {
    width: 5px;
    height: 90px;
    background: var(--bg-primary);
    position: absolute;
    top: -4px;
    left: 28px;
    z-index: 9;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
    animation: iconFix 0.75s 0.3s ease-out forwards;
}

@keyframes checkScale {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes iconLineTip {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: 25px;
        opacity: 1;
    }
}

@keyframes iconLineLong {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: 47px;
        opacity: 1;
    }
}

@keyframes iconFix {
    0% {
        height: 90px;
    }
    100% {
        height: 0;
    }
}

.forgot-success h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
    animation: fadeInUp 0.5s 0.7s ease-out backwards;
}

.forgot-success-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 24px;
    animation: fadeInUp 0.5s 0.8s ease-out backwards;
}

.forgot-success-text strong {
    color: var(--primary);
    font-weight: 600;
    word-break: break-all;
}

.success-info {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    animation: fadeInUp 0.5s 0.9s ease-out backwards;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.info-row i {
    color: var(--primary);
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.forgot-footer-inline {
    display: flex;
    gap: 10px;
    animation: fadeInUp 0.5s 1s ease-out backwards;
}

.forgot-footer-inline .btn {
    flex: 1;
}

/* ---------- SHAKE ANIMATION ---------- */
.shake {
    animation: shakeAnim 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;
}

@keyframes shakeAnim {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

/* ---------- DARK MODE ---------- */
[data-theme="dark"] .forgot-modal .input-wrapper input {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .forgot-modal .input-wrapper input:focus {
    background: var(--bg-primary);
}

[data-theme="dark"] .success-info {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .check-icon .icon-fix {
    background: var(--bg-card);
}

/* ---------- MOBILE ---------- */
@media (max-width: 480px) {
    .forgot-modal {
        width: 95%;
        border-radius: 20px;
    }

    .forgot-header {
        padding: 24px 20px 20px;
    }

    .forgot-header h3 {
        font-size: 19px;
    }

    .forgot-icon-wrapper {
        width: 56px;
        height: 56px;
    }

    .forgot-icon-wrapper i {
        font-size: 24px;
    }

    .forgot-modal .modal-body,
    .forgot-success {
        padding: 20px;
    }

    .forgot-footer,
    .forgot-footer-inline {
        flex-direction: column-reverse;
    }

    .forgot-footer .btn,
    .forgot-footer-inline .btn {
        width: 100%;
    }
}

/* ============================================
   PREMIUM SETTINGS PAGE
   ============================================ */

/* ---------- SECTION ---------- */
.settings-section {
    margin-bottom: 24px;
    animation: settingsFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.settings-section:nth-child(1) { animation-delay: 0.05s; }
.settings-section:nth-child(2) { animation-delay: 0.1s; }
.settings-section:nth-child(3) { animation-delay: 0.15s; }
.settings-section:nth-child(4) { animation-delay: 0.2s; }
.settings-section:nth-child(5) { animation-delay: 0.25s; }

@keyframes settingsFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin: 0 0 10px 4px;
}

.settings-section-title i {
    font-size: 12px;
    color: var(--primary);
}

/* ---------- GROUP ---------- */
.settings-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* ---------- ITEM ---------- */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-bottom: 1px solid var(--border-light);
    animation: settingsItemIn 0.4s ease backwards;
    opacity: 0;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: var(--bg-secondary);
    padding-left: 20px;
}

.settings-item:active {
    background: var(--bg-tertiary);
}

@keyframes settingsItemIn {
    to {
        opacity: 1;
    }
}

/* ---------- LEFT SIDE ---------- */
.settings-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.settings-item:hover .settings-icon {
    transform: scale(1.1) rotate(-4deg);
}

/* Icon variants */
.settings-icon.icon-biometric { background: linear-gradient(135deg, #10b981, #059669); }
.settings-icon.icon-security  { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.settings-icon.icon-privacy   { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.settings-icon.icon-theme     { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.settings-icon.icon-offline   { background: linear-gradient(135deg, #64748b, #475569); }
.settings-icon.icon-notif     { background: linear-gradient(135deg, #f59e0b, #d97706); }
.settings-icon.icon-cache     { background: linear-gradient(135deg, #ec4899, #db2777); }
.settings-icon.icon-update    { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.settings-icon.icon-about     { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.settings-icon.icon-help      { background: linear-gradient(135deg, #10b981, #059669); }
.settings-icon.icon-rate      { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.settings-icon.icon-share     { background: linear-gradient(135deg, #06b6d4, #0284c7); }
.settings-icon.icon-logout    { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* ---------- TEXT ---------- */
.settings-text {
    flex: 1;
    min-width: 0;
}

.settings-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    transition: color 0.2s;
}

.settings-desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- ARROW + VALUE ---------- */
.settings-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.settings-item:hover .settings-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

.settings-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ---------- RATING STARS ---------- */
.settings-stars {
    display: flex;
    gap: 2px;
    color: #fbbf24;
    font-size: 11px;
    flex-shrink: 0;
}

/* ---------- DANGER ZONE ---------- */
.settings-group.danger-group {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
}

.danger-item:hover {
    background: rgba(239, 68, 68, 0.08) !important;
}

.danger-label {
    color: var(--danger) !important;
}

.danger-desc {
    color: rgba(239, 68, 68, 0.7) !important;
}

.danger-arrow {
    color: var(--danger) !important;
}

/* ============================================
   SECURITY CENTER
   ============================================ */
.security-center {
    padding: 4px 0;
}

.security-score {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin-bottom: 20px;
}

.score-circle {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: transparent;
    stroke: var(--border-color);
    stroke-width: 6;
}

.score-fill {
    fill: transparent;
    stroke: url(#scoreGradient);
    stroke: #10b981;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-text strong {
    font-size: 24px;
    font-weight: 800;
    color: var(--success);
    line-height: 1;
}

.score-text span {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.security-score p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.security-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.security-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #ffffff;
}

.security-item-icon.verified { background: #10b981; }
.security-item-icon.warning  { background: #f59e0b; }

.security-item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.security-item-text strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.security-item-text span {
    font-size: 11px;
    color: var(--text-secondary);
}

.security-tip {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
}

[data-theme="dark"] .security-tip {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.security-tip i {
    color: #f59e0b;
    font-size: 16px;
    flex-shrink: 0;
}

.security-tip p {
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   PRIVACY CENTER
   ============================================ */
.privacy-center {
    padding: 4px 0;
}

.privacy-intro {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.5;
}

.privacy-intro i {
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.privacy-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.privacy-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.privacy-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    font-size: 15px;
}

.privacy-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.privacy-text strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.privacy-text span {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.privacy-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.privacy-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* ============================================
   HELP & SUPPORT
   ============================================ */
.help-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.help-cat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.help-cat-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.help-cat-btn i {
    font-size: 22px;
    color: var(--primary);
    transition: color 0.25s;
}

.help-cat-btn:hover i {
    color: #ffffff;
}

.help-cat-btn span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.25s;
}

.help-cat-btn:hover span {
    color: #ffffff;
}

.help-contact h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}

.help-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.help-contact-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.help-contact-item i:first-child {
    color: var(--primary);
    font-size: 16px;
    width: 20px;
}

.help-contact-item span {
    flex: 1;
}

.help-contact-item i:last-child {
    color: var(--text-tertiary);
    font-size: 11px;
}

/* ============================================
   FAQ LIST
   ============================================ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-item-modal:hover {
    background: var(--bg-tertiary);
}

.faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-q i {
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item-modal.open .faq-q i {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: all 0.3s ease;
}

.faq-item-modal.open .faq-a {
    max-height: 200px;
    padding: 0 16px 14px;
}

/* ============================================
   RATE APP MODAL
   ============================================ */
.rate-app-modal {
    text-align: center;
    padding: 8px 0;
}

.rate-hero i {
    font-size: 48px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    display: inline-block;
}

.rate-hero h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.rate-hero p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 24px;
}

.rate-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.rate-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 32px;
    color: var(--border-color);
    transition: all 0.2s ease;
}

.rate-star:hover,
.rate-star.active {
    color: #fbbf24;
    transform: scale(1.15);
}

.rate-star:hover ~ .rate-star {
    color: var(--border-color);
}

.rate-feedback {
    animation: fadeIn 0.3s ease;
}

.rate-feedback textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    resize: vertical;
    outline: none;
}

.rate-feedback textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================
   SHARE APP MODAL
   ============================================ */
.share-app-modal {
    text-align: center;
    padding: 8px 0;
}

.share-hero i {
    font-size: 42px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    display: inline-block;
}

.share-hero h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.share-hero p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 20px;
}

.share-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-link-box input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 12px;
    text-decoration: none;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    font-family: inherit;
}

.share-btn i {
    font-size: 22px;
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.email    { background: #ea4335; }
.share-btn.more     { background: var(--primary); }

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

/* ============================================
   ABOUT APP MODAL
   ============================================ */
.about-app-modal {
    text-align: center;
    padding: 4px 0;
}

.about-hero {
    margin-bottom: 24px;
}

.about-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.about-logo i {
    font-size: 34px;
    color: #ffffff;
}

.about-hero h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.about-version {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.about-info {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 4px 16px;
    margin-bottom: 16px;
}

.about-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    gap: 16px;
}

.about-row:last-child {
    border-bottom: none;
}

.about-row span {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.about-row strong {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.about-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.about-actions .btn {
    flex: 1;
    min-width: 90px;
}

.about-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.about-footer p {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 0;
}

.about-footer i {
    color: var(--danger);
}

/* ============================================
   UPDATE AVAILABLE MODAL
   ============================================ */
.update-available {
    text-align: center;
    padding: 8px 0;
}

.update-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    animation: bounceUpdate 2s ease-in-out infinite;
}

@keyframes bounceUpdate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.update-icon i {
    font-size: 32px;
    color: #ffffff;
}

.update-available h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.update-available > p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 20px;
}

.update-highlights {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px 16px;
}

.update-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.update-highlights i {
    color: var(--success);
    font-size: 13px;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .settings-item {
        padding: 12px 14px;
    }

    .settings-item:hover {
        padding-left: 16px;
    }

    .settings-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .settings-label {
        font-size: 13px;
    }

    .settings-desc {
        font-size: 11px;
    }

    .help-categories {
        grid-template-columns: 1fr;
    }

    .help-cat-btn {
        flex-direction: row;
        padding: 12px 16px;
        gap: 12px;
    }

    .help-cat-btn span {
        flex: 1;
        text-align: left;
    }

    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-actions {
        flex-direction: column;
    }

    .about-actions .btn {
        width: 100%;
    }

    .rate-star {
        font-size: 28px;
    }
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */
[data-theme="dark"] .settings-group {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .settings-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .settings-value {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .settings-group.danger-group {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.03));
}

[data-theme="dark"] .help-contact-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   SETTINGS ITEMS FIX — DO NOT REMOVE
   ============================================ */

.settings-item {
    opacity: 1 !important;
    animation: none !important;
}

.settings-section {
    opacity: 1 !important;
    animation: none !important;
}

/* ============================================
   LOGIN DIVIDER
   ============================================ */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    padding: 0 4px;
    text-transform: uppercase;
}

/* ============================================
   BIOMETRIC LOGIN BUTTON
   ============================================ */
.btn-biometric {
    width: 100%;
    height: 52px;
    padding: 0 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-biometric i {
    font-size: 20px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.btn-biometric:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.btn-biometric:hover i {
    transform: scale(1.15);
}

.btn-biometric:active {
    transform: translateY(0) scale(0.98);
}

.btn-biometric:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Pulse animation — draws attention */
.btn-biometric:not(:disabled)::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    animation: bioPulse 2.5s ease-in-out infinite;
}

@keyframes bioPulse {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Scanning state (during verification) */
.btn-biometric.scanning {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.btn-biometric.scanning i {
    animation: bioScan 1s ease-in-out infinite;
}

@keyframes bioScan {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

/* Success state */
.btn-biometric.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}

.btn-biometric.success i {
    color: #10b981;
    animation: bioSuccess 0.5s ease;
}

@keyframes bioSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Dark mode */
[data-theme="dark"] .btn-biometric {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .btn-biometric:hover {
    background: rgba(255, 255, 255, 0.06);
}

.login-resume-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    margin-bottom: 20px;
    animation: slideDown 0.5s ease;
}

.login-resume-banner i {
    font-size: 24px;
    color: var(--primary);
}

.login-resume-banner strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
}

.login-resume-banner span {
    font-size: 11px;
    color: var(--text-secondary);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   COURSE PLAYER
   ============================================ */

.player-container {
    padding: 16px;
    max-width: 100%;
}

/* Back button */
.btn-player-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-bottom: 16px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-player-back:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateX(-3px);
}

/* Player card */
.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.player-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.player-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.3;
}

.player-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.player-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-meta i {
    color: var(--primary);
    font-size: 12px;
}

/* Video wrapper — 16:9 responsive */
.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* PDF viewer */
.pdf-viewer {
    width: 100%;
    height: 600px;
    border: none;
    background: var(--bg-secondary);
    display: block;
}

.pdf-actions {
    padding: 14px 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

/* Text content */
.text-content {
    padding: 24px;
    line-height: 1.7;
    color: var(--text-primary);
    font-size: 15px;
}

/* Progress bar for video */
.player-progress {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.player-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.player-progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.player-progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* Action buttons */
.player-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.player-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* Module list sidebar */
.module-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.module-list h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.module-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.module-list-item:hover {
    background: var(--bg-secondary);
}

.module-list-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-left: 3px solid var(--primary);
}

.module-list-item .module-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.module-list-item.completed .module-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.module-list-item .module-info {
    flex: 1;
    min-width: 0;
}

.module-list-item .module-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-list-item .module-info small {
    font-size: 11px;
    color: var(--text-tertiary);
}

.module-list-item .module-status {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: var(--border-color);
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.module-list-item.completed .module-status {
    background: #10b981;
    color: #fff;
}

.module-list-item.in_progress .module-status {
    background: var(--primary);
    color: #fff;
}

/* Mobile */
@media (max-width: 768px) {
    .player-header {
        padding: 16px;
    }

    .player-header h1 {
        font-size: 17px;
    }

    .pdf-viewer {
        height: 400px;
    }

    .player-actions .btn {
        min-width: 0;
        font-size: 13px;
    }
}

/* ============================================
   ADVANCED REPORTS
   ============================================ */

.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 16px;
    color: #fff;
}

.reports-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.reports-header p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.reports-header .btn-ghost {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.reports-header .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.reports-header .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: none;
}

.reports-header .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* KPI Cards */
.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 1025px) {
    .reports-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}

.kpi-revenue { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-users { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.kpi-engagement { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-attendance { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.kpi-info {
    flex: 1;
    min-width: 0;
}

.kpi-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.kpi-trend.positive { color: #10b981; }
.kpi-trend.negative { color: #ef4444; }

/* Charts */
.reports-charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 900px) {
    .reports-charts-row {
        grid-template-columns: 1.5fr 1fr;
    }
    .reports-charts-row:nth-child(4) {
        grid-template-columns: 1fr 1.5fr;
    }
}

.chart-card-wide,
.chart-card-narrow {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    animation: fadeInUp 0.5s ease backwards;
}

.chart-wrapper-lg {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-wrapper-lg canvas {
    max-height: 100%;
}

/* Top Courses */
.top-courses-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

.top-course-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: all 0.2s;
}

.top-course-row:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.top-course-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); }
.top-course-rank.rank-4,
.top-course-rank.rank-5 { background: var(--text-tertiary); }

.top-course-info {
    flex: 1;
    min-width: 0;
}

.top-course-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-course-info small {
    font-size: 11px;
    color: var(--text-secondary);
}

.top-course-revenue {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
    flex-shrink: 0;
}

/* Export Section */
.reports-export-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.reports-export-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reports-export-section h3 i {
    color: var(--primary);
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.export-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.export-btn i {
    font-size: 16px;
    color: var(--primary);
    transition: color 0.25s;
}

.export-btn:hover i {
    color: #fff;
}

@media (max-width: 480px) {
    .reports-header {
        flex-direction: column;
        text-align: center;
    }
    .reports-header h2 {
        font-size: 18px;
    }
    .kpi-value {
        font-size: 18px;
    }
    .kpi-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .chart-wrapper-lg {
        height: 200px;
    }
}

/* ============================================
   AI CHAT WIDGET
   ============================================ */

.chat-widget {
    position: fixed;
    bottom: 170px;
    right: 20px;
    z-index: 950;
}

@media (max-width: 1024px) {
    .chat-widget {
        bottom: calc(160px + env(safe-area-inset-bottom, 0px));
        right: 18px;
    }
}

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #0b5ede 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    transition: all 0.3s;
    position: relative;
    animation: chatPulse 3s ease-in-out infinite;
}

@keyframes chatPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5),
                    0 0 0 0 rgba(139, 92, 246, 0.5);
    }
    50% {
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5),
                    0 0 0 12px rgba(139, 92, 246, 0);
    }
}

.chat-toggle:hover {
    transform: scale(1.08);
}

.chat-pulse {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 951;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.chat-window.open {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

@media (max-width: 1024px) {
    .chat-window {
        bottom: calc(160px + env(safe-area-inset-bottom, 0px));
        right: 18px;
        height: 500px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }
}

/* Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-header-info strong {
    font-size: 14px;
    display: block;
}

.chat-header-info small {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-status-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

/* Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    animation: messageIn 0.3s ease;
    word-wrap: break-word;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
    background: var(--bg-primary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.chat-message.user {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.typing {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    align-self: flex-start;
    background: var(--bg-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.typing span {
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typing 1.2s ease-in-out infinite;
}

.chat-message.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-message.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Suggestions */
.chat-suggestions {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    overflow-x: auto;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    scrollbar-width: none;
}

.chat-suggestions::-webkit-scrollbar {
    display: none;
}

.chat-suggestion {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-suggestion:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Input */
.chat-input-wrapper {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
}

.chat-input-wrapper input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.chat-input-wrapper input:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
}

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   SLIM SCROLLBARS — Global
   ============================================ */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

[data-theme="dark"] * {
    scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}

/* WebKit (Chrome, Safari, Edge, Opera) */
::-webkit-scrollbar {
    width: 6px;             /* vertical */
    height: 6px;            /* horizontal */
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 8px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.65);
}

::-webkit-scrollbar-thumb:active {
    background: rgba(99, 102, 241, 0.85);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Dark mode scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* ============================================
   SCROLLBAR — Hide on mobile (native handles it)
   ============================================ */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
    
    * {
        scrollbar-width: none;
    }
}

/* ============================================
   SPECIFIC AREAS
   ============================================ */

/* Main content — main vertical scroll */
.app-main::-webkit-scrollbar {
    width: 5px;
}

/* Drawer / sidebar navigation */
.drawer-nav::-webkit-scrollbar {
    width: 4px;
}

.drawer-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
}

.drawer-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Chat body */
.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.35);
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.65);
}

/* Modals */
.modal-body::-webkit-scrollbar {
    width: 5px;
}

/* Course map (horizontal scroll) */
.course-map::-webkit-scrollbar,
.module-list::-webkit-scrollbar,
.course-map-container::-webkit-scrollbar {
    height: 5px;
    width: 5px;
}

/* ============================================
   SCROLLBAR — Auto-hide (fade in on scroll)
   ============================================ */

/* Only show scrollbar when user is actively scrolling */
@supports selector(::-webkit-scrollbar-thumb:vertical) {
    .app-main {
        scrollbar-color: transparent transparent;
    }
    
    .app-main:hover {
        scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
    }
}


.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-area i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
}

.file-upload-area p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.file-upload-area small {
    font-size: 11px;
    color: var(--text-tertiary);
}

.file-name-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 13px;
}

.file-name-display i {
    color: #10b981;
}

.file-name-display span:nth-child(2) {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-name-display .remove-file {
    cursor: pointer;
    color: var(--danger);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

/* ============================================
   CONFIRMATION MODAL — Corporate Responsive
   ============================================ */

/* Hide default modal-content when confirm is active */
.modal-container.confirm-active .modal-content {
    display: none;
}

/* Backdrop */
.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    z-index: 1;
}

.confirm-modal-backdrop.show {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}

/* ---------- SHEET (Mobile First) ---------- */
.confirm-modal-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding: 12px 20px 28px;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.25);
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.confirm-modal-sheet.show {
    transform: translateY(0);
}

/* Drag handle (visual hint for mobile) */
.confirm-modal-drag-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    margin: 0 auto 16px;
}

/* Body */
.confirm-modal-body {
    text-align: center;
    padding: 0 8px;
}

/* Icon */
.confirm-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
    color: #ffffff;
    position: relative;
    animation: confirmIconPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.confirm-modal-icon::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: confirmPulse 2s ease-out infinite;
}

@keyframes confirmIconPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes confirmPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Icon colors */
.confirm-modal-icon.icon-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #6366f1; }
.confirm-modal-icon.icon-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #ef4444; }
.confirm-modal-icon.icon-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #f59e0b; }
.confirm-modal-icon.icon-success { background: linear-gradient(135deg, #10b981, #059669); color: #10b981; }

.confirm-modal-icon i {
    color: #ffffff;
    position: relative;
    z-index: 1;
}

/* Title */
.confirm-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
    letter-spacing: -0.3px;
    animation: confirmSlideUp 0.4s ease 0.1s backwards;
}

/* Message */
.confirm-modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 6px;
    animation: confirmSlideUp 0.4s ease 0.15s backwards;
}

/* Subtitle */
.confirm-modal-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin: 0 0 20px;
    animation: confirmSlideUp 0.4s ease 0.2s backwards;
}

@keyframes confirmSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Actions */
.confirm-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    animation: confirmSlideUp 0.4s ease 0.25s backwards;
}

.confirm-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.confirm-btn i {
    font-size: 13px;
}

.confirm-btn:active {
    transform: scale(0.97);
}

/* Cancel button */
.confirm-btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.confirm-btn-cancel:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

/* Confirm variants */
.confirm-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}
.confirm-btn-primary:hover {
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.confirm-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}
.confirm-btn-danger:hover {
    box-shadow: 0 10px 28px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.confirm-btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}
.confirm-btn-warning:hover {
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.confirm-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}
.confirm-btn-success:hover {
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

/* ============================================
   DESKTOP — Centered modal, scale-in
   ============================================ */
@media (min-width: 641px) {
    .confirm-modal-sheet {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        max-width: 460px;
        width: 90%;
        margin: auto;
        border-radius: 24px;
        padding: 28px 28px 24px;
        transform: scale(0.85) translateY(20px);
        opacity: 0;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
        max-height: 90vh;
    }

    .confirm-modal-sheet.show {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    /* Hide drag handle on desktop */
    .confirm-modal-drag-handle {
        display: none;
    }

    /* Modal container becomes a flexbox for centering */
    .modal-container.confirm-active {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .confirm-modal-icon {
        width: 80px;
        height: 80px;
        font-size: 34px;
    }

    .confirm-modal-title {
        font-size: 22px;
    }

    .confirm-modal-actions {
        margin-top: 28px;
    }
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] .confirm-modal-sheet {
    background: #1e293b;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .confirm-btn-cancel {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .confirm-btn-cancel:hover {
    background: #475569;
}

/* ============================================
   MOBILE — Larger touch targets
   ============================================ */
@media (max-width: 640px) {
    .confirm-modal-actions {
        flex-direction: column-reverse;
    }

    .confirm-btn {
        padding: 16px 20px;
        font-size: 15px;
    }
}

/* ============================================
   INSTALL APP — Floating Button
   ============================================ */

.install-fab {
    position: fixed;
    bottom: 90px;
    left: 20px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    overflow: visible;
}

.install-fab i {
    font-size: 15px;
}

.install-fab:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 28px rgba(99, 102, 241, 0.55),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

.install-fab:active {
    transform: translateY(0) scale(0.96);
}

/* Pulse ring */
.install-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 30px;
    border: 2px solid #6366f1;
    opacity: 0;
    animation: installPulse 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes installPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.25);
        opacity: 0;
    }
}

/* Entrance animation */
.install-fab.show {
    animation: installFabSlideIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes installFabSlideIn {
    from {
        transform: translateX(-120%) scale(0.6);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Mobile adjustment — move to bottom-left, avoid nav */
@media (max-width: 1024px) {
    .install-fab {
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
        left: 14px;
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* ============================================
   INSTALL MODAL — Responsive
   ============================================ */

.install-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    z-index: 9998;
    display: none;
}

.install-modal-backdrop.show {
    display: block;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
}

.install-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--bg-primary);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding: 12px 24px 28px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90vh;
    overflow-y: auto;
    display: none;
}

.install-modal.show {
    display: block;
    transform: translateY(0);
}

.install-modal-drag-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    margin: 0 auto 20px;
}

.install-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.install-modal-close:hover {
    background: var(--danger);
    color: #ffffff;
    transform: rotate(90deg);
}

.install-modal-body {
    text-align: center;
    padding: 0 8px;
}

/* App Icon */
.install-app-icon {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 8px auto 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 40px;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
    animation: installIconPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.install-app-icon i {
    position: relative;
    z-index: 2;
}

.install-app-icon-glow {
    position: absolute;
    inset: -12px;
    border-radius: 30px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4), transparent 70%);
    animation: installGlow 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes installIconPop {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes installGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

/* Title */
.install-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    animation: installFadeUp 0.5s ease 0.15s backwards;
}

.install-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
    animation: installFadeUp 0.5s ease 0.2s backwards;
}

@keyframes installFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Feature List */
.install-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    animation: installFadeUp 0.5s ease 0.25s backwards;
}

.install-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: left;
    transition: all 0.25s ease;
}

.install-feature:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.install-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 15px;
    flex-shrink: 0;
}

.install-feature-icon.icon-fast { background: linear-gradient(135deg, #f59e0b, #d97706); }
.install-feature-icon.icon-offline { background: linear-gradient(135deg, #64748b, #475569); }
.install-feature-icon.icon-home { background: linear-gradient(135deg, #10b981, #059669); }
.install-feature-icon.icon-bell { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.install-feature-text {
    flex: 1;
    min-width: 0;
}

.install-feature-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.install-feature-text span {
    font-size: 11px;
    color: var(--text-secondary);
}

/* iOS Steps */
.install-steps {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
    text-align: left;
    animation: installFadeUp 0.5s ease 0.3s backwards;
}

.install-steps h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.install-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.install-step kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--primary);
}

/* Actions */
.install-modal-actions {
    display: flex;
    gap: 10px;
    animation: installFadeUp 0.5s ease 0.35s backwards;
}

.install-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.install-btn i {
    font-size: 14px;
}

.install-btn:active {
    transform: scale(0.97);
}

.install-btn-skip {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.install-btn-skip:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

.install-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    position: relative;
}

.install-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: installShine 3s ease-in-out infinite;
}

@keyframes installShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.install-btn-primary:hover {
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

/* ============================================
   DESKTOP — Center modal
   ============================================ */
@media (min-width: 641px) {
    .install-modal {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: 90%;
        max-width: 460px;
        border-radius: 24px;
        padding: 32px 32px 28px;
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s;
        max-height: 90vh;
    }

    .install-modal.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        display: block;
    }

    .install-modal-drag-handle {
        display: none;
    }

    .install-modal-actions {
        margin-top: 8px;
    }
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] .install-modal {
    background: #1e293b;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .install-btn-skip {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .install-btn-skip:hover {
    background: #475569;
}

[data-theme="dark"] .install-feature {
    background: #0f172a;
}

[data-theme="dark"] .install-feature:hover {
    background: #1e293b;
}

[data-theme="dark"] .install-steps {
    background: #0f172a;
}

[data-theme="dark"] .install-step kbd {
    background: #1e293b;
    border-color: #334155;
}

/* ============================================
   MOBILE — Full-width stacked buttons
   ============================================ */
@media (max-width: 640px) {
    .install-modal-actions {
        flex-direction: column-reverse;
    }

    .install-btn {
        padding: 16px 20px;
        font-size: 15px;
    }

    .install-modal-title {
        font-size: 20px;
    }

    .install-app-icon {
        width: 72px;
        height: 72px;
        font-size: 32px;
    }
}

/* ============================================
   PREMIUM ATTENDANCE PAGE
   ============================================ */

/* ---------- HERO CLOCK ---------- */
.attendance-hero {
    background: linear-gradient(135deg, #6366f1 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    color: #ffffff;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.35);
}

.attendance-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 60%);
    animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.attendance-hero-time {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    font-variant-numeric: tabular-nums;
}

.attendance-hero-day {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.95;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.attendance-hero-date {
    font-size: 13px;
    opacity: 0.75;
    position: relative;
    z-index: 1;
}

/* ---------- LOCATION CARD ---------- */
.attendance-location-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attendance-location-card .location-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.attendance-location-card .location-row i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.attendance-location-card .location-row span {
    flex: 1;
    word-break: break-word;
}

.attendance-location-card .location-refresh {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s;
}

.attendance-location-card .location-refresh:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: rotate(180deg);
}

/* ---------- CHECK IN/OUT BUTTONS ---------- */
.attendance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.attendance-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 20px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.attendance-btn i {
    font-size: 16px;
}

.attendance-btn:active {
    transform: scale(0.97);
}

.attendance-btn-checkin {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.attendance-btn-checkin:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.5);
}

.attendance-btn-checkout {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.attendance-btn-checkout:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(239, 68, 68, 0.5);
}

.attendance-btn.disabled,
.attendance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

/* ---------- FILTERS ---------- */
.attendance-filters-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.attendance-filters-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attendance-filters-title i {
    color: var(--primary);
}

.attendance-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: end;
}

.attendance-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attendance-filter-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attendance-filter-field select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.attendance-filter-field select:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.attendance-export-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.attendance-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* ---------- STATS GRID ---------- */
.attendance-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.attendance-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    animation: statCardIn 0.5s ease backwards;
}

.attendance-stat-card:nth-child(1) { animation-delay: 0.05s; }
.attendance-stat-card:nth-child(2) { animation-delay: 0.10s; }
.attendance-stat-card:nth-child(3) { animation-delay: 0.15s; }
.attendance-stat-card:nth-child(4) { animation-delay: 0.20s; }

@keyframes statCardIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.attendance-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.attendance-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon.stat-present { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.stat-late    { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.stat-absent  { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.stat-hours   { background: linear-gradient(135deg, #6366f1, #8b5cf6); }

.attendance-stat-card .stat-info {
    flex: 1;
    min-width: 0;
}

.attendance-stat-card .stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 2px;
}

.attendance-stat-card .stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

/* ---------- HISTORY TABLE ---------- */
.attendance-history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

.attendance-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.attendance-history-header h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.attendance-history-header h3 i {
    color: var(--primary);
}

.attendance-history-actions {
    display: flex;
    gap: 8px;
}

.attendance-clear-btn,
.attendance-refresh-btn {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.attendance-refresh-btn {
    padding: 6px 10px;
}

.attendance-clear-btn:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.attendance-refresh-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: rotate(180deg);
}

.attendance-table-wrapper {
    overflow-x: auto;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.attendance-table thead {
    background: var(--bg-secondary);
}

.attendance-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.attendance-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.attendance-table tbody tr {
    transition: all 0.15s;
}

.attendance-table tbody tr:hover {
    background: var(--bg-secondary);
}

.attendance-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.attendance-table .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.status-present {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.status-badge.status-late {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.status-badge.status-absent {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

/* Location cell */
.attendance-table .location-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.attendance-table .location-cell i {
    color: var(--primary);
    font-size: 11px;
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 1024px) {
    .attendance-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .attendance-filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .attendance-hero {
        padding: 32px 16px;
    }
    .attendance-hero-time {
        font-size: 38px;
    }
    .attendance-hero-day {
        font-size: 16px;
    }
    .attendance-actions {
        grid-template-columns: 1fr;
    }
    .attendance-filters-grid {
        grid-template-columns: 1fr;
    }
    .attendance-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .attendance-stat-card {
        padding: 12px;
    }
    .attendance-stat-card .stat-value {
        font-size: 18px;
    }
    .attendance-stat-card .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
    .attendance-history-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .attendance-hero-time {
        font-size: 32px;
    }
    .attendance-stat-card .stat-label {
        font-size: 10px;
    }
}

/* Dark mode */
[data-theme="dark"] .attendance-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .attendance-clear-btn,
[data-theme="dark"] .attendance-refresh-btn {
    background: #1e293b;
    border-color: #334155;
}

/* ============================================
   ATTENDANCE CALENDAR VIEW
   ============================================ */

.attendance-calendar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeInUp 0.4s ease;
}

/* ============ CALENDAR HEADER ============ */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.calendar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-nav-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: scale(1.08);
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

/* ============ WEEKDAY HEADER ============ */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

/* ============ CALENDAR GRID ============ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

/* ============ DAY CELL ============ */
.calendar-day {
    aspect-ratio: 1 / 1;
    min-height: 80px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.calendar-day:not(.empty):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 2px;
}

.calendar-day-status {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.calendar-day-time {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: auto;
    white-space: nowrap;
}

/* ============ STATUS COLORS ============ */
.calendar-day.present {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.08));
    border-color: rgba(16, 185, 129, 0.35);
}

.calendar-day.present .calendar-day-number {
    color: #059669;
}

.calendar-day.present .calendar-day-status {
    color: #10b981;
}

.calendar-day.late {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
    border-color: rgba(245, 158, 11, 0.35);
}

.calendar-day.late .calendar-day-number {
    color: #d97706;
}

.calendar-day.late .calendar-day-status {
    color: #f59e0b;
}

.calendar-day.absent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.08));
    border-color: rgba(239, 68, 68, 0.35);
}

.calendar-day.absent .calendar-day-number {
    color: #dc2626;
}

.calendar-day.absent .calendar-day-status {
    color: #ef4444;
}

.calendar-day.holiday,
.calendar-day.weekend {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(124, 58, 237, 0.04));
    border-color: rgba(139, 92, 246, 0.2);
}

.calendar-day.holiday .calendar-day-number,
.calendar-day.weekend .calendar-day-number {
    color: #7c3aed;
    opacity: 0.7;
}

.calendar-day.holiday .calendar-day-status,
.calendar-day.weekend .calendar-day-status {
    color: #8b5cf6;
    opacity: 0.7;
}

/* Today's ring */
.calendar-day.today {
    box-shadow: 0 0 0 2px var(--primary);
}

.calendar-day.today .calendar-day-number {
    color: var(--primary);
    font-weight: 800;
}

/* ============ LEGEND ============ */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.calendar-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.calendar-legend-dot.present { background: #10b981; }
.calendar-legend-dot.late    { background: #f59e0b; }
.calendar-legend-dot.absent  { background: #ef4444; }
.calendar-legend-dot.weekend { background: #8b5cf6; }

/* ============ MOBILE ============ */
@media (max-width: 768px) {
    .attendance-calendar-card {
        padding: 14px;
    }

    .calendar-title {
        font-size: 16px;
    }

    .calendar-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .calendar-weekday {
        font-size: 10px;
        padding: 8px 2px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        min-height: 56px;
        padding: 6px 4px 4px;
        border-radius: 8px;
    }

    .calendar-day-number {
        font-size: 12px;
    }

    .calendar-day-status {
        font-size: 12px;
    }

    .calendar-day-time {
        font-size: 8px;
    }

    .calendar-legend {
        gap: 14px;
    }

    .calendar-legend-item {
        font-size: 11px;
    }
}

/* ============ DARK MODE ============ */
[data-theme="dark"] .calendar-day.present {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .calendar-day.late {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .calendar-day.absent {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .calendar-day.weekend {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ============================================
   ATTENDANCE DETAIL MODAL
   ============================================ */

.attendance-detail-modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.attendance-detail-date {
    text-align: center;
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--border-light);
}

.attendance-detail-date .date-day {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.attendance-detail-date .date-full {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Status banner */
.detail-status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-status-banner.status-present {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.detail-status-banner.status-late {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.detail-status-banner.status-absent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.detail-status-banner.status-weekend {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(124, 58, 237, 0.1));
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.detail-status-banner.status-no-record {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Sections */
.detail-section {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 16px 18px;
}

.detail-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.detail-section-title i {
    font-size: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
}

.detail-row:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.detail-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: right;
}

.detail-value i {
    color: var(--primary);
    font-size: 12px;
    opacity: 0.7;
}

/* Empty state */
.detail-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
}

.detail-empty i {
    font-size: 44px;
    color: var(--text-tertiary);
    opacity: 0.4;
    margin-bottom: 12px;
    display: block;
}

.detail-empty p {
    margin: 0;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 480px) {
    .attendance-detail-date .date-day {
        font-size: 18px;
    }
    .detail-section {
        padding: 14px;
    }
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .detail-value {
        text-align: left;
        width: 100%;
    }
}

/* ============================================
   UPDATE MODAL — Corporate Animated
   ============================================ */

.update-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Hero icon */
.update-hero {
    position: relative;
    margin-top: 8px;
}

.update-icon-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 36px;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
    animation: updateIconPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.update-icon-wrapper i {
    position: relative;
    z-index: 2;
    animation: updateIconBounce 2s ease-in-out infinite;
}

@keyframes updateIconPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes updateIconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Pulse ring around icon */
.update-icon-pulse {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid #6366f1;
    opacity: 0;
    animation: updatePulse 2s ease-out infinite;
}

@keyframes updatePulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Title */
.update-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
    letter-spacing: -0.3px;
    animation: fadeUp 0.4s ease 0.1s backwards;
}

.update-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    line-height: 1.5;
    animation: fadeUp 0.4s ease 0.15s backwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Version comparison */
.version-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin-top: 4px;
    animation: fadeUp 0.4s ease 0.2s backwards;
}

.version-box {
    flex: 1;
    max-width: 120px;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
}

.version-current {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.version-new {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.08));
    border: 1.5px solid rgba(99, 102, 241, 0.4);
    position: relative;
}

.version-new::before {
    content: 'NEW';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.version-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.version-number {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.version-new .version-number {
    color: var(--primary);
}

.version-arrow {
    color: var(--primary);
    font-size: 18px;
    animation: arrowSlide 1.5s ease-in-out infinite;
}

@keyframes arrowSlide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* Release notes */
.update-notes {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px 16px;
    animation: fadeUp 0.4s ease 0.3s backwards;
}

.update-notes-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.update-notes-title i {
    font-size: 13px;
}

.update-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.update-notes-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.update-notes-list li i {
    color: #10b981;
    font-size: 14px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Meta */
.update-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    animation: fadeUp 0.4s ease 0.4s backwards;
}

.update-meta i {
    color: var(--primary);
}

/* Warning */
.update-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
    width: 100%;
    animation: fadeUp 0.4s ease 0.45s backwards;
}

.update-warning i {
    color: #f59e0b;
    font-size: 14px;
    margin-top: 1px;
    flex-shrink: 0;
}

[data-theme="dark"] .update-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 480px) {
    .update-title {
        font-size: 18px;
    }

    .update-subtitle {
        font-size: 13px;
    }

    .update-icon-wrapper {
        width: 72px;
        height: 72px;
        font-size: 30px;
    }

    .version-number {
        font-size: 15px;
    }

    .version-arrow {
        font-size: 14px;
    }

    .version-compare {
        gap: 8px;
    }

    .update-notes-list li {
        font-size: 12px;
    }
}

/* ============================================
   OFFLINE BANNER
   ============================================ */

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    transform: translateY(-120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.offline-banner.show {
    transform: translateY(0);
}

.offline-banner i {
    font-size: 16px;
    animation: wifiPulse 1.5s ease-in-out infinite;
}

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

.offline-banner button {
    margin-left: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.offline-banner button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* Slow network indicator */
.slow-network-indicator {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(239, 68, 68, 0.95);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    animation: slideUpFade 0.3s ease;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* When offline, push content down */
body.offline-mode .status-bar {
    margin-top: 44px;
}
body.offline-mode .app-header {
    margin-top: 44px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .offline-banner {
        padding: 8px 12px;
        font-size: 12px;
    }
    .offline-banner button {
        padding: 3px 10px;
        font-size: 10px;
    }
}

/* ============================================
   iOS SAFE AREA SUPPORT
   ============================================ */

/* Header — push down from status bar */
.app-header {
    background: var(--bg-primary);
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    min-height: calc(60px + env(safe-area-inset-top));
    box-sizing: border-box;
}

/* Status bar — hide on mobile if redundant */
.status-bar {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(44px + env(safe-area-inset-top, 0px));
}

/* Main content — extra bottom padding for iOS home indicator */
.app-main {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

/* Bottom navigation — sit above home indicator */
.bottom-nav {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    padding-bottom: max(12px, constant(safe-area-inset-bottom, 0px));
}

/* Drawer — respect safe areas */
.drawer-menu {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* FAB — sit above home indicator */
.fab-container {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* Chat widget — sit above home indicator */
.chat-widget {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* Toasts — above home indicator */
.toast-container {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

/* Modals — respect safe areas */
.modal-content {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

/* ============================================
   iOS-specific body fixes
   ============================================ */

@supports (-webkit-touch-callout: none) {
    /* iOS-only: prevent rubber-band scrolling issues */
    body {
        overscroll-behavior-y: none;
    }

    /* iOS Safari: fix 100vh issue (URL bar) */
    .app {
        height: 100vh;
        height: 100dvh;   /* Dynamic viewport height — modern iOS */
    }

    /* Ensure header sits below status bar */
    .app-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    /* Bottom nav sits above home indicator */
    .bottom-nav {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   Detect standalone PWA mode (iOS specifically)
   ============================================ */

@media all and (display-mode: standalone) {
    /* When installed as app on iOS */
    .app-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}

/* ============================================
   SAFE AREA FILLERS
   ============================================ */

.safe-area-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--primary-gradient);
    z-index: 99998;
    pointer-events: none;
}

.safe-area-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-bottom, 0px);
    background: var(--bg-primary);
    z-index: 99998;
    pointer-events: none;
}

/* Hide fillers when not needed */
@media (env(safe-area-inset-top) = 0px) {
    .safe-area-top { display: none; }
}
@media (env(safe-area-inset-bottom) = 0px) {
    .safe-area-bottom { display: none; }
}

/* Dark mode */
[data-theme="dark"] .safe-area-bottom {
    background: var(--bg-primary);
}