/* ═══════════════════════════════════════════
   ACADEMETIA — BASE STYLES
   ═══════════════════════════════════════════ */

:root {
    --bg-primary: #FAFAF8;
    --bg-secondary: #F0EFE9;
    --bg-tertiary: #E8E6DF;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-solid: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.4);
    --bg-glass-border: rgba(255, 255, 255, 0.5);
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --bg-input: rgba(255, 255, 255, 0.8);
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A68;
    --text-tertiary: #8A8AA0;
    --text-inverse: #FAFAF8;
    --text-link: #00916E;
    --accent: #00E5A0;
    --accent-hover: #00C98C;
    --accent-muted: rgba(0, 229, 160, 0.12);
    --amber: #FFB800;
    --red: #FF6B6B;
    --indigo: #6366F1;
    --blue: #3B82F6;
    --border: rgba(26, 26, 46, 0.1);
    --border-strong: rgba(26, 26, 46, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(0, 229, 160, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
    --nav-height: 64px;
    --sidebar-width: 260px;
    --max-width: 1200px;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

[data-theme="dark"] {
    --bg-primary: #0A0A0F;
    --bg-secondary: #12121A;
    --bg-tertiary: #1A1A26;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-solid: #16161F;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-border: rgba(255, 255, 255, 0.06);
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --bg-input: rgba(255, 255, 255, 0.06);
    --text-primary: #EAEAF0;
    --text-secondary: #A0A0B8;
    --text-tertiary: #606078;
    --text-inverse: #0A0A0F;
    --text-link: #00E5A0;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(0, 229, 160, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: var(--text-primary); background: var(--bg-primary); overflow-x: hidden; transition: background var(--transition-base), color var(--transition-base); }
img { max-width: 100%; display: block; }
a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

#preloader { position: fixed; inset: 0; z-index: 10000; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; transition: opacity 0.4s ease, visibility 0.4s ease; }
#preloader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-inner { text-align: center; }
.preloader-logo { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--accent); color: #0A0A0F; font-family: var(--font-display); font-size: 24px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; animation: preloaderPulse 1.2s ease-in-out infinite; }
.preloader-bar { width: 120px; height: 3px; background: var(--border); border-radius: 3px; overflow: hidden; }
.preloader-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; animation: preloaderFill 1s ease-out forwards; }
@keyframes preloaderPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes preloaderFill { to { width: 100%; } }

.cursor-dot, .cursor-ring { display: none; }
@media (pointer: fine) {
    .cursor-dot { display: block; position: fixed; top: 0; left: 0; z-index: 9999; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; pointer-events: none; transition: transform 0.1s ease; }
    .cursor-ring { display: block; position: fixed; top: 0; left: 0; z-index: 9998; width: 32px; height: 32px; border: 1.5px solid rgba(0, 229, 160, 0.4); border-radius: 50%; pointer-events: none; transition: transform 0.15s ease, width 0.2s ease, height 0.2s ease, border-color 0.2s ease; }
    .cursor-ring.hover { width: 48px; height: 48px; border-color: var(--accent); }
}

.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius-md); background: var(--bg-card-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg); color: var(--text-primary); font-size: 14px; max-width: 360px; animation: toastIn 0.3s ease; backdrop-filter: blur(12px); }
.toast-success { border-left: 3px solid var(--accent); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--blue); }
.toast-exit { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--nav-height); padding: 0 24px; background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--bg-glass-border); transition: background var(--transition-base), border-color var(--transition-base); }
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-container { max-width: var(--max-width); margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text-primary); text-decoration: none; }
.nav-logo:hover { color: var(--text-primary); }
.logo-mark { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent); color: #0A0A0F; font-family: var(--font-display); font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.logo-text { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.nav-links { display: flex; gap: 32px; }
.nav-link { color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: color var(--transition-fast); position: relative; }
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link.active::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition-fast); }
.theme-toggle:hover { color: var(--text-primary); border-color: var(--border-strong); }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
.mobile-menu-btn { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.mobile-menu-btn span { width: 20px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all var(--transition-fast); }
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-actions .btn { display: none; }
    .mobile-menu-btn { display: flex; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--bg-card-solid); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 12px; box-shadow: var(--shadow-lg); }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; line-height: 1; border: 1.5px solid transparent; cursor: pointer; transition: all var(--transition-fast); text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #0A0A0F; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #0A0A0F; transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.3); }
