@import url('https://fonts.googleapis.com/css2?family=Anuphan:wght@200;300;400;500;600;700&display=swap');

:root {
    /* PSRU Official University Color Palette */
    --psru-navy: #0f2b5c;
    --psru-navy-dark: #091b3a;
    --psru-navy-deep: #061329;
    --psru-blue: #1e40af;
    --psru-blue-vibrant: #2563eb;
    --psru-blue-light: #eff6ff;
    --psru-gold: #d97706;
    --psru-gold-hover: #b45309;
    --psru-gold-light: #fef3c7;
    --psru-gold-border: #fde68a;

    --primary: #0f2b5c;
    --primary-hover: #1e40af;
    --primary-light: #f0f5ff;
    --primary-dark: #091b3a;
    --accent: #2563eb;
    --accent-gold: #d97706;
    
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-muted: #f1f5f9;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-card: #cbd5e1;
    --border-focus: #2563eb;
    
    --success: #059669;
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(15, 43, 92, 0.05);
    --shadow-md: 0 4px 14px -2px rgba(15, 43, 92, 0.08), 0 2px 6px -1px rgba(15, 43, 92, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 43, 92, 0.12), 0 4px 10px -2px rgba(15, 43, 92, 0.06);
    --shadow-card: 0 4px 20px -2px rgba(15, 43, 92, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Anuphan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.55;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* University Prestige Top Accent Ribbon */
.university-top-ribbon {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #091b3a 0%, #0f2b5c 25%, #1e40af 55%, #d97706 82%, #f59e0b 100%);
    position: sticky;
    top: 0;
    z-index: 102;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Container with Widescreen Scaling */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 22px;
}

@media (min-width: 1280px) {
    .container {
        max-width: 1320px;
        padding: 0 28px;
    }
}

@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
        padding: 0 32px;
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 1520px;
        padding: 0 36px;
    }
}

/* Navbar (University Grade Header with Frosted Glass) */
.navbar {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 20px -2px rgba(15, 43, 92, 0.06);
    position: sticky;
    top: 4px;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 17.5px;
    letter-spacing: -0.2px;
}

.navbar-brand:hover .university-seal-icon {
    transform: scale(1.04);
    box-shadow: 0 6px 16px rgba(15, 43, 92, 0.35);
}

.university-seal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #091b3a 0%, #0f2b5c 40%, #1e40af 75%, #d97706 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 43, 92, 0.25);
    border: 1.5px solid rgba(253, 230, 138, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.brand-text-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-family: 'Anuphan', sans-serif;
    font-weight: 700;
    color: #0f2b5c;
    font-size: 16.5px;
    line-height: 1.25;
    white-space: nowrap;
}

.brand-title-short {
    display: none;
}

.brand-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Navigation Quick Links in Header */
.nav-quick-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
}
.nav-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.nav-link-pill:hover {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.nav-link-pill.highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.nav-link-pill.highlight:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

/* User Badge Pill */
.user-badge {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 5px 12px 5px 6px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.user-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(15, 43, 92, 0.2);
    flex-shrink: 0;
}

.nav-user-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #0f172a;
}

.role-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2.5px 8.5px;
    border-radius: 9999px;
    letter-spacing: 0.2px;
}

.role-teacher {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.role-student {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.role-admin {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.btn-logout {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    transform: translateY(-1px);
}

/* Mobile Navigation Hamburger Toggle (Hidden by default on desktop) */
.internal-mobile-toggle {
    display: none;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f2b5c;
    padding: 4px 10px 4px 4px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.internal-mobile-toggle:hover,
.internal-mobile-toggle.active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

.toggle-avatar-ring {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(15, 43, 92, 0.25);
}

.toggle-avatar-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.toggle-hamburger-icon {
    display: inline-flex;
    align-items: center;
    color: #0f2b5c;
}

.toggle-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    margin-right: 2px;
}

/* ==========================================================================
   Modern Offcanvas Mobile Navigation Drawer
   ========================================================================== */
.mobile-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 86%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -10px 0 35px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.mobile-drawer-panel.open {
    transform: translateX(0);
}

/* Drawer Header: University Prestige Gradient Card */
.drawer-header {
    background: linear-gradient(135deg, #091b3a 0%, #0f2b5c 50%, #1a365d 100%);
    padding: 24px 20px 22px;
    color: #ffffff;
    position: relative;
    border-bottom: 2px solid rgba(253, 230, 138, 0.35);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(9, 27, 58, 0.2);
}

.drawer-header-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-right: 36px;
}

.drawer-avatar-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.drawer-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.drawer-avatar-initial {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Anuphan', sans-serif;
}

.drawer-user-meta {
    flex: 1;
    min-width: 0;
}

.drawer-user-greeting {
    font-size: 11px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.85);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.drawer-user-name {
    font-size: 15.5px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 3px;
    line-height: 1.35;
    word-break: break-word;
    font-family: 'Anuphan', sans-serif;
}

.drawer-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.drawer-role-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2.5px 9px;
    border-radius: 9999px;
    letter-spacing: 0.2px;
}

.drawer-role-tag.role-student {
    background: rgba(34, 197, 94, 0.22);
    color: #86efac;
    border: 1px solid rgba(134, 239, 172, 0.45);
}

.drawer-role-tag.role-teacher {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
    border: 1px solid rgba(191, 219, 254, 0.45);
}

.drawer-role-tag.role-admin {
    background: rgba(245, 158, 11, 0.25);
    color: #fde68a;
    border: 1px solid rgba(253, 230, 138, 0.45);
}

.drawer-id-tag {
    font-size: 11px;
    color: rgba(241, 245, 249, 0.9);
    background: rgba(255, 255, 255, 0.14);
    padding: 2.5px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-drawer-close {
    position: absolute;
    top: 18px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.btn-drawer-close:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 1);
    color: #ffffff;
    transform: rotate(90deg) scale(1.05);
}

/* Drawer Body & Menu Items */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
}

.drawer-menu-section-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    margin: 0 4px 10px;
}

.drawer-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-nav-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(15, 43, 92, 0.08);
}

.drawer-nav-item:active {
    transform: scale(0.99);
}

.drawer-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drawer-item-icon.icon-blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.drawer-item-icon.icon-emerald {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.drawer-item-icon.icon-purple {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.drawer-item-icon.icon-gold {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #b45309;
    border: 1px solid #fde68a;
}

.drawer-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.drawer-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.drawer-item-desc {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.3;
}

.drawer-item-arrow {
    color: #cbd5e1;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.drawer-nav-item:hover .drawer-item-arrow {
    color: #1e40af;
    transform: translateX(2px);
}

/* Drawer Footer */
.drawer-footer {
    padding: 16px 18px 20px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.btn-drawer-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.05);
}

.btn-drawer-logout:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    transform: translateY(-1px);
}

.drawer-footer-credits {
    font-size: 11px;
    text-align: center;
    color: #94a3b8;
    font-weight: 500;
}

/* Password Modal Backdrop & Card */
.password-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeInModal 0.2s ease-out;
}

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

.password-modal-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    animation: scaleInModal 0.2s ease-out;
}

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

.password-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-close-modal:hover {
    background: #fee2e2;
    color: #dc2626;
}

.password-modal-body {
    padding: 18px 20px;
}

.password-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    padding: 30px 0 60px;
}

/* Page Header */
.page-header {
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.page-title {
    font-size: 23px;
    font-weight: 700;
    color: #0f2b5c;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* University-Grade Institutional Cards */
.card {
    background: var(--bg-surface);
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    word-wrap: break-word;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    box-shadow: 0 8px 24px -3px rgba(15, 43, 92, 0.08);
}

.card-header,
.login-header {
    padding: 16px 22px;
    border-bottom: 1px solid #f1f5f9;
    border-left: none;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    gap: 12px;
}

.card-title {
    font-size: 17.5px;
    font-weight: 700;
    color: #0f2b5c;
    letter-spacing: -0.2px;
}

.card-body,
.login-body {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.login-card {
    box-shadow: var(--shadow-lg);
    border-top: 4px solid #0f2b5c;
}

/* Alert Boxes */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

.alert-success {
    background-color: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: var(--warning-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: var(--info-bg);
    color: #075985;
    border: 1px solid #bae6fd;
}

/* Table - Formal Academic Data Table */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    font-family: 'Anuphan', sans-serif;
}

.data-table th {
    background-color: #0f2b5c;
    color: #ffffff;
    font-weight: 600;
    padding: 13px 16px;
    border: 1px solid #1e3a8a;
    font-size: 13.5px;
    letter-spacing: 0.1px;
}

.data-table td {
    padding: 13px 16px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #1e293b;
}

.data-table tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}

.data-table tbody tr:hover td {
    background-color: #eff6ff;
}

/* Pill Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4.5px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Anuphan', sans-serif;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
    color: #ffffff;
    border-color: #0f2b5c;
    box-shadow: 0 2px 6px rgba(15, 43, 92, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #091b3a 0%, #172554 100%);
    box-shadow: 0 4px 14px rgba(15, 43, 92, 0.32);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background-color: var(--bg-surface);
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Assessment Matrix (Likert Scale) */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0 25px;
}

.matrix-table th {
    background-color: #0f2b5c;
    color: #ffffff;
    padding: 12px;
    text-align: center;
    border: 1px solid #1e3a8a;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.matrix-table th.question-col {
    text-align: left !important;
    width: 55%;
}

.matrix-table td.matrix-question {
    text-align: left !important;
}

.matrix-table td {
    padding: 12px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}

.matrix-table td.radio-cell {
    text-align: center;
    width: 9%;
    cursor: pointer;
}

.matrix-table tr:hover td {
    background-color: #f0f7ff;
}

.rating-touch-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
}

.rating-num-label,
.rating-desc-label {
    display: none;
}

