/* ============================================
   EDU FOR ALL - UNIFIED DESIGN SYSTEM v1.0
   ============================================ */

/* 1. RESET & BASE */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Helvetica, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    min-height: 100vh;
    font-size: 16px;
    display: flex;
    flex-direction: column;
}
a { text-decoration: none; color: #007aff; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* 2. LAYOUT */
.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.dashboard-container { display: flex; min-height: 100vh; flex: 1; }
.main-content { flex: 1; padding: 32px 40px; margin-left: 280px; transition: margin-left 0.3s ease; min-width: 0; }

/* 3. SIDEBAR */
.sidebar {
    width: 280px; background: #ffffff; border-right: 1px solid #e0e0e0;
    padding: 32px 24px; position: fixed; height: 100vh; top: 0; left: 0;
    display: flex; flex-direction: column; justify-content: space-between;
    z-index: 1000; transition: transform 0.3s ease; overflow-y: auto;
}
.sidebar-logo {
    font-size: 1.5rem; font-weight: 700;
    background: linear-gradient(135deg, #1d1d1f, #007aff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid #e0e0e0;
    line-height: 1.2;
}
.sidebar-logo span { font-size: 12px; color: #8e8e93; display: block; margin-top: 4px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
    padding: 12px 16px; text-decoration: none; color: #1d1d1f;
    border-radius: 12px; transition: all 0.2s ease; font-weight: 500;
    display: flex; align-items: center; gap: 12px; font-size: 0.95rem;
}
.sidebar-nav a:hover { background: #f5f5f7; }
.sidebar-nav a.active { background: #007aff; color: #ffffff; }
.sidebar-nav hr { margin: 12px 0; border: none; border-top: 0.5px solid #e0e0e0; }
.sidebar-footer { padding-top: 20px; border-top: 1px solid #e0e0e0; margin-top: 20px; }
.sidebar-footer a { display: block; padding: 12px 16px; border-radius: 12px; font-weight: 500; font-size: 0.95rem; }
.sidebar-footer a.logout { color: #ff3b30; }
.sidebar-footer a.home { color: #007aff; }

/* 4. NAVBAR */
.navbar {
    position: sticky; top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    padding: 12px 0; z-index: 1000;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-container { display: flex; align-items: center; gap: 8px; }
.logo-img { width: 65px; height: 65px; object-fit: contain; border-radius: 12px; }
.logo-text {
    font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1d1d1f, #86868b);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: #1d1d1f; font-size: 0.95rem; font-weight: 400; }
.nav-links a:hover, .nav-links a.active { color: #007aff; opacity: 1; }
.nav-buttons { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* 5. BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 980px; font-size: 0.95rem;
    font-weight: 500; cursor: pointer; border: none;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    text-align: center; font-family: inherit; white-space: nowrap;
    text-decoration: none;
}
.btn:hover { opacity: 1; }
.btn-primary { background: #007aff; color: #fff; }
.btn-primary:hover { background: #005fc1; transform: scale(0.98); }
.btn-success { background: #34c759; color: #fff; }
.btn-success:hover { background: #2ecc71; transform: scale(0.98); }
.btn-danger { background: #ff3b30; color: #fff; }
.btn-danger:hover { background: #d32f2f; transform: scale(0.98); }
.btn-warning { background: #ff9500; color: #fff; }
.btn-warning:hover { background: #e68600; transform: scale(0.98); }
.btn-secondary { background: #e8e8ed; color: #1d1d1f; }
.btn-secondary:hover { background: #d4d4d8; transform: scale(0.98); }
.btn-info { background: #5856d6; color: #fff; }
.btn-info:hover { background: #4845c9; transform: scale(0.98); }

.btn-login {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: #ff3b30;
    padding: 10px 20px; border-radius: 980px;
    font-size: 0.95rem; font-weight: 500;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    white-space: nowrap;
}
.btn-login:hover { background: rgba(255, 59, 48, 0.08); opacity: 1; }

.btn-logout {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: #ff3b30;
    padding: 10px 20px; border-radius: 980px;
    font-size: 0.95rem; font-weight: 500;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    white-space: nowrap;
}
.btn-logout:hover { background: rgba(255, 59, 48, 0.08); opacity: 1; }

.btn-admission {
    display: inline-flex; align-items: center; justify-content: center;
    background: #007aff; color: #fff;
    padding: 10px 24px; border-radius: 980px;
    font-size: 0.95rem; font-weight: 500;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    white-space: nowrap;
    min-width: 120px;
}
.btn-admission:hover { background: #005fc1; transform: scale(0.98); opacity: 1; }

.btn-myportal {
    display: inline-flex; align-items: center; justify-content: center;
    background: #34c759; color: #fff;
    padding: 10px 24px; border-radius: 980px;
    font-size: 0.95rem; font-weight: 500;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    white-space: nowrap;
    min-width: 120px;
}
.btn-myportal:hover { background: #2ecc71; transform: scale(0.98); opacity: 1; }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-block { width: 100%; display: flex; }

/* 6. CARDS */
.card {
    background: #ffffff; border-radius: 20px; padding: 24px;
    margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 0.5px solid rgba(0, 0, 0, 0.03);
}
.card-title {
    font-size: 1.25rem; font-weight: 600; margin-bottom: 20px;
    padding-bottom: 12px; border-bottom: 2px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}

/* 7. FORMS */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; color: #1d1d1f; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 16px; border: 1.5px solid #e0e0e0;
    border-radius: 12px; font-size: 1rem; font-family: inherit;
    background: #fff; color: #1d1d1f;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #007aff; box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}
.form-group input:disabled, .form-group select:disabled { background: #f8f8fa; cursor: not-allowed; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group small { display: block; margin-top: 6px; color: #6e6e73; font-size: 0.8rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.form-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }

/* 8. TABLES */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th, .data-table td { padding: 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.data-table th {
    background: #f8f8fa; font-weight: 600; color: #6e6e73;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table tbody tr:hover { background: #f8f8fa; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 9. STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; padding: 24px; border-radius: 16px; text-align: center;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.blue { background: linear-gradient(135deg, #007aff, #0051d5); }
.stat-card.green { background: linear-gradient(135deg, #34c759, #28a745); }
.stat-card.orange { background: linear-gradient(135deg, #ff9500, #e68600); }
.stat-card.red { background: linear-gradient(135deg, #ff3b30, #d32f2f); }
.stat-number { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8rem; opacity: 0.9; margin-top: 8px; }

/* 10. BADGES */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.badge-success, .status-paid, .status-active, .status-present, .status-verified, .status-graded { background: #e8f5e9; color: #2e7d32; }
.badge-warning, .status-pending, .status-late, .status-partial { background: #fff3e0; color: #ef6c00; }
.badge-danger, .status-inactive, .status-absent, .status-revoked, .status-overdue { background: #ffebee; color: #c62828; }
.badge-info, .status-submitted { background: #e3f2fd; color: #1565c0; }
.badge-beginner { background: #e8f5e9; color: #2e7d32; }
.badge-intermediate { background: #fff3e0; color: #ef6c00; }
.badge-advanced { background: #fce4ec; color: #c62828; }

/* 11. PRIORITY BADGES */
.priority-urgent { background: #ff3b30; color: #fff; }
.priority-high { background: #ff9500; color: #fff; }
.priority-normal { background: #007aff; color: #fff; }
.priority-low { background: #34c759; color: #fff; }

/* 12. MESSAGES */
.message { padding: 14px 20px; border-radius: 12px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 500; }
.message.success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #34c759; }
.message.error { background: #ffebee; color: #c62828; border-left: 4px solid #ff3b30; }
.message.info { background: #e3f2fd; color: #1565c0; border-left: 4px solid #007aff; }
.message.warning { background: #fff3e0; color: #ef6c00; border-left: 4px solid #ff9500; }

/* 13. EMPTY STATES */
.empty-state { text-align: center; padding: 60px 20px; color: #8e8e93; }
.empty-state h3 { font-size: 1.25rem; color: #1d1d1f; margin-bottom: 8px; }
.empty-state p { font-size: 0.95rem; }

/* 14. FOOTER */
.footer {
    background: #1d1d1f; color: #e8e8ed;
    padding: 32px 24px; text-align: center;
    width: auto; margin-left: 280px;
    transition: margin-left 0.3s ease;
    clear: both; margin-top: auto;
}
.footer .copyright { text-align: center; color: #8e8e93; font-size: 0.75rem; line-height: 1.8; }
.footer .copyright p { margin: 4px 0; color: #9c9ca6; font-size: 0.85rem; display: block; }
.footer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 40px; margin-bottom: 48px; }
.footer h4 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; color: #fff; }
.footer p, .footer a { color: #9c9ca6; font-size: 0.85rem; margin: 8px 0; display: block; }
.footer.public { margin-left: 0; padding: 56px 0 32px; text-align: left; }
.footer.public .copyright { text-align: center; padding-top: 32px; border-top: 0.5px solid #3a3a3e; margin-top: 20px; }

/* 15. LOGIN CARD */
.login-wrapper { flex: 1; display: flex; justify-content: center; align-items: center; padding: 40px 20px; }
.login-card {
    background: #fff; border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%; max-width: 440px; padding: 40px;
    border: 1px solid #e5e5ea;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header img { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 16px; }
.login-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.login-header p { color: #6e6e73; font-size: 0.95rem; }

/* 16. MODALS */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
    z-index: 2000; justify-content: center; align-items: center; padding: 20px;
}
.modal.show { display: flex; }
.modal-content {
    background: #fff; border-radius: 20px; padding: 0;
    width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto;
    animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.modal-header {
    padding: 20px 24px; background: #007aff; color: #fff;
    border-radius: 20px 20px 0 0; display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0;
}
.modal-header h3 { font-size: 1.2rem; font-weight: 600; }
.modal-close { background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; padding: 0; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* 17. TABS */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 2px solid #e0e0e0; overflow-x: auto; }
.tab {
    padding: 12px 24px; background: none; border: none; font-size: 0.95rem;
    font-weight: 500; cursor: pointer; color: #6e6e73;
    transition: all 0.2s; border-radius: 12px 12px 0 0; white-space: nowrap;
}
.tab:hover { background: #f5f5f7; color: #007aff; }
.tab.active { color: #007aff; border-bottom: 3px solid #007aff; margin-bottom: -2px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 18. PROGRESS BARS */
.progress-bar-container { background: #e8e8ed; border-radius: 20px; height: 8px; overflow: hidden; width: 100%; }
.progress-bar { background: #34c759; border-radius: 20px; height: 100%; transition: width 0.3s ease; }

/* 19. ROLE TILES */
.role-grid, .tile-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.role-tile, .tile {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 18px; background: #f8f8fa;
    border: 1.5px solid transparent; border-radius: 24px;
    cursor: pointer; font-size: 0.9rem; font-weight: 500;
    transition: all 0.15s; user-select: none; line-height: 1;
}
.role-tile:hover, .tile:hover { background: #eef0f5; }
.role-tile input[type="checkbox"], .tile input[type="checkbox"] {
    width: 18px; height: 18px; margin: 0;
    flex-shrink: 0; cursor: pointer; accent-color: #007aff;
}
.role-tile:has(input:checked), .tile:has(input:checked) { background: #e8f0fe; border-color: #007aff; }
.role-tile:has(input:checked) span, .tile:has(input:checked) span { color: #007aff; font-weight: 600; }

/* 20. COURSE TILES */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.course-tile {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: #f8f8fa;
    border: 1.5px solid transparent; border-radius: 12px;
    cursor: pointer; transition: all 0.15s; font-size: 0.9rem; line-height: 1.3;
}
.course-tile:hover { background: #eef0f5; }
.course-tile input[type="checkbox"] {
    width: 18px; height: 18px; margin: 0;
    flex-shrink: 0; cursor: pointer; accent-color: #007aff;
}
.course-tile:has(input:checked) { background: #e8f0fe; border-color: #007aff; }
.course-tile:has(input:checked) span { color: #007aff; font-weight: 600; }
.course-tile span { flex: 1; }

/* 21. UTILITIES */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.hidden { display: none; }

/* 22. MOBILE MENU */
.mobile-menu-btn {
    display: none; position: fixed;
    top: 12px; right: 12px; left: auto;
    z-index: 2001;
    background: #007aff; color: #fff;
    border: none; width: 44px; height: 44px;
    border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    font-size: 20px; line-height: 1;
    align-items: center; justify-content: center;
}
.mobile-menu-btn:hover { background: #005fc1; }
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4); z-index: 1999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ============================================
   23. LOGIN PAGE — GALAXY BACKGROUND
   ============================================ */
.login-page-bg {
    min-height: calc(100vh - 160px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex: 1;
}
.login-bubbles {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0; overflow: hidden; pointer-events: none;
}
.login-bubble {
    position: absolute; bottom: -150px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    animation: bubbleRise 20s infinite ease-in;
    pointer-events: none;
}
@keyframes bubbleRise {
    0%   { bottom: -150px; transform: translateX(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.6; }
    50%  { transform: translateX(20px) rotate(180deg); }
    90%  { opacity: 0.6; }
    100% { bottom: 100vh; transform: translateX(-20px) rotate(360deg); opacity: 0; }
}
.login-page-bg .login-card {
    position: relative; z-index: 2;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUpLogin 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes slideUpLogin {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
   24. GALAXY — TWO CONCENTRIC ROTATING RINGS
   ============================================ */
.login-logo-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 280px;
    height: 280px;
    margin: -20px auto 20px;
}
.login-logo-wrapper img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    position: relative;
    z-index: 30;
}
.galaxy-ring {
    position: absolute;
    top: 48%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 60;
    pointer-events: none;
    transform-origin: 0 0;
}
.galaxy-ring-outer { animation: galaxySpinCW 90s linear infinite; }
.galaxy-ring-inner { animation: galaxySpinCCW 60s linear infinite; }

@keyframes galaxySpinCW {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes galaxySpinCCW {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to   { transform: translate(-50%, -50%) rotate(0deg); }
}
.galaxy-dot {
    position: absolute;
    top: 0; left: 0;
    width: var(--size);
    height: var(--size);
    margin-left: calc(var(--size) / -2);
    margin-top: calc(var(--size) / -2);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    opacity: 0.95;
    transform: rotate(var(--angle)) translate(var(--radius));
    transform-origin: center center;
    animation: galaxyDotFade 3s ease-in-out infinite;
}
@keyframes galaxyDotFade {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 1; }
}

/* ============================================
   25. LIBRARY PAGE
   ============================================ */
.lib-wrap {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}
.lib-hero { background: #fbfbfd; padding: 80px 0 60px; text-align: center; }
.lib-body { padding: 40px 0 80px; }
.lib-featured {
    background: linear-gradient(135deg, #1d1d1f, #3a3a3e);
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 56px;
    color: #fff;
    text-align: center;
}
.lib-section { margin-bottom: 56px; }
.lib-section-title {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding-bottom: 8px;
    border-bottom: 1px solid #d2d2d6;
    margin-bottom: 24px;
}
.lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.lib-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 0.5px solid rgba(0, 0, 0, 0.03);
}
.lib-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; color: #1d1d1f; }
.lib-card p { color: #6e6e73; font-size: 0.85rem; line-height: 1.4; margin-bottom: 16px; flex: 1; }
.lib-card-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #007aff;
    color: #fff;
    padding: 8px 16px;
    border-radius: 980px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.lib-card-btn:hover { background: #005fc1; }
.lib-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lib-modal.show { display: flex; }
.lib-modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

/* ============================================
   26. ADMISSION PAGE
   ============================================ */
.adm-wrap {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}
.adm-hero { background: #fbfbfd; padding: 80px 0 60px; text-align: center; }
.adm-body { padding: 40px 0 80px; }
.adm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.adm-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 0.5px solid rgba(0, 0, 0, 0.03);
}
.adm-card img { width: 100%; height: 200px; object-fit: cover; }
.adm-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.adm-card-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 12px; }
.adm-card-desc { color: #6e6e73; line-height: 1.6; margin-bottom: 16px; font-size: 0.95rem; flex: 1; }
.adm-card-details { background: #f8f8fa; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.adm-card-details p { font-size: 0.85rem; margin: 4px 0; }
.adm-card-btn {
    display: block;
    text-align: center;
    background: #007aff;
    color: #fff;
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}
.adm-card-btn:hover { background: #005fc1; }

/* ============================================
   27. TIMETABLE
   ============================================ */
.tt-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 60px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tt-week-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    min-width: 0;
}
.tt-week-label {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 1rem;
    text-align: center;
    flex: 1;
}
.tt-grid {
    display: grid;
    grid-template-columns: 70px repeat(7, minmax(0, 1fr));
    grid-auto-rows: 60px;
    gap: 6px;
    background: #fff;
    padding: 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-width: 900px;
    width: 100%;
}
.tt-day-head {
    background: #1e3a5f;
    color: #fff;
    padding: 10px 6px;
    border-radius: 10px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.tt-day-head small {
    display: block;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
    font-size: 0.7rem;
}
.tt-day-head.today { background: #007aff; }
.tt-period-label {
    background: #f8f8fa;
    color: #6e6e73;
    padding: 10px 4px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.tt-cell {
    background: #f8f8fa;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.72rem;
    line-height: 1.35;
    overflow: hidden;
}
.tt-cell.empty {
    background: #fafafa;
    border: 1px dashed #e5e5ea;
}

/* Course block — overflow visible so the badge never gets clipped */
.tt-course {
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.72rem;
    line-height: 1.35;
    font-weight: 500;
    border-left: 3px solid #007aff;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Cancelled class */
.tt-course.cancelled {
    background: #ffe5e5;
    color: #c62828;
    border-left-color: #ff3b30;
    opacity: 0.75;
}
.tt-course.cancelled strong,
.tt-course.cancelled .tt-room {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

/* Rescheduled class */
.tt-course.rescheduled {
    background: #fff3e0;
    color: #ef6c00;
    border-left-color: #ff9500;
}
.tt-course.teacher-mode { background: #e8f5e9; color: #2e7d32; border-left-color: #34c759; }
.tt-course.changed { background: #fff3e0; color: #ef6c00; border-left-color: #ff9500; }

.tt-course strong { display: block; font-size: 0.75rem; margin-bottom: 2px; }
.tt-course .tt-room { font-size: 0.68rem; opacity: 0.85; margin-top: 2px; }

/* Badges — standalone or nested */
.tt-course .tt-badge,
.tt-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    margin-top: 4px;
    background: #ff9500;
    color: #fff;
    font-weight: 700;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.tt-badge-cancelled { background: #ff3b30 !important; color: #fff !important; }
.tt-badge-rescheduled { background: #ff9500 !important; color: #fff !important; }

/* Legacy list (admin / teacher pages) */
.tt-list { margin-top: 32px; }
.tt-list h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 16px; }
.tt-list-item {
    background: #fff;
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.tt-list-item .tt-info { flex: 1; min-width: 200px; }
.tt-list-item .tt-title { font-weight: 600; margin-bottom: 4px; }
.tt-list-item .tt-meta { font-size: 0.8rem; color: #6e6e73; }
.tt-list-item .tt-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Hide instructional subtitles in dashboard headers */
.dashboard-header p {
    display: none !important;
}

/* Clean up the header margin since the paragraph is gone */
.dashboard-header {
    margin-bottom: 24px;
}

/* ============================================
   28. RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .main-content { padding: 24px; margin-left: 240px; }
    .sidebar { width: 240px; }
    .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
    .footer:not(.public) { margin-left: 240px; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        width: 280px; padding: 24px 20px;
        z-index: 2000;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    .sidebar.open { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        padding: 72px 16px 24px 16px;
        width: 100%;
    }
    .main-content > h1:first-of-type { padding-right: 60px; }

    .dashboard-container { flex-direction: column; }

    .card { padding: 18px; border-radius: 16px; margin-bottom: 16px; }
    .card-title { font-size: 1.05rem; margin-bottom: 16px; padding-bottom: 10px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
    .stat-card { padding: 16px 12px; }
    .stat-number { font-size: 1.4rem; }
    .stat-label { font-size: 0.7rem; }

    .form-row { grid-template-columns: 1fr; gap: 12px; }
    .form-group { margin-bottom: 14px; }
    .form-group label { font-size: 0.85rem; }
    .form-group input, .form-group select, .form-group textarea {
        padding: 12px 14px; font-size: 16px;
    }

    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px; }
    .data-table { min-width: 500px; font-size: 0.85rem; }
    .data-table th, .data-table td { padding: 10px 8px; white-space: nowrap; }

    .btn { padding: 12px 20px; font-size: 0.9rem; min-height: 44px; }
    .btn-sm { padding: 8px 14px; font-size: 0.8rem; min-height: 36px; }

    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-bottom: 16px; }
    .tab { padding: 10px 16px; font-size: 0.85rem; white-space: nowrap; }

    .modal { align-items: flex-end; padding: 0; }
    .modal-content { max-width: 100%; width: 100%; margin: 0; border-radius: 20px 20px 0 0; max-height: 90vh; }
    .modal-header { border-radius: 20px 20px 0 0; padding: 16px 20px; }
    .modal-body { padding: 20px; }

    .course-grid { grid-template-columns: 1fr; gap: 8px; }
    .course-tile { padding: 12px 14px; font-size: 0.85rem; }
    .role-grid { gap: 8px; }
    .role-tile { padding: 10px 14px; font-size: 0.85rem; flex: 1 1 auto; min-width: 100px; }

    .navbar .container { padding: 0 16px; gap: 10px; flex-direction: column; text-align: center; }
    .nav-links { justify-content: center; gap: 14px; width: 100%; }
    .nav-links a { font-size: 0.85rem; }
    .nav-buttons { justify-content: center; width: 100%; }
    .logo-img { width: 44px; height: 44px; }
    .logo-text { font-size: 0.95rem; }

    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.2rem; }

    .footer, .footer:not(.public) { margin-left: 0; padding: 24px 16px; }
    .footer .copyright p { font-size: 0.8rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 20px; }

    .login-card { padding: 28px 20px; border-radius: 20px; }
    .login-header h1 { font-size: 1.5rem; }

    .login-page-bg { min-height: calc(100vh - 200px); padding: 24px 16px; }
    .login-page-bg .login-card { padding: 32px 24px; border-radius: 20px; max-width: 100%; }
    .login-bubble { animation-duration: 30s; }

    .login-logo-wrapper { width: 200px; height: 200px; }
    .login-logo-wrapper img { width: 70px; height: 70px; }
    .galaxy-ring-outer { animation-duration: 120s; }
    .galaxy-ring-inner { animation-duration: 80s; }

    .lib-wrap { padding: 0 16px; }
    .lib-grid { grid-template-columns: 1fr; }
    .lib-featured { padding: 32px 24px; }

    .adm-wrap { padding: 0 16px; }
    .adm-grid { grid-template-columns: 1fr; }

    /* Timetable — horizontal scroll on mobile, keep text readable */
    .tt-wrap {
        padding: 0 16px 40px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tt-grid {
        padding: 10px;
        gap: 6px;
        min-width: 900px;
    }
    .tt-day-head { padding: 8px 4px; font-size: 0.72rem; }
    .tt-course { padding: 7px; font-size: 0.72rem; }
    .tt-course strong { font-size: 0.75rem; }
    .tt-course .tt-room { font-size: 0.68rem; }
    .tt-period-label { font-size: 0.7rem; }
    .tt-list-item { padding: 14px 16px; }
}

@media (max-width: 480px) {
    .main-content { padding: 68px 12px 20px 12px; }
    .card { padding: 14px; border-radius: 14px; }
    .stat-card { padding: 12px 8px; }
    .stat-number { font-size: 1.2rem; }
    .btn { padding: 10px 16px; font-size: 0.85rem; }
    .container { padding: 0 12px; }
    .footer { padding: 20px 12px; }
}

@media print {
    .sidebar, .navbar, .footer, .btn, .mobile-menu-btn, .sidebar-overlay, .no-print { display: none !important; }
    .main-content { margin-left: 0; padding: 0; }
}