.btn-outline-light:hover { border-color: #fff; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-input); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--text-tertiary); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1.5px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); transition: border-color var(--transition-fast), box-shadow var(--transition-fast); outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.form-group input::placeholder { color: var(--text-tertiary); }
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 14px; }
.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-row-2col { grid-template-columns: 1fr; } }

.checkbox-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text-secondary); }
.checkbox-label input { display: none; }
.checkbox-custom { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; transition: all var(--transition-fast); flex-shrink: 0; }
.checkbox-label input:checked + .checkbox-custom { background: var(--accent); border-color: var(--accent); }
.checkbox-label input:checked + .checkbox-custom::after { content: ''; width: 5px; height: 9px; border: solid #0A0A0F; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

.input-password-wrap { position: relative; }
.input-password-wrap input { padding-right: 44px; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-tertiary); cursor: pointer; padding: 4px; }
.password-toggle .eye-closed { display: none; }
.input-password-wrap input[type="password"] ~ .password-toggle .eye-open { display: none; }
.input-password-wrap input[type="password"] ~ .password-toggle .eye-closed { display: block; }

.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); color: var(--red); }
.alert-success { background: var(--accent-muted); border: 1px solid rgba(0, 229, 160, 0.3); color: var(--accent); }
.alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--blue); }
.error-list { padding-left: 16px; list-style: disc; }
.error-list li { margin-bottom: 4px; }

.auth-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: var(--bg-primary); }
.auth-logo { position: absolute; top: 24px; left: 24px; }
.auth-main { width: 100%; max-width: 480px; }
.auth-card { background: var(--bg-card); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--bg-glass-border); border-radius: var(--radius-xl); padding: 36px; box-shadow: var(--shadow-xl); }
.auth-card-wide { max-width: 560px; }
.auth-card-header { text-align: center; margin-bottom: 28px; }
.auth-card-header h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.auth-card-header p { color: var(--text-secondary); font-size: 15px; }
.auth-form { margin-bottom: 20px; }
.auth-footer-text { text-align: center; font-size: 14px; color: var(--text-secondary); }
.auth-link { color: var(--text-link); font-weight: 500; }