.rating-radio {
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    margin: 0 auto;
    display: block;
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #0f2b5c 0%, #1e40af 100%);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #1e40af 0%, #0284c7 100%);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px -3px rgba(15, 43, 92, 0.1);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 6px;
    letter-spacing: -0.5px;
}

/* Auth Cards */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 20px;
}

.auth-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 30px;
    color: white;
    text-align: center;
}

.auth-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 13px;
    opacity: 0.9;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--bg-surface);
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.auth-body {
    padding: 30px;
}

/* Footer */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: auto;
}

/* ==========================================================================
   Portal Landing Page Styles (assess.psru.ac.th modern edition)
   ========================================================================== */
.portal-header {
    background: #ffffff;
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.portal-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
}

.portal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.portal-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-nav-link {
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.portal-nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.portal-nav-link.external {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid var(--border-color);
}

.portal-nav-link.external:hover {
    background: #e2e8f0;
}

/* Mobile Menu Toggle Button (Prominent & High-Contrast) */
.portal-mobile-toggle {
    display: none;
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--primary-dark);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    min-height: 40px;
}

.portal-mobile-toggle:hover,
.portal-mobile-toggle:active,
.portal-mobile-toggle.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.portal-mobile-toggle .toggle-icon {
    display: flex;
    align-items: center;
}

/* Mobile Slide-down Drawer Menu */
.portal-mobile-menu {
    display: none;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.15);
    width: 100%;
}

.portal-mobile-menu.open {
    display: block;
    animation: menuSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.portal-mobile-menu-inner {
    display: flex;
    flex-direction: column;
    padding: 10px 14px 18px;
    gap: 5px;
    max-width: 600px;
    margin: 0 auto;
}

.portal-mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.btn-close-menu {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
}

.btn-close-menu:hover,
.btn-close-menu:active {
    background: #e2e8f0;
    color: #0f172a;
}

.portal-mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.portal-mobile-link:hover,
.portal-mobile-link:active {
    background: var(--primary-light);
    color: var(--primary);
}

.portal-mobile-link.highlight {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.portal-mobile-link .link-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.portal-mobile-link.contact {
    background: #f0fdf4;
    color: #15803d;
    font-weight: 600;
    margin-top: 6px;
    border: 1px dashed #86efac;
}

.portal-mobile-link.external {
    color: #64748b;
}

/* Mobile Quick-Jump Nav Bar (Sticky on Mobile) */
.portal-quick-nav {
    display: none;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 58px;
    z-index: 90;
    width: 100%;
}

.portal-quick-nav-container {
    padding: 0 12px;
}

.portal-quick-nav-track {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
    scrollbar-width: none;
}

.portal-quick-nav-track::-webkit-scrollbar {
    display: none;
}

.quick-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.quick-nav-pill:active,
.quick-nav-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.28);
}

.quick-nav-pill.contact {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Floating Back to Top Button */
.portal-float-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    z-index: 99;
    transition: transform 0.2s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.portal-float-btn.visible {
    display: flex;
}

.portal-float-btn:active {
    transform: scale(0.92);
}

/* Main Layout */
.portal-main {
    flex: 1;
    padding: 24px 0 50px;
    width: 100%;
    max-width: 100%;
}

.portal-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.portal-grid > *,
.portal-sidebar,
.portal-content {
    min-width: 0;
    max-width: 100%;
}

.portal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.portal-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Base Card & Containers */
.card,
.banner-alert,
.counter-card,
.helpdesk-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    scroll-margin-top: 72px;
}

.card-body,
.login-body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Counter & Helpdesk Cards */
.counter-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.counter-num {
    font-family: monospace;
    font-size: 22px;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
    flex-shrink: 0;
}

.helpdesk-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.helpdesk-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Notice Banner */
.banner-alert {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-left: 6px solid #2563eb;
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.banner-alert-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.banner-badge {
    background: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.date-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 14px;
    margin-top: 10px;
    border: 1px solid #fca5a5;
    line-height: 1.4;
}

/* Permissions Matrix Table */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #ffffff;
}

.matrix-table th {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    text-align: center;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.matrix-table td {
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    text-align: center;
}

.check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid #a7f3d0;
}

.mobile-table-hint {
    display: none;
    font-size: 12px;
    color: #1e40af;
    background: #eff6ff;
    padding: 6px 12px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 500;
    border: 1px dashed #bfdbfe;
}

/* Modern University Portal Footer */
.portal-footer {
    background: #0f172a;
    color: #94a3b8;
    border-top: 3px solid var(--primary);
    padding: 44px 0 24px;
    margin-top: auto;
    width: 100%;
    font-size: 14px;
}

.portal-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1.2fr 1fr;
    gap: 36px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.footer-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.footer-brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
}

.footer-brand-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.footer-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.65;
    margin-bottom: 16px;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.f-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
}

.footer-col-title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 16px;
    letter-spacing: 0.2px;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.55;
}

.footer-list .f-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.footer-link-highlight {
    color: #60a5fa;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-link-highlight:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links-list a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    transition: all 0.15s ease;
}

.footer-links-list a:hover {
    color: #60a5fa;
    transform: translateX(3px);
}

/* Sub-Footer Bottom Bar */
.portal-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 22px;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12.5px;
}

.footer-bottom-copy {
    color: #94a3b8;
}

.footer-bottom-copy strong {
    color: #e2e8f0;
}

.footer-bottom-tech {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
}

/* Internal Layout Footer (Logged-in pages) */
.internal-footer {
    background: #091b3a;
    color: #94a3b8;
    border-top: 3px solid #1e3a8a;
    padding: 32px 0 24px;
    margin-top: auto;
    font-size: 13.5px;
    width: 100%;
}

.internal-footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-col-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 600px;
}

.footer-university-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Anuphan', sans-serif;
    letter-spacing: 0.1px;
}

.univ-crest-dot {
    font-size: 18px;
    line-height: 1;
}

.footer-dept-name {
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
}

.footer-univ-contact {
    color: #94a3b8;
    font-size: 12.5px;
    line-height: 1.55;
}

.footer-col-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.internal-footer-tech {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tech-tag-light {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.1px;
}

.internal-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 12.5px;
}

.footer-sub-link {
    color: #93c5fd;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-sub-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.link-divider {
    color: #475569;
}

.portal-system-label {
    color: #94a3b8;
    font-size: 12px;
    letter-spacing: 0.1px;
}

.internal-footer-copy {
    color: #94a3b8;
    font-size: 12px;
}

.internal-footer-copy strong {
    color: #f1f5f9;
}

@media (max-width: 768px) {
    .internal-footer-grid {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-col-badges {
        align-items: flex-start;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 14px;
    }
    .internal-footer-tech,
    .internal-footer-links {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Responsive Utilities & Touch Ergonomics
   ========================================================================== */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.regis-form-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 12px;
    align-items: end;
    width: 100%;
    box-sizing: border-box;
}

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    width: 100%;
    box-sizing: border-box;
}

.rating-radio {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
    margin: 0 auto;
    display: block;
}

.radio-cell {
    text-align: center;
    vertical-align: middle;
    padding: 12px 6px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
/* Tablet & Medium Screen (<= 992px) */
@media (max-width: 992px) {
    .portal-nav {
        display: none;
    }
    .portal-mobile-toggle {
        display: inline-flex;
    }
    .portal-quick-nav {
        display: none !important;
    }
    .portal-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        max-width: 100%;
    }
    .portal-sidebar {
        order: 1; /* Login card appears first so users can login immediately */
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .portal-content {
        order: 2;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .portal-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .portal-footer-grid .brand-col {
        grid-column: span 2;
    }
}

/* Mobile Screen (<= 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    .portal-main {
        padding: 16px 0 40px;
    }
    .portal-header-inner {
        padding: 10px 0;
        gap: 10px;
    }
    .portal-title {
        font-size: 15px;
    }
    .portal-subtitle {
        font-size: 11px;
    }
    .portal-logo {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 13px;
        border-radius: 10px;
    }
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }
    .card-header,
    .login-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-body,
    .login-body {
        padding: 16px 14px;
    }
    /* Sleek Segmented Control for Role Switching */
    .auth-tabs {
        display: flex;
        gap: 3px;
        padding: 4px;
        background: #e2e8f0;
        border-radius: 10px;
        margin: 12px 14px 0;
        border-bottom: none;
    }
    .auth-tab {
        flex: 1;
        min-width: 0;
        padding: 10px 4px;
        font-size: 12.5px;
        font-weight: 600;
        text-align: center;
        border-radius: 7px;
        border: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        background: transparent;
        color: #475569;
        transition: all 0.2s;
    }
    .auth-tab.active {
        background: #ffffff;
        color: var(--primary);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        border-bottom: none;
    }
    .banner-alert {
        padding: 16px 14px;
        border-left-width: 4px;
    }
    .banner-alert-title {
        font-size: 15px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .date-pill {
        font-size: 13px;
        padding: 8px 12px;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        display: block;
        border-radius: 8px;
        line-height: 1.5;
        word-break: break-word;
    }
    .regis-form-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    .regis-form-grid .form-group {
        width: 100%;
    }
    .regis-form-grid button {
        width: 100%;
        padding: 12px;
        margin-top: 4px;
        min-height: 44px;
        font-weight: 600;
    }
    .form-row-2col {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stat-card {
        padding: 14px 16px;
    }
    .mobile-table-hint {
        display: block;
        font-size: 12px;
        color: var(--primary);
        background: var(--primary-light);
        border: 1px solid #bfdbfe;
        border-radius: var(--radius-sm);
        padding: 6px 10px;
        margin-bottom: 10px;
        text-align: center;
        font-weight: 500;
    }
    /* iOS input auto-zoom prevention: requires >= 16px font-size */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    .btn {
        min-height: 44px;
    }
    .navbar .container {
        height: 62px;
        padding: 0 12px;
        gap: 8px;
    }
    .navbar-brand {
        font-size: 14.5px;
        gap: 8px;
    }
    .brand-subtitle,
    .navbar-brand .brand-subtitle {
        display: none !important;
    }
    .nav-quick-links {
        display: none !important;
    }
    .navbar .btn-logout {
        display: none !important;
    }
    .internal-mobile-toggle {
        display: inline-flex !important;
    }
    .navbar .user-badge,
    .user-badge {
        display: none !important;
    }
    /* Mobile Footer Layout */
    .portal-footer {
        padding: 34px 0 20px;
    }
    .portal-footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-bottom: 22px;
    }
    .portal-footer-grid .brand-col {
        grid-column: span 1;
    }
    .portal-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        align-items: center;
        justify-content: center;
    }
    .footer-bottom-tech {
        justify-content: center;
    }
    .internal-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .internal-footer-tech {
        justify-content: center;
    }
}

/* ==========================================================================
   Small Screen Responsive Card Tables & Touch Matrix (<= 680px)
   ========================================================================== */
@media (max-width: 680px) {
    /* Responsive Card Tables */
    .responsive-card-table {
        display: block;
        width: 100%;
        border-collapse: collapse;
    }
    .responsive-card-table thead {
        display: none !important;
    }
    .responsive-card-table tbody {
        display: block;
        width: 100%;
    }
    .responsive-card-table tr {
        display: block;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
        box-sizing: border-box;
        width: 100%;
    }
    .responsive-card-table tr:hover {
        background-color: var(--bg-surface);
    }
    .responsive-card-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 7px 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        font-size: 13.5px;
        box-sizing: border-box;
        width: 100%;
    }
    .responsive-card-table td:last-child {
        border-bottom: none;
    }
    .responsive-card-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        font-size: 13px;
        flex-shrink: 0;
        margin-right: 10px;
    }
    .responsive-card-table td.col-subject {
        display: block;
        padding: 0 0 10px 0;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 4px;
    }
    .responsive-card-table td.col-subject::before {
        display: none;
    }
    .responsive-card-table td.col-subject .subject-title {
        font-size: 15px;
        line-height: 1.4;
        display: block;
    }
    .responsive-card-table td.col-actions {
        display: block;
        padding: 10px 0 0 0;
        margin-top: 6px;
        border-top: 1px dashed var(--border-color);
    }
    .responsive-card-table td.col-actions::before {
        display: none;
    }
    .responsive-card-table td.col-actions .teacher-action-btns {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
        gap: 6px;
        width: 100%;
    }
    .responsive-card-table td.col-actions .btn {
        width: 100%;
        padding: 8px 4px;
        font-size: 12.5px;
        min-height: 38px;
        text-align: center;
        justify-content: center;
    }
    .responsive-card-table td.table-empty-cell {
        display: block;
        text-align: center !important;
        padding: 30px 10px;
    }
    .responsive-card-table td.table-empty-cell::before {
        display: none;
    }

    /* Student Course Table specifics */
    .student-course-table td.col-teachers {
        display: block;
        padding: 10px 0 0 0;
        border-top: 1px dashed var(--border-color);
        margin-top: 4px;
    }
    .student-course-table td.col-teachers::before {
        display: none;
    }
    .teacher-list-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .teacher-eval-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #f8fafc;
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        flex-wrap: wrap;
        gap: 8px;
        box-sizing: border-box;
        width: 100%;
    }
    .teacher-info {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }
    .teacher-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted);
        flex-shrink: 0;
    }
    .teacher-name {
        font-weight: 500;
        font-size: 13.5px;
        word-break: break-word;
    }
    .teacher-actions {
        flex-shrink: 0;
    }
    .teacher-actions .btn {
        min-height: 38px;
        padding: 7px 14px;
        font-size: 13px;
    }
    .eval-done-group {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Student Status Table specifics */
    .student-status-table td.col-num {
        display: none;
    }

    /* Header Filter & Pagination */
    .dashboard-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }
    .dashboard-filter-form {
        width: 100%;
        display: flex;
        gap: 6px;
    }
    .dashboard-filter-form .filter-select {
        flex: 1;
        min-width: 0;
        width: 100%;
        min-height: 42px;
    }
    .dashboard-filter-form .filter-reset-btn {
        min-height: 42px;
        padding: 6px 14px;
    }
    .pagination-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 14px 12px !important;
    }
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    .pagination .btn {
        min-width: 36px;
        height: 36px;
        padding: 4px 8px;
        font-size: 13px;
    }

    /* Likert Scale Matrix Mobile Card View */
    .matrix-table {
        display: block;
        width: 100%;
        border: none;
        margin: 10px 0;
    }
    .matrix-table thead {
        display: none !important;
    }
    .matrix-table tbody {
        display: block;
        width: 100%;
    }
    .matrix-table tr {
        display: block;
        padding: 14px 10px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background: #ffffff;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
        box-sizing: border-box;
        width: 100%;
    }
    .matrix-table tr:hover td {
        background-color: transparent;
    }
    .matrix-table td.matrix-question {
        display: block;
        width: 100%;
        padding: 0 0 12px 0;
        border: none;
        font-size: 14px;
        line-height: 1.5;
        color: var(--text-main);
        box-sizing: border-box;
        text-align: left !important;
    }
    .matrix-table td.radio-cell {
        display: inline-flex;
        width: 20%;
        padding: 2px;
        border: none;
        background: transparent;
        text-align: center;
        vertical-align: top;
        box-sizing: border-box;
    }
    .rating-touch-target {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 56px;
        padding: 6px 2px;
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        cursor: pointer;
        transition: all 0.15s ease;
        box-sizing: border-box;
    }
    .rating-touch-target:active,
    .rating-touch-target:hover {
        background: #eff6ff;
        border-color: #93c5fd;
    }
    .rating-num-label {
        display: block;
        font-size: 14px;
        font-weight: 700;
        color: var(--primary);
        line-height: 1;
        margin-bottom: 3px;
    }
    .rating-desc-label {
        display: block;
        font-size: 9.5px;
        color: var(--text-muted);
        line-height: 1.1;
        margin-top: 3px;
        white-space: nowrap;
        text-align: center;
    }
    .matrix-table .rating-radio {
        width: 22px;
        height: 22px;
        margin: 0;
        cursor: pointer;
    }

    /* Form Actions */
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
        width: 100%;
    }
    .form-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        min-height: 44px;
    }
}