.role-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role-option { cursor: pointer; }
.role-option input { display: none; }
.role-option-inner { padding: 14px 10px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--bg-input); text-align: center; transition: all var(--transition-fast); }
.role-option-selected .role-option-inner { border-color: var(--accent); background: var(--accent-muted); }
.role-option-name { display: block; font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.role-option-desc { display: block; font-size: 11px; color: var(--text-tertiary); }
@media (max-width: 480px) { .role-selector { grid-template-columns: 1fr; } .auth-card { padding: 24px; border-radius: var(--radius-lg); } }

.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 60px 24px 24px; margin-top: 0; }
.footer-container { max-width: var(--max-width); margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-desc { color: var(--text-secondary); font-size: 14px; margin-top: 12px; line-height: 1.7; }
.footer-col h4 { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text-primary); }
.footer-col a { display: block; color: var(--text-secondary); font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; text-align: center; }
.footer-bottom p { color: var(--text-tertiary); font-size: 13px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

.section { padding: 100px 24px; }
.section-container { max-width: var(--max-width); margin: 0 auto; }
.section-header { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-tag { display: inline-block; padding: 4px 14px; border-radius: var(--radius-full); background: var(--accent-muted); color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 16px; letter-spacing: 0.02em; }
.section-title { font-family: var(--font-display); font-size: clamp(28px, 5vw, 42px); font-weight: 700; line-height: 1.15; margin-bottom: 16px; }
.section-subtitle { color: var(--text-secondary); font-size: 16px; line-height: 1.7; }

[data-animate] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-animate="fade-up"].visible { opacity: 1; transform: translateY(0); }

.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.error-page h1 { font-family: var(--font-display); font-size: 80px; font-weight: 700; color: var(--accent); }
.error-page p { color: var(--text-secondary); margin: 16px 0 24px; }

.dashboard-body { background: var(--bg-primary); }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); z-index: 900; background: var(--bg-card-solid); border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: transform var(--transition-base); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.sidebar-close { display: none; background: none; border: none; color: var(--text-secondary); font-size: 24px; cursor: pointer; }
.sidebar-nav { flex: 1; padding: 12px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all var(--transition-fast); text-decoration: none; }
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-input); }
.sidebar-link.active { color: var(--accent); background: var(--accent-muted); }
.sidebar-link-danger { color: var(--red); }
.sidebar-link-danger:hover { background: rgba(255,107,107,0.1); }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.dashboard-main { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin var(--transition-base); }
.dashboard-topbar { position: sticky; top: 0; z-index: 100; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--bg-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--bg-glass-border); }
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-icon { color: var(--text-secondary); position: relative; transition: color var(--transition-fast); }
.topbar-icon:hover { color: var(--text-primary); }
.topbar-user { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.dashboard-content { padding: 28px 24px; max-width: 1100px; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.dash-header h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.dash-header-actions { display: flex; gap: 10px; }
.dash-section { margin-bottom: 32px; }
.dash-section h2 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { display: flex; align-items: center; gap: 16px; background: var(--bg-card); border: 1px solid var(--bg-glass-border); border-radius: var(--radius-lg); padding: 20px; backdrop-filter: blur(8px); }
.stat-card-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-card-label { font-size: 13px; color: var(--text-tertiary); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.quick-link-card { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--bg-glass-border); color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all var(--transition-fast); text-decoration: none; }
.quick-link-card:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-tertiary); }
.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 15px; }
.children-grid { display: flex; flex-direction: column; gap: 12px; }
.child-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--bg-glass-border); border-radius: var(--radius-lg); }
.child-avatar { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--accent-muted); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; flex-shrink: 0; }
.child-info h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.child-stats { display: flex; gap: 16px; font-size: 13px; color: var(--text-tertiary); }
@media (max-width: 768px) { .sidebar { transform: translateX(-100%); } .sidebar.open { transform: translateX(0); } .sidebar-close { display: block; } .sidebar-toggle { display: block; } .dashboard-main { margin-left: 0; } .dashboard-content { padding: 20px 16px; } }

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 12px 16px; text-align: left; background: var(--bg-secondary); color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-input); }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; }
.badge-success { background: var(--accent-muted); color: var(--accent); }
.badge-warning { background: rgba(255,184,0,0.12); color: var(--amber); }
.badge-danger { background: rgba(255,107,107,0.12); color: var(--red); }
.badge-info { background: rgba(59,130,246,0.12); color: var(--blue); }
.pagination { display: flex; gap: 4px; margin-top: 20px; justify-content: center; }
.page-link { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 14px; font-weight: 500; text-decoration: none; transition: all var(--transition-fast); }
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.active { background: var(--accent); color: #0A0A0F; border-color: var(--accent); }
.card { background: var(--bg-card); border: 1px solid var(--bg-glass-border); border-radius: var(--radius-lg); padding: 24px; backdrop-filter: blur(8px); }

/* ═══════════════════════════════════════════════════════
   APP — ENHANCED STYLES (V2)
   ═══════════════════════════════════════════════════════ */

/* ── Focus Styles for Accessibility ── */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}
a:focus-visible,
button:focus-visible {
    outline-offset: 3px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none; /* Use box-shadow instead for form elements */
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--accent-muted);
}
/* Remove default outline for mouse users, keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ── Improved Form Input Styles ── */
.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 16px;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--border-strong);
}
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
}
.form-group textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}
/* Input with icon prefix */
.form-group .input-with-icon {
    position: relative;
}
.form-group .input-with-icon input {
    padding-left: 42px;
}
.form-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-fast);
}
.form-group .input-with-icon input:focus ~ .input-icon,
.form-group .input-with-icon input:not(:placeholder-shown) ~ .input-icon {
    color: var(--accent);
}

/* ── Enhanced Alert Styles ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    backdrop-filter: blur(8px);
}
.alert-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.alert-content svg {
    flex-shrink: 0;
    margin-top: 1px;
}
.alert-detail {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding-left: 26px;
}
.alert-error {
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: var(--red);
    border-left: 3px solid var(--red);
}
.alert-success {
    background: rgba(0, 229, 160, 0.06);
    border: 1px solid rgba(0, 229, 160, 0.2);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}
.alert-info {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--blue);
    border-left: 3px solid var(--blue);
}
.alert-warning {
    background: rgba(255, 184, 0, 0.06);
    border: 1px solid rgba(255, 184, 0, 0.2);
    color: var(--amber);
    border-left: 3px solid var(--amber);
}

/* ── Theme Switching Transitions ── */
[data-theme] {
    transition: background-color var(--transition-slow), color var(--transition-slow), border-color var(--transition-slow);
}
[data-theme] *,
[data-theme] *::before,
[data-theme] *::after {
    transition-property: background-color, border-color, color, box-shadow, fill, stroke;
    transition-duration: var(--transition-base);
    transition-timing-function: ease;
}
/* Exclude animations and interactive elements from theme transition */
[data-theme] [data-animate],
[data-theme] .btn,
[data-theme] input,
[data-theme] textarea,
[data-theme] select,
[data-theme] a,
[data-theme] .sidebar,
[data-theme] .dashboard-main {
    transition: background-color var(--transition-slow), border-color var(--transition-slow), color var(--transition-slow), box-shadow var(--transition-slow);
}