/* Extra Small Phones (320px - 480px, e.g. iPhone SE, mini Androids) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    .main-wrapper {
        padding: 16px 0 36px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }
    .page-title {
        font-size: 18px;
    }
    .page-subtitle {
        font-size: 12.5px;
    }
    .page-header-actions {
        width: 100%;
    }
    .page-header-actions .btn {
        width: 100%;
        min-height: 42px;
    }
    .portal-header-inner {
        padding: 8px 0;
        gap: 8px;
    }
    .portal-brand {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }
    .portal-logo {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 12px;
        border-radius: 8px;
    }
    .portal-title {
        font-size: 13.5px;
    }
    .portal-subtitle {
        display: none;
    }
    .portal-mobile-toggle {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
        min-height: 36px;
    }
    .card-body,
    .login-body {
        padding: 14px 12px;
    }
    .card-header,
    .login-header {
        padding: 12px;
    }
    .auth-tabs {
        margin: 10px 12px 0;
        padding: 3px;
    }
    .auth-tab {
        font-size: 11.5px;
        padding: 8px 2px;
    }
    .counter-card,
    .helpdesk-card {
        padding: 12px;
    }
    .counter-num {
        font-size: 18px;
        padding: 2px 8px;
    }
    .btn {
        padding: 10px 14px;
        min-height: 44px;
    }
    .portal-footer {
        padding: 26px 0 18px;
    }
    .portal-footer-grid {
        gap: 20px;
        padding-bottom: 18px;
    }
    .footer-brand {
        gap: 10px;
    }
    .footer-brand-title {
        font-size: 15px;
    }
    .footer-bottom-copy {
        font-size: 11.5px;
        line-height: 1.5;
    }
    .tech-tag {
        font-size: 10px;
        padding: 2px 6px;
    }
    .badge {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    /* Navbar on small screens */
    .navbar {
        top: 0;
    }
    .navbar .container {
        height: 54px;
        padding: 0 8px;
        gap: 6px;
    }
    .navbar-brand {
        font-size: 13.5px;
        gap: 6px;
        min-width: 0;
        flex-shrink: 1;
    }
    .navbar-brand .university-seal-icon,
    .navbar-brand .logo-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 14px;
        border-radius: 8px;
    }
    .navbar-brand .university-seal-icon svg {
        width: 17px;
        height: 17px;
    }
    .brand-title {
        font-size: 13px;
        line-height: 1.2;
    }
    .brand-title-full {
        display: none !important;
    }
    .brand-title-short {
        display: inline !important;
    }
    .brand-subtitle,
    .navbar-brand .brand-subtitle {
        display: none !important;
    }
    .nav-user {
        gap: 6px;
        flex-shrink: 0;
    }
    .nav-quick-links {
        display: none !important;
    }
    .btn-logout {
        display: none !important;
    }
    .internal-mobile-toggle {
        display: inline-flex !important;
        padding: 4px 10px 4px 4px;
        font-size: 12px;
        gap: 5px;
        border-radius: 9999px;
    }
    .toggle-avatar-ring {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .navbar .user-badge,
    .user-badge {
        display: none !important;
    }

    /* Assessment Header Card on Mobile */
    .assess-header-body {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .assess-teacher-img {
        width: 60px !important;
        height: 60px !important;
    }
    .assess-course-title {
        font-size: 16.5px !important;
    }
    .assess-teacher-sub .teacher-fac {
        display: block;
        margin-top: 2px;
    }
    .rating-desc-label {
        font-size: 9px;
    }
    .rating-touch-target {
        min-height: 52px;
        padding: 4px 1px;
    }
    .rating-radio {
        width: 20px;
        height: 20px;
    }
    .submitted-actions,
    .unlock-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .submitted-actions .btn,
    .unlock-actions .btn {
        width: 100%;
    }
    .poster-card .card-body {
        padding: 8px !important;
    }
}

/* Tiny Phones (<= 360px, e.g. iPhone 5/SE 1st gen, Galaxy Fold closed 320px) */
@media (max-width: 360px) {
    .container {
        padding: 0 5px;
    }
    .navbar .container {
        padding: 0 4px;
        height: 50px;
        gap: 3px;
    }
    .navbar-brand {
        gap: 4px;
    }
    .navbar-brand .university-seal-icon,
    .navbar-brand .logo-icon {
        width: 27px;
        height: 27px;
        min-width: 27px;
        border-radius: 6px;
    }
    .navbar-brand .university-seal-icon svg {
        width: 14px;
        height: 14px;
    }
    .brand-title {
        font-size: 11.5px;
    }
    .nav-user {
        gap: 3px;
    }
    .nav-quick-links {
        display: none !important;
    }
    .btn-logout {
        display: none !important;
    }
    .internal-mobile-toggle {
        display: inline-flex !important;
        padding: 3px 8px 3px 3px;
        font-size: 11.5px;
        gap: 4px;
        border-radius: 9999px;
    }
    .toggle-avatar-ring {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    .navbar .user-badge,
    .user-badge {
        display: none !important;
    }
    .portal-title {
        font-size: 12.5px;
    }
    .portal-mobile-toggle .toggle-text {
        font-size: 11px;
    }
    .auth-tab {
        font-size: 11px;
        padding: 7px 1px;
    }
    .counter-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .counter-num {
        align-self: flex-start;
    }
    .banner-alert {
        padding: 12px 10px;
    }
    .date-pill {
        font-size: 12px;
        padding: 6px 8px;
    }
    .rating-desc-label {
        font-size: 8px;
        letter-spacing: -0.3px;
    }
    .rating-num-label {
        font-size: 12.5px;
    }
    .rating-touch-target {
        min-height: 48px;
        padding: 4px 1px;
    }
    .matrix-table tr {
        padding: 10px 4px;
    }
    .responsive-card-table td.col-actions .btn {
        font-size: 11.5px;
        padding: 6px 1px;
    }
    .card-header,
    .card-body {
        padding: 10px 8px;
    }
}

/* ==========================================================================
   Semester Summary Table & Print Styles
   ========================================================================== */
@media (max-width: 680px) {
    .summary-term-table tfoot {
        display: block;
        width: 100%;
        margin-top: 14px;
    }
    .summary-term-table tfoot tr {
        display: block;
        background: #f0fdf4;
        border: 2px solid #86efac;
        padding: 14px;
        border-radius: var(--radius-md);
    }
    .summary-term-table tfoot td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        border-bottom: 1px dashed #bbf7d0;
        font-size: 13.5px;
    }
    .summary-term-table tfoot td:first-child {
        display: block;
        font-weight: 700;
        color: #166534;
        font-size: 15px;
        text-align: left !important;
        border-bottom: 2px solid #86efac;
        padding-bottom: 8px;
        margin-bottom: 6px;
    }
    .summary-term-table tfoot td.no-print {
        display: none !important;
    }
}

/* Print Styles for Official Evaluation Reports */
@media print {
    .navbar,
    .internal-footer,
    .no-print,
    .btn,
    .btn-print,
    .term-switcher-form,
    .mobile-table-hint {
        display: none !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
    }
    .main-wrapper {
        padding: 0 !important;
    }
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .card {
        border: 1px solid #d1d5db !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 16px !important;
    }
    .card-header {
        background: #f8fafc !important;
        border-bottom: 1px solid #d1d5db !important;
        padding: 8px 12px !important;
    }
    .data-table {
        border-collapse: collapse !important;
        width: 100% !important;
        font-size: 9.5pt !important;
    }
    .data-table th,
    .data-table td {
        border: 1px solid #cbd5e1 !important;
        padding: 6px 6px !important;
    }
    .data-table th {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
    }
    .badge {
        border: 1px solid #cbd5e1 !important;
        background: transparent !important;
        color: #000000 !important;
        padding: 2px 6px !important;
    }
    .print-signatures {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Role Switcher Tabs & Executive Group Navigation */
.role-switcher-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.role-switcher-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--psru-navy);
}
.role-switcher-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.role-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-muted);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.role-tab-btn:hover {
    color: var(--psru-navy);
    background: #e2e8f0;
}
.role-tab-btn.active {
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(15, 43, 92, 0.22);
}
.role-tab-btn.active.tab-president {
    background: linear-gradient(135deg, #1e1b4b, #4338ca);
    border-color: #4338ca;
}
.role-tab-btn.active.tab-dean {
    background: linear-gradient(135deg, #7c2d12, #c2410c);
    border-color: #c2410c;
}
.role-tab-btn.active.tab-head {
    background: linear-gradient(135deg, #064e3b, #059669);
    border-color: #059669;
}
.role-tab-btn.active.tab-teacher {
    background: linear-gradient(135deg, #0f2b5c, #2563eb);
    border-color: #2563eb;
}
@media (max-width: 768px) {
    .role-switcher-card {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
    }
    .role-switcher-tabs {
        width: 100%;
    }
    .role-tab-btn {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
        text-align: center;
        padding: 7px 10px;
        font-size: 12.5px;
    }
}

/* ==========================================================================
   STUDENT DASHBOARD - MODERN WIDESCREEN & RESPONSIVE SUITE
/* ==========================================================================
   STUDENT DASHBOARD - COMPACT, MODERN & UNIVERSALLY RESPONSIVE
   ========================================================================== */

/* 1. Student Profile Header (Compact Prestige Banner) */
.student-profile-header {
    background: linear-gradient(135deg, #091b3a 0%, #0f2b5c 55%, #1e40af 100%);
    border-radius: var(--radius-md);
    color: #ffffff;
    padding: 16px 22px;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px -2px rgba(15, 43, 92, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.student-profile-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 450px;
}

.student-profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e40af 0%, #d97706 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.student-profile-info {
    min-width: 0;
}

.student-profile-greeting {
    font-size: 12px;
    color: #93c5fd;
    font-weight: 500;
    margin-bottom: 2px;
}

.student-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin: 0;
}

.student-profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2.5px 9px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f1f5f9;
}

.profile-chip-gold {
    background: rgba(217, 119, 6, 0.25);
    border-color: rgba(253, 230, 138, 0.35);
    color: #fef3c7;
    font-weight: 600;
}

.student-profile-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.profile-progress-box {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 170px;
}

.profile-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 5px;
}

.profile-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    overflow: hidden;
}

.profile-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
    border-radius: 9999px;
    transition: width 0.6s ease;
}

.profile-stats-pill-group {
    display: flex;
    gap: 6px;
}

.profile-stat-mini {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
    min-width: 65px;
}

.profile-stat-mini-num {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
}

.profile-stat-mini-num.emerald {
    color: #6ee7b7;
}

.profile-stat-mini-num.gold {
    color: #fcd34d;
}

.profile-stat-mini-label {
    font-size: 10.5px;
    color: #cbd5e1;
    margin-top: 2px;
}

/* 2. Compact Dashboard Toolbar */
.dashboard-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    background: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.filter-tab-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn-filter-tab:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-filter-tab.active {
    background: #0f2b5c;
    color: #ffffff;
    border-color: #0f2b5c;
    box-shadow: 0 2px 6px rgba(15, 43, 92, 0.22);
}

.btn-filter-tab .badge-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.08);
}

.btn-filter-tab.active .badge-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.search-filter-input-wrap {
    position: relative;
    width: 250px;
}

.search-filter-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-filter-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-icon-svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.dashboard-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.view-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 3px;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
}

.view-btn:hover {
    color: #0f172a;
}

.view-btn.active {
    background: #ffffff;
    color: #0f2b5c;
    box-shadow: 0 1px 3px rgba(15, 43, 92, 0.12);
}

.profile-banner-note {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 18px;
    line-height: 1.45;
}

.profile-banner-note svg {
    flex-shrink: 0;
    color: #d97706;
}

.profile-banner-note.completed {
    background: #ecfdf5;
    border-color: #d1fae5;
    border-left-color: #10b981;
    color: #065f46;
}

.profile-banner-note.completed svg {
    color: #059669;
}

/* 3. Course Cards Container (Clean, Proportional, Zero Voids) */
.course-card-stream,
.course-cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.course-card-item,
.student-course-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 43, 92, 0.04);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: auto !important;
    min-height: 0 !important;
}

.course-card-item:hover,
.student-course-card:hover {
    box-shadow: 0 6px 18px rgba(15, 43, 92, 0.08);
    border-color: #cbd5e1;
}

.course-card-item.status-done,
.student-course-card.status-done {
    border-left: 4.5px solid #10b981;
}

.course-card-item.status-pending,
.student-course-card.status-pending {
    border-left: 4.5px solid #d97706;
}

/* Compact Course Card Header */
.course-card-topbar,
.course-card-header {
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: auto !important;
    min-height: 0 !important;
}

.course-info-group,
.course-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.badge-course-id,
.course-code-badge {
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

.course-names,
.course-title-block {
    min-width: 0;
}

.course-name-thai,
.course-title-th {
    font-size: 15.5px;
    font-weight: 700;
    color: #0f2b5c;
    line-height: 1.3;
    margin: 0;
}

.course-name-eng,
.course-title-en {
    font-size: 12px;
    color: #64748b;
    margin-top: 1px;
}

.course-meta-tags,
.course-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.meta-pill-term,
.pill-term {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3.5px 10px;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 600;
}

.meta-pill-section,
.pill-section {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3.5px 10px;
    border-radius: 9999px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 600;
}

/* Course Card Body - Teachers List */
.course-card-content,
.course-card-body {
    padding: 14px 18px;
    height: auto !important;
    min-height: 0 !important;
}

.teachers-block-title,
.teachers-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.teachers-row-list,
.teacher-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.teacher-item-box,
.teacher-eval-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.15s ease;
    height: auto !important;
    min-height: 0 !important;
}

.teacher-item-box:hover,
.teacher-eval-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.teacher-item-box.evaluated,
.teacher-eval-card.evaluated {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.teacher-item-box.evaluated:hover,
.teacher-eval-card.evaluated:hover {
    background: #f0fdf4;
    border-color: #86efac;
}

.teacher-identity,
.teacher-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.teacher-avatar-circle,
.teacher-avatar-frame {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
    box-shadow: 0 1px 4px rgba(15, 43, 92, 0.15);
    border: 1.5px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.teacher-avatar-circle img,
.teacher-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.teacher-avatar-initial,
.teacher-monogram-initial {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
}

.teacher-name-group,
.teacher-card-info {
    min-width: 0;
}

.teacher-fullname,
.teacher-card-name {
    font-size: 14.5px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}

.teacher-subcode,
.teacher-card-id {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 1px;
}

.teacher-action-group,
.teacher-card-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-eval-cta-primary,
.btn-eval-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0f2b5c 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-eval-cta-primary:hover,
.btn-eval-cta:hover {
    background: linear-gradient(135deg, #091b3a 0%, #1d4ed8 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    color: #ffffff;
}

.btn-unlock-outline,
.btn-unlock-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-unlock-outline:hover,
.btn-unlock-pill:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* 4. Responsive Rules for Mobile and Tablets */
@media (max-width: 768px) {
    .student-profile-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .student-profile-left {
        width: 100%;
        flex: none;
    }
    .student-profile-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .profile-progress-box {
        width: 100%;
        min-width: 0;
    }
    .profile-stats-pill-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    .profile-stat-mini {
        width: 100%;
        min-width: 0;
    }

    .dashboard-filter-bar {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .filter-tab-buttons {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        flex-wrap: nowrap;
    }
    .btn-filter-tab {
        flex-shrink: 0;
    }
    .dashboard-toolbar-controls {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .search-filter-input-wrap {
        width: 100%;
        flex: 1;
    }

    .course-card-topbar,
    .course-card-header {
        padding: 12px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .course-info-group,
    .course-header-left {
        width: 100%;
    }
    .course-meta-tags,
    .course-header-right {
        width: 100%;
    }
    .course-card-content,
    .course-card-body {
        padding: 12px 14px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    .main-wrapper {
        padding: 12px 0 32px;
    }

    .teacher-item-box,
    .teacher-eval-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
    }
    .teacher-identity,
    .teacher-card-left {
        width: 100%;
    }
    .teacher-action-group,
    .teacher-card-action {
        width: 100%;
        padding-top: 8px;
        border-top: 1px dashed #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .btn-eval-cta-primary,
    .btn-eval-cta {
        width: 100%;
        justify-content: center;
        padding: 9px 14px;
    }
}

/* ==========================================================================
   STUDENT DASHBOARD - MODERN TABLE VIEW (Academic Luxury & Responsiveness)
   ========================================================================== */
.student-table-wrapper {
    margin-bottom: 24px;
}

.student-table-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 43, 92, 0.04);
    overflow: hidden;
}

.student-table-header {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-header-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f2b5c;
    margin: 0;
    line-height: 1.25;
}

.table-header-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.table-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #bfdbfe;
}

/* Table Specifics */
.student-course-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: inherit;
    font-size: 14px;
}

.student-course-table thead th {
    background: #0f2b5c;
    color: #ffffff;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.1px;
    text-align: left;
    border-top: none;
    border-bottom: 2px solid #1e40af;
    vertical-align: middle;
}

.student-course-table thead th.th-subject {
    width: 34%;
}

.student-course-table thead th.th-section {
    width: 18%;
}

.student-course-table thead th.th-teachers {
    width: 48%;
}

.student-course-table tbody tr.table-course-row {
    transition: background 0.15s ease;
    border-bottom: 1px solid #edf2f7;
}

.student-course-table tbody tr.table-course-row:last-child td {
    border-bottom: none;
}

.student-course-table tbody tr.table-course-row:hover td {
    background-color: #f8fafc;
}

.student-course-table tbody tr.table-course-row.status-done td:first-child {
    border-left: 4.5px solid #10b981;
}

.student-course-table tbody tr.table-course-row.status-pending td:first-child {
    border-left: 4.5px solid #d97706;
}

.student-course-table td {
    padding: 14px 18px;
    vertical-align: top;
    border-bottom: 1px solid #edf2f7;
}

/* Column 1: Subject */
.td-subject {
    display: table-cell;
}

.table-course-code-wrap {
    margin-bottom: 5px;
}

.table-course-code {
    display: inline-block;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.2px;
}

.table-course-titles {
    min-width: 0;
}

.table-course-name-th {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f2b5c;
    line-height: 1.35;
    word-break: break-word;
}

.table-course-name-en {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* Column 2: Section & Term */
.table-section-chips {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* Column 3: Teachers List inside Table */
.table-teacher-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.table-teacher-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.15s ease;
}

.table-teacher-card:hover {
    background: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 1px 4px rgba(15, 43, 92, 0.06);
}

.table-teacher-card.evaluated {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.table-teacher-card.evaluated:hover {
    background: #f0fdf4;
    border-color: #86efac;
}

.table-teacher-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.table-teacher-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-teacher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.table-teacher-text {
    min-width: 0;
}

.table-teacher-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    word-break: break-word;
}

.table-teacher-code {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
}

.table-teacher-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.table-empty-row {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--text-muted);
    font-size: 14.5px;
    font-weight: 500;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE RULES FOR TABLE VIEW
   ========================================================================== */
@media (max-width: 768px) {
    .student-course-table thead {
        display: none;
    }

    .student-course-table,
    .student-course-table tbody,
    .student-course-table tbody tr.table-course-row {
        display: block;
        width: 100%;
    }

    .student-course-table tbody tr.table-course-row {
        margin-bottom: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 14px;
        background: #ffffff;
        box-shadow: 0 2px 6px rgba(15, 43, 92, 0.04);
        position: relative;
    }

    .student-course-table tbody tr.table-course-row.status-done {
        border-left: 4.5px solid #10b981;
    }

    .student-course-table tbody tr.table-course-row.status-pending {
        border-left: 4.5px solid #d97706;
    }

    .student-course-table tbody tr.table-course-row td {
        display: block;
        width: 100%;
        padding: 0;
        border: none !important;
    }

    .student-course-table tbody tr.table-course-row td.td-subject {
        padding-bottom: 10px;
        border-bottom: 1px solid #edf2f7 !important;
        margin-bottom: 8px;
    }

    .student-course-table tbody tr.table-course-row td.td-section {
        padding-bottom: 10px;
        border-bottom: 1px dashed #e2e8f0 !important;
        margin-bottom: 10px;
    }

    .table-section-chips {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .table-teacher-card {
        padding: 8px 10px;
    }
}

@media (max-width: 576px) {
    .table-teacher-card {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .table-teacher-profile {
        width: 100%;
    }

    .table-teacher-actions {
        width: 100%;
        padding-top: 6px;
        border-top: 1px dashed #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .table-teacher-actions .btn-eval-cta-primary {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }
}

/* ==========================================================================
   Questionnaire Achievement Styles (Desktop & Mobile Optimized)
   ========================================================================== */
.achievement-header-card {
    margin-bottom: 24px;
    border-top: 4px solid var(--primary);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #ffffff;
}

.achievement-header-body {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px 24px;
}

.achievement-teacher-avatar {
    width: 76px;
    height: 76px;
    border-radius: 14px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.achievement-teacher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.achievement-meta-block {
    flex: 1;
    min-width: 0;
}

.achievement-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.badge-step-pill {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.achievement-main-title {
    font-size: 18.5px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.achievement-details-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.achievement-details-row .detail-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.achievement-details-row .detail-value {
    color: var(--text-main);
    font-weight: 600;
}

.achievement-details-row .teacher-highlight {
    color: var(--primary);
}

/* Instructions Card */
.achievement-info-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 24px;
    display: block;
}

.achievement-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 8px;
}

.achievement-info-desc {
    margin: 0 0 14px 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: #166534;
}

.achievement-legend-wrap {
    background: #ffffff;
    border: 1px solid #dcfce7;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.achievement-legend-title {
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.achievement-legend-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex: 1;
    max-width: 500px;
}

.achievement-legend-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.achievement-legend-pill.score-3 { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.achievement-legend-pill.score-2 { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.achievement-legend-pill.score-1 { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.achievement-legend-pill.score-0 { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.achievement-legend-pill .score-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,0.08);
}

/* Sections and Questions */
.achievement-section-card {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    background: #ffffff;
}

.achievement-section-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.achievement-section-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-section-counter {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 4-Column Rating Matrix */
.matrix-table-4cols {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.matrix-table-4cols thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.matrix-table-4cols thead th.question-col {
    text-align: left;
    padding-left: 20px;
}

.matrix-table-4cols tbody td.matrix-question {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.matrix-table-4cols tbody td.radio-cell {
    padding: 10px 6px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    width: 11%;
}

.achievement-rating-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 6px 2px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.achievement-rating-label:hover {
    background: #f1f5f9;
}

.achievement-rating-label .rating-num {
    display: none;
}

.achievement-rating-label .rating-text {
    display: none;
}

.achievement-rating-label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

/* Mobile Responsive Optimization (max-width: 768px) */
@media (max-width: 768px) {
    .achievement-header-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px;
    }

    .achievement-top-meta-mobile {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
    }

    .achievement-teacher-avatar {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }

    .achievement-main-title {
        font-size: 16.5px;
        line-height: 1.35;
    }

    .achievement-details-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 13px;
    }

    .achievement-info-card {
        padding: 14px;
        margin-bottom: 18px;
    }

    .achievement-info-desc {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 10px;
    }

    .achievement-legend-wrap {
        padding: 8px 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .achievement-legend-grid {
        max-width: 100%;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .achievement-legend-pill {
        padding: 6px 2px;
        font-size: 11px;
        flex-direction: column;
        gap: 2px;
    }

    .achievement-legend-pill .score-badge {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }

    /* Transform Table to Mobile Cards */
    .matrix-table-4cols {
        display: block;
        width: 100%;
    }

    .matrix-table-4cols thead {
        display: none !important;
    }

    .matrix-table-4cols tbody {
        display: block;
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    .matrix-table-4cols tr {
        display: block;
        width: 100%;
        padding: 14px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #ffffff;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.03);
        box-sizing: border-box;
    }

    .matrix-table-4cols tr:last-child {
        margin-bottom: 0;
    }

    .matrix-table-4cols tbody td.matrix-question {
        display: block;
        width: 100%;
        padding: 0 0 12px 0 !important;
        border: none;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.5;
        color: #1e293b;
        box-sizing: border-box;
    }

    .matrix-table-4cols tbody td.radio-cell {
        display: inline-flex;
        width: 25% !important;
        padding: 3px !important;
        border: none !important;
        box-sizing: border-box;
        vertical-align: top;
    }

    .achievement-rating-label {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 64px;
        padding: 8px 2px;
        border-radius: 10px;
        border: 1.5px solid #e2e8f0;
        background: #f8fafc;
        box-sizing: border-box;
        transition: all 0.15s ease;
    }

    .achievement-rating-label .rating-num {
        display: block;
        font-size: 15px;
        font-weight: 700;
        line-height: 1;
        margin-bottom: 4px;
        color: var(--primary);
    }

    .achievement-rating-label input[type="radio"] {
        width: 22px;
        height: 22px;
        margin: 2px 0 4px 0;
    }

    .achievement-rating-label .rating-text {
        display: block;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
        color: var(--text-muted);
        text-align: center;
        white-space: nowrap;
    }

    /* Selected state highlighting */
    .achievement-rating-label:has(input[type="radio"]:checked),
    .achievement-rating-label.is-selected {
        background: #eff6ff;
        border-color: #3b82f6;
        box-shadow: 0 0 0 1.5px #3b82f6;
    }

    .radio-cell[data-score="3"] .achievement-rating-label:has(input[type="radio"]:checked),
    .radio-cell[data-score="3"] .achievement-rating-label.is-selected {
        background: #f0fdf4;
        border-color: #10b981;
        box-shadow: 0 0 0 1.5px #10b981;
    }
    .radio-cell[data-score="3"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-num,
    .radio-cell[data-score="3"] .achievement-rating-label.is-selected .rating-num,
    .radio-cell[data-score="3"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-text,
    .radio-cell[data-score="3"] .achievement-rating-label.is-selected .rating-text {
        color: #047857;
    }

    .radio-cell[data-score="2"] .achievement-rating-label:has(input[type="radio"]:checked),
    .radio-cell[data-score="2"] .achievement-rating-label.is-selected {
        background: #eff6ff;
        border-color: #3b82f6;
        box-shadow: 0 0 0 1.5px #3b82f6;
    }
    .radio-cell[data-score="2"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-num,
    .radio-cell[data-score="2"] .achievement-rating-label.is-selected .rating-num,
    .radio-cell[data-score="2"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-text,
    .radio-cell[data-score="2"] .achievement-rating-label.is-selected .rating-text {
        color: #1d4ed8;
    }

    .radio-cell[data-score="1"] .achievement-rating-label:has(input[type="radio"]:checked),
    .radio-cell[data-score="1"] .achievement-rating-label.is-selected {
        background: #fffbeb;
        border-color: #f59e0b;
        box-shadow: 0 0 0 1.5px #f59e0b;
    }
    .radio-cell[data-score="1"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-num,
    .radio-cell[data-score="1"] .achievement-rating-label.is-selected .rating-num,
    .radio-cell[data-score="1"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-text,
    .radio-cell[data-score="1"] .achievement-rating-label.is-selected .rating-text {
        color: #b45309;
    }

    .radio-cell[data-score="0"] .achievement-rating-label:has(input[type="radio"]:checked),
    .radio-cell[data-score="0"] .achievement-rating-label.is-selected {
        background: #f8fafc;
        border-color: #64748b;
        box-shadow: 0 0 0 1.5px #64748b;
    }
    .radio-cell[data-score="0"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-num,
    .radio-cell[data-score="0"] .achievement-rating-label.is-selected .rating-num,
    .radio-cell[data-score="0"] .achievement-rating-label:has(input[type="radio"]:checked) .rating-text,
    .radio-cell[data-score="0"] .achievement-rating-label.is-selected .rating-text {
        color: #334155;
    }
}

@media (max-width: 480px) {
    .achievement-rating-label {
        min-height: 58px;
        padding: 6px 1px;
    }
    .achievement-rating-label .rating-num {
        font-size: 13.5px;
    }
    .achievement-rating-label .rating-text {
        font-size: 10px;
    }
    .achievement-rating-label input[type="radio"] {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================================================
   University Prestige Portal Upgrade (PSRU Royal Academic Design)
   ========================================================================== */

/* Universal Font Application for Portal */
.portal-body {
    font-family: 'Prompt', 'Anuphan', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    background-image: 
        radial-gradient(at 10% 10%, rgba(37, 99, 235, 0.03) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(217, 119, 6, 0.03) 0px, transparent 50%);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 1. Top Institutional Utility Bar */
.uni-top-bar {
    background: #07162c;
    color: #94a3b8;
    font-size: 12px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    position: relative;
    z-index: 103;
}

.uni-top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    gap: 12px;
    flex-wrap: wrap;
}

.uni-top-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #cbd5e1;
}

.uni-top-badge {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.uni-top-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.uni-top-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s ease;
    font-size: 11.5px;
}

.uni-top-links a:hover {
    color: #f59e0b;
}

.uni-term-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.uni-hotline-pill {
    background: rgba(37, 99, 235, 0.25) !important;
    color: #93c5fd !important;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(147, 197, 253, 0.3);
    font-weight: 600;
}

.uni-hotline-pill:hover {
    background: rgba(37, 99, 235, 0.4) !important;
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .uni-top-bar {
        display: none;
    }
}

/* 2. Portal Header Prestige Upgrades */
.portal-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

.academic-emblem-badge {
    position: relative;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 60%, #2563eb 100%) !important;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 4px 14px rgba(15, 43, 92, 0.3), inset 0 0 8px rgba(245, 158, 11, 0.4) !important;
}

.portal-title {
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #0f2b5c;
    letter-spacing: -0.3px;
}

.portal-subtitle {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.portal-nav-link {
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.portal-nav-link.active {
    color: #1e40af;
    background: #eff6ff;
    font-weight: 600;
}

.portal-nav-link:hover {
    color: #1e40af;
    background: #f1f5f9;
}

/* 3. Hero Showcase Banner (Prestigious University Greeting) */
.uni-hero-banner {
    position: relative;
    background: linear-gradient(135deg, #07162c 0%, #0c2340 40%, #172554 85%, #1e3a8a 100%);
    border-radius: 18px;
    padding: 36px 36px 32px;
    color: #ffffff;
    margin-bottom: 26px;
    box-shadow: 0 20px 40px -15px rgba(7, 22, 44, 0.35);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.uni-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, rgba(37, 99, 235, 0.08) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.uni-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 20%;
    width: 300px;
    height: 120px;
    background: radial-gradient(ellipse, rgba(37, 99, 235, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.uni-hero-content {
    position: relative;
    z-index: 2;
}

.uni-hero-badge-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fef3c7;
    padding: 4px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    backdrop-filter: blur(4px);
}

.uni-hero-title {
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: clamp(20px, 3vw, 29px);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 8px;
    letter-spacing: -0.4px;
}

.uni-hero-sub {
    font-size: 14px;
    color: #cbd5e1;
    max-width: 820px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.uni-hero-pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.uni-pillar-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.uni-pillar-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.25);
}

.uni-pillar-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(37, 99, 235, 0.25));
    border: 1px solid rgba(245, 158, 11, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.uni-pillar-info h4 {
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.uni-pillar-info p {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0;
}

@media (max-width: 768px) {
    .uni-hero-banner {
        padding: 24px 20px;
        border-radius: 14px;
    }
    .uni-hero-pillars {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* 4. Centerpiece Login Card */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 15px 35px -10px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.6);
    overflow: hidden;
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #2563eb 40%, #f59e0b 75%, #d97706 100%);
    z-index: 5;
}

.login-header {
    padding: 18px 22px 14px;
    background: linear-gradient(to right, #f0f7ff, #f8fafc);
    border-bottom: 1px solid #e2e8f0;
    border-left: none !important;
}

.login-header-title {
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #0f2b5c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.auth-tabs {
    display: flex;
    padding: 6px 12px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    gap: 6px;
}

.auth-tab {
    flex: 1;
    padding: 9px 4px;
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    text-decoration: none;
}

.auth-tab:hover {
    color: #1e40af;
    background: rgba(255, 255, 255, 0.6);
}

.auth-tab.active {
    background: #ffffff;
    color: #1e40af;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    font-weight: 700;
}

.auth-tab.active[data-tab="teacher"] {
    color: #047857;
}

.auth-tab.active[data-tab="admin"] {
    color: #0f172a;
}

/* Input Icon Group Styling */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap svg.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.15s ease;
}

.input-icon-wrap .form-control {
    padding-left: 40px;
    padding-right: 42px;
    height: 44px;
    font-size: 13.5px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    transition: all 0.18s ease;
}

.input-icon-wrap .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

.input-icon-wrap:focus-within svg.input-icon {
    color: #2563eb;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s ease;
    z-index: 10;
    pointer-events: auto;
}

.password-toggle-btn svg {
    pointer-events: none;
}

.password-toggle-btn:hover {
    color: #334155;
    background: #f1f5f9;
}

/* Modern Login Submit Button */
.btn-login-submit {
    width: 100%;
    padding: 12px;
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 50%, #2563eb 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 8px 18px -4px rgba(30, 64, 175, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -4px rgba(30, 64, 175, 0.5);
    background: linear-gradient(135deg, #0f2b5c 0%, #1d4ed8 50%, #3b82f6 100%);
}

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

/* 5. Modernized Visitor Counter & Helpdesk */
.counter-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
}

.live-dot {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.counter-num {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 21px;
    font-weight: 800;
    color: #0f2b5c;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 5px 12px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.helpdesk-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

/* 6. Upgraded Cards in Right Content */
.banner-alert {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 60%, #fffbeb 100%);
    border: 1.5px solid #bfdbfe;
    border-left: 6px solid #1e40af;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 6px 16px -3px rgba(30, 64, 175, 0.08);
}

.banner-alert-title {
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-size: 17.5px;
    font-weight: 700;
    color: #0f2b5c;
    margin-bottom: 12px;
}

.card {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05);
}

.card-header {
    border-bottom: 1px solid #f1f5f9;
    border-left: none !important;
    padding: 16px 20px;
}

.portal-content .card-header,
.portal-layout .card-header,
.login-header,
#first-regis .card-header {
    border-left: none !important;
}

.card-title {
    font-family: 'Prompt', 'Anuphan', sans-serif;
    font-weight: 700;
}

/* SweetAlert2 PSRU Custom Aesthetics */
.psru-swal-popup {
    font-family: 'Prompt', 'Anuphan', sans-serif !important;
    border-radius: 20px !important;
    padding: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
}

.psru-swal-popup .swal2-title {
    font-family: 'Prompt', 'Anuphan', sans-serif !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f2b5c !important;
    padding: 8px 12px 0 !important;
}

.psru-swal-popup .swal2-html-container {
    font-family: 'Anuphan', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin: 12px 0 0 !important;
}

.psru-swal-popup .swal2-actions {
    margin: 20px 0 0 !important;
}

.psru-swal-btn {
    border-radius: 10px !important;
    font-family: 'Prompt', 'Anuphan', sans-serif !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 11px 24px !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
    transition: all 0.2s ease !important;
}

.psru-swal-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35) !important;
}

/* ==========================================================================
   Portal Navigation Dropdown & Evaluation Summary Components
   ========================================================================== */
.portal-nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.portal-nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.portal-nav-dropdown-toggle .dropdown-arrow {
    font-size: 10px;
    margin-left: 2px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.portal-nav-dropdown:hover .portal-nav-dropdown-toggle .dropdown-arrow,
.portal-nav-dropdown.active .portal-nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.portal-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 370px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 14px 35px -5px rgba(15, 23, 42, 0.18), 0 8px 12px -6px rgba(15, 23, 42, 0.1);
    border: 1px solid #e2e8f0;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}

.portal-nav-dropdown:hover .portal-dropdown-menu,
.portal-nav-dropdown:focus-within .portal-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.portal-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.15s ease;
}

.portal-dropdown-item:hover {
    background: #f1f5f9;
    transform: translateX(3px);
}

.portal-dropdown-item.full-portal-link {
    background: #eff6ff;
    border: 1px dashed #bfdbfe;
}

.portal-dropdown-item.full-portal-link:hover {
    background: #dbeafe;
}

.dropdown-item-icon {
    font-size: 22px;
    line-height: 1.1;
    flex-shrink: 0;
    margin-top: 1px;
}

.dropdown-item-text {
    display: flex;
    flex-direction: column;
}

.dropdown-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f2b5c;
    line-height: 1.35;
    font-family: 'Prompt', 'Anuphan', sans-serif;
}

.dropdown-item-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.35;
}

.portal-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 0;
}

.portal-mobile-menu-section-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px 4px;
    border-top: 1px solid #f1f5f9;
    margin-top: 6px;
}

/* Front Page Summary Section */
.summary-segmented-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.summary-segmented-tabs::-webkit-scrollbar {
    display: none;
}

.summary-tab-btn {
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    font-family: 'Prompt', 'Anuphan', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}

.summary-tab-btn.active {
    background: #ffffff;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.65);
    color: #1e293b;
}

.summary-tab-pane {
    display: none;
    animation: fadeInTab 0.25s ease-in-out;
}

.summary-tab-pane.active {
    display: block;
}

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

/* Summary Box and Filter Grids */
.summary-pane-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
}

.summary-filter-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
}

.summary-filter-grid-program {
    display: grid;
    grid-template-columns: 1.6fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
}

.summary-filter-grid .form-control,
.summary-filter-grid-program .form-control {
    height: 42px;
    font-size: 13px;
}

.summary-filter-grid .btn-submit-summary,
.summary-filter-grid-program .btn-submit-summary {
    height: 42px;
    padding: 0 20px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.summary-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.summary-counts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.summary-counts-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-total-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #ea580c;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* Student Counts Table Desktop Base */
.summary-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
}

.summary-student-counts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 13px;
}

.summary-student-counts-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.summary-student-counts-table th {
    padding: 10px 14px;
    color: #475569;
    font-weight: 600;
}

.summary-student-counts-table th.col-idx,
.summary-student-counts-table td.col-idx {
    width: 60px;
    text-align: center;
    color: #64748b;
    font-weight: 500;
}

.summary-student-counts-table th.col-faculty,
.summary-student-counts-table td.col-faculty {
    text-align: left;
    white-space: nowrap;
    min-width: 220px;
}

.summary-student-counts-table td.col-faculty a {
    color: #1e293b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: color 0.15s ease;
}

.summary-student-counts-table td.col-faculty a:hover {
    color: #2563eb;
}

.summary-student-counts-table th.col-count,
.summary-student-counts-table td.col-count {
    width: 170px;
    text-align: right;
    font-weight: 700;
    color: #0f2b5c;
    font-family: monospace;
    font-size: 14px;
    white-space: nowrap;
}

.summary-student-counts-table th.col-pct,
.summary-student-counts-table td.col-pct {
    width: 200px;
    text-align: left;
    vertical-align: middle;
}

.summary-student-counts-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.summary-student-counts-table tbody tr:hover {
    background: #f8fafc;
}

.summary-student-counts-table tfoot {
    background: #f8fafc;
    border-top: 2px solid #cbd5e1;
    font-weight: 700;
}

.summary-student-counts-table tfoot td {
    padding: 12px 14px;
}

/* Mobile Responsiveness for Small Screens */
@media (max-width: 768px) {
    .summary-filter-grid,
    .summary-filter-grid-program {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-filter-grid .form-group-item,
    .summary-filter-grid-program .form-group-item {
        width: 100%;
    }

    .summary-filter-grid .form-control,
    .summary-filter-grid-program .form-control {
        height: 44px;
        font-size: 14px;
        width: 100%;
    }

    .summary-filter-grid .btn-submit-summary,
    .summary-filter-grid-program .btn-submit-summary {
        width: 100%;
        height: 44px;
        font-size: 14px;
        justify-content: center;
        margin-top: 4px;
    }
}

@media (max-width: 640px) {
    .summary-segmented-tabs {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 6px;
        background: #f1f5f9;
        overflow-x: visible;
    }

    .summary-tab-btn {
        width: 100%;
        min-width: 0;
        padding: 11px 14px;
        font-size: 13.5px;
        justify-content: flex-start;
        border-radius: 8px;
        border: 1px solid transparent;
        white-space: normal;
    }

    .summary-tab-btn.active {
        background: #ffffff;
        color: #1d4ed8;
        border-color: #bfdbfe;
        border-left: 4px solid #2563eb;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
        font-weight: 700;
    }

    .summary-quick-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .summary-counts-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .summary-counts-filter {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .summary-counts-filter select {
        width: 100% !important;
        height: 42px !important;
    }

    /* Transform Table into Responsive Cards on Mobile */
    .summary-table-wrap {
        border: none !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .summary-student-counts-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    .summary-student-counts-table thead {
        display: none !important;
    }

    .summary-student-counts-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .summary-student-counts-table tbody tr {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        padding: 12px 14px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
        transition: all 0.15s ease !important;
    }

    .summary-student-counts-table tbody tr:hover {
        background: #ffffff !important;
        border-color: #93c5fd !important;
    }

    /* Col 1: ลำดับ Badge */
    .summary-student-counts-table td.col-idx {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 26px !important;
        height: 26px !important;
        background: #eff6ff !important;
        color: #1d4ed8 !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        border-radius: 6px !important;
        padding: 0 !important;
        margin-right: 8px !important;
        border: 1px solid #bfdbfe !important;
        flex-shrink: 0 !important;
    }

    /* Col 2: คณะวิชา (Full Horizontal Width, Never Vertical Broken!) */
    .summary-student-counts-table td.col-faculty {
        flex: 1 1 auto !important;
        font-size: 13.5px !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        padding: 0 !important;
        min-width: calc(100% - 40px) !important;
        margin-bottom: 8px !important;
        white-space: normal !important;
    }

    .summary-student-counts-table td.col-faculty a {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
        color: #1e293b !important;
    }

    /* Col 3: ผู้ประเมิน */
    .summary-student-counts-table td.col-count {
        display: flex !important;
        align-items: center !important;
        font-size: 13.5px !important;
        color: #0f2b5c !important;
        font-weight: 700 !important;
        padding: 0 !important;
        margin-left: 34px !important;
        width: auto !important;
        text-align: left !important;
    }

    .summary-student-counts-table td.col-count::before {
        content: "นักศึกษาที่ประเมิน: ";
        font-size: 12px;
        font-weight: 500;
        color: #64748b;
        margin-right: 4px;
        font-family: 'Prompt', 'Anuphan', sans-serif;
    }

    .summary-student-counts-table td.col-count::after {
        content: " คน";
        font-size: 12px;
        font-weight: 500;
        color: #64748b;
        margin-left: 2px;
        font-family: 'Prompt', 'Anuphan', sans-serif;
    }

    /* Col 4: สัดส่วน Progress Bar */
    .summary-student-counts-table td.col-pct {
        width: 100% !important;
        padding: 8px 0 0 34px !important;
        box-sizing: border-box !important;
    }

    /* Footer Card */
    .summary-student-counts-table tfoot {
        display: block !important;
        margin-top: 12px !important;
        background: #fff7ed !important;
        border: 1px solid #fed7aa !important;
        border-radius: 10px !important;
        padding: 12px 14px !important;
    }

    .summary-student-counts-table tfoot tr {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    .summary-student-counts-table tfoot td {
        padding: 0 !important;
        border: none !important;
    }

    .summary-student-counts-table tfoot td:nth-child(1) {
        font-size: 13.5px !important;
        color: #9a3412 !important;
        font-weight: 700 !important;
    }

    .summary-student-counts-table tfoot td:nth-child(2) {
        font-size: 15px !important;
        color: #ea580c !important;
        font-weight: 700 !important;
        font-family: monospace !important;
    }

    .summary-student-counts-table tfoot td:nth-child(2)::after {
        content: " คน";
        font-size: 12px;
        font-weight: 600;
        color: #9a3412;
    }

    .summary-student-counts-table tfoot td:nth-child(3) {
        font-size: 12px !important;
        color: #9a3412 !important;
        font-weight: 600 !important;
    }
}

@media (max-width: 576px) {
    #summary-section .card-header {
        padding: 14px 14px !important;
    }

    #summary-section .card-body {
        padding: 14px 12px !important;
    }

    .summary-header-wrap {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .summary-header-btn {
        width: 100%;
        justify-content: center;
        height: 40px;
        font-size: 13px !important;
    }

    .summary-pane-box {
        padding: 14px 12px !important;
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .summary-total-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }
}

/* ==========================================================================
   Home Page: Email Registration & Permissions Matrix Mobile Optimization
   ========================================================================== */

/* Registration Form Grid (Desktop Default) */
.regis-form-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr auto;
    gap: 12px;
    align-items: flex-end;
    width: 100%;
    box-sizing: border-box;
}

.regis-form-grid .form-group {
    margin-bottom: 0;
    width: 100%;
}

.regis-form-grid .form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.regis-form-grid .form-control {
    width: 100%;
    height: 42px;
    font-size: 13.5px;
    border-radius: 8px;
    box-sizing: border-box;
}

.regis-form-grid .btn-regis-submit {
    height: 42px;
    padding: 0 22px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.regis-info-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 12.5px;
    color: #166534;
    line-height: 1.6;
}

/* Permissions Matrix (Desktop Default) */
.perm-matrix-desktop {
    display: block;
}

.perm-matrix-mobile {
    display: none;
}

.permissions-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.permissions-matrix-table th {
    background: #f8fafc;
    color: #0f2b5c;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 8px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
}

.permissions-matrix-table th:last-child {
    border-right: none;
}

.permissions-matrix-table th.perm-col-role {
    text-align: left;
    padding-left: 16px;
}

.perm-th-sub {
    display: block;
    font-size: 11px;
    font-weight: normal;
    color: #64748b;
    margin-top: 2px;
}

.permissions-matrix-table td {
    padding: 12px 8px;
    font-size: 13.5px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f8fafc;
    text-align: center;
    vertical-align: middle;
}

.permissions-matrix-table tr:last-child td {
    border-bottom: none;
}

.permissions-matrix-table td:last-child {
    border-right: none;
}

.permissions-matrix-table td.perm-role-cell {
    text-align: left;
    padding-left: 16px;
    font-weight: 600;
}

.permissions-matrix-table td.role-student {
    color: #1e40af;
}

.permissions-matrix-table td.role-faculty {
    color: #047857;
}

.permissions-matrix-table td.role-admin {
    color: #0f172a;
}

.permissions-matrix-table tr:hover td {
    background-color: #f8fafc;
}

.perm-icon-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-weight: 700;
    font-size: 14px;
}

.perm-icon-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #cbd5e1;
    font-size: 15px;
    font-weight: 600;
}

.perm-guide-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12.5px;
    color: #475569;
    line-height: 1.7;
}

/* Mobile & Tablet Styles for Registration & Permissions (<= 768px) */
@media (max-width: 768px) {
    /* Registration Form Mobile Stacking */
    .regis-form-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        align-items: stretch !important;
    }

    .regis-form-grid .form-group {
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .regis-form-grid .form-label {
        font-size: 13px !important;
        margin-bottom: 5px !important;
    }

    .regis-form-grid .form-control {
        width: 100% !important;
        height: 46px !important;
        font-size: 15px !important;
        box-sizing: border-box !important;
    }

    .regis-form-grid .btn-regis-submit,
    .regis-form-grid button {
        width: 100% !important;
        height: 46px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        margin-top: 4px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .regis-info-box {
        font-size: 12px !important;
        padding: 11px 12px !important;
        line-height: 1.55 !important;
    }

    /* Permissions Matrix Mobile Cards */
    .perm-matrix-desktop {
        display: none !important;
    }

    .perm-matrix-mobile {
        display: block !important;
    }

    .perm-m-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 12px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
        overflow: hidden;
    }

    .perm-m-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid #e2e8f0;
    }

    .perm-m-role {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13.5px;
        font-weight: 700;
    }

    .perm-m-student .perm-m-header {
        background: #eff6ff;
        border-bottom-color: #dbeafe;
    }
    .perm-m-student .perm-m-role {
        color: #1d4ed8;
    }

    .perm-m-faculty .perm-m-header {
        background: #ecfdf5;
        border-bottom-color: #d1fae5;
    }
    .perm-m-faculty .perm-m-role {
        color: #047857;
    }

    .perm-m-admin .perm-m-header {
        background: #f1f5f9;
        border-bottom-color: #e2e8f0;
    }
    .perm-m-admin .perm-m-role {
        color: #0f172a;
    }

    .perm-m-count {
        font-size: 11px;
        font-weight: 700;
        padding: 2.5px 8px;
        border-radius: 12px;
        background: #ffffff;
        border: 1px solid currentColor;
    }

    .perm-m-student .perm-m-count {
        color: #1d4ed8;
        border-color: #bfdbfe;
    }

    .perm-m-faculty .perm-m-count {
        color: #047857;
        border-color: #a7f3d0;
    }

    .perm-m-admin .perm-m-count {
        color: #334155;
        border-color: #cbd5e1;
    }

    .perm-m-body {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .perm-m-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 8px;
        min-height: 44px;
        box-sizing: border-box;
    }

    .perm-m-item:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    .perm-m-item.is-allowed {
        background: #f0fdf4;
        border: 1px solid #bbf7d0;
    }

    .perm-m-item.is-allowed .perm-m-mark {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #16a34a;
        color: #ffffff;
        font-size: 11px;
        font-weight: bold;
        flex-shrink: 0;
    }

    .perm-m-item.is-allowed .perm-m-title {
        font-weight: 700;
        color: #15803d;
        display: block;
        font-size: 12px;
        line-height: 1.2;
    }

    .perm-m-item.is-allowed .perm-m-desc {
        font-size: 11px;
        color: #166534;
        display: block;
        line-height: 1.2;
    }

    .perm-m-item.is-denied {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        opacity: 0.75;
    }

    .perm-m-item.is-denied .perm-m-mark {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #e2e8f0;
        color: #94a3b8;
        font-size: 12px;
        font-weight: bold;
        flex-shrink: 0;
    }

    .perm-m-item.is-denied .perm-m-title {
        font-weight: 600;
        color: #64748b;
        display: block;
        font-size: 12px;
        line-height: 1.2;
    }

    .perm-m-item.is-denied .perm-m-desc {
        font-size: 11px;
        color: #94a3b8;
        display: block;
        line-height: 1.2;
    }

    .perm-guide-box {
        font-size: 12px !important;
        padding: 12px 14px !important;
        line-height: 1.6 !important;
    }
}

/* Extra Small Screens (<= 420px) */
@media (max-width: 420px) {
    #first-regis .card-header,
    #permissions .card-header {
        padding: 12px 12px !important;
    }

    #first-regis .card-body,
    #permissions .card-body {
        padding: 14px 10px !important;
    }

    .perm-m-body {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        padding: 10px !important;
    }

    .perm-m-item:last-child:nth-child(odd) {
        grid-column: auto !important;
    }

    .perm-m-header {
        padding: 9px 10px !important;
    }

    .perm-m-role {
        font-size: 12.5px !important;
    }

    .perm-m-item {
        padding: 7px 9px !important;
    }
}