/* ── Print Media Query ── */
@media print {
    /* Reset backgrounds and shadows */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.5;
    }
    /* Hide non-essential elements */
    .navbar,
    .sidebar,
    .sidebar-toggle,
    .sidebar-close,
    .sidebar-overlay,
    .sidebar-footer,
    .dashboard-topbar,
    .theme-toggle,
    .btn,
    .toast-container,
    .cursor-dot,
    .cursor-ring,
    #preloader,
    .mobile-menu-btn,
    .pagination,
    .admin-filter-bar,
    .admin-page-header-right,
    .admin-action-btn,
    footer,
    .footer {
        display: none !important;
    }
    /* Layout */
    .dashboard-main {
        margin-left: 0 !important;
    }
    .dashboard-content {
        padding: 0 !important;
        max-width: 100% !important;
    }
    /* Card styling */
    .card,
    .stat-card,
    .admin-stat-card,
    .admin-plan-card,
    .admin-summary-card,
    .admin-table-card,
    .auth-card {
        background: #fff !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        break-inside: avoid;
    }
    /* Table styling */
    .data-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .data-table tbody tr:nth-child(even) td {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    /* Badge styling */
    .badge {
        border: 1px solid #999 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    /* Links */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    /* Page breaks */
    .admin-bottom-grid,
    .admin-mid-grid {
        grid-template-columns: 1fr !important;
    }
    h1, h2, h3 {
        page-break-after: avoid;
    }
    /* Show URLs for links */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* ── Auth Page Enhancements ── */

/* Role badge in login */
.auth-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}
.auth-role-badge strong {
    font-weight: 600;
}

/* Auth divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-tertiary);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-divider span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

/* Role quick links */
.auth-role-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.auth-role-links-label {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
}
.auth-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.auth-role-chip:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-muted);
}
.auth-role-chip svg {
    opacity: 0.6;
}

/* Back to home link */
.auth-back-home {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
}
.auth-back-home a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.auth-back-home a:hover {
    color: var(--text-secondary);
}

/* Step indicators */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 0 20px;
}
.auth-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition-fast);
}
.auth-step-active {
    color: var(--accent);
}
.auth-step-done {
    color: var(--text-secondary);
}
.auth-step-done .auth-step-number {
    background: var(--accent);
    color: #0A0A0F;
}
.auth-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--border-strong);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.auth-step-active .auth-step-number {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}
.auth-step-line {
    width: 32px;
    height: 2px;
    background: var(--border-strong);
    margin: 0 12px;
    border-radius: 1px;
}

/* Enhanced role selector */
.role-option-enhanced .role-option-inner {
    padding: 18px 12px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.role-option-enhanced .role-option-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-muted);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    transition: all var(--transition-fast);
}
.role-option-enhanced .role-option-name {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    transition: color var(--transition-fast);
}
.role-option-enhanced .role-option-desc {
    font-size: 11px;
    display: block;
    transition: color var(--transition-fast);
}
.role-option-enhanced:hover .role-option-inner {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.role-option-selected.role-option-enhanced .role-option-inner {
    border-color: var(--accent);
    background: var(--accent-muted);
    box-shadow: var(--shadow-glow);
}
.role-option-selected.role-option-enhanced .role-option-icon {
    background: var(--accent);
    color: #0A0A0F;
}

/* Form hint */
.form-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.form-hint svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Terms checkbox */
.auth-terms {
    margin-bottom: 20px;
}
.auth-terms .checkbox-label span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Auth card icon (forgot password) */
.auth-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: var(--accent-muted);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* Instructions list */
.auth-instructions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.auth-instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.auth-instruction-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #0A0A0F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}