/* ============================================================
   Course Syllabus Submission System (ระบบจัดส่งโครงการสอน)
   Theme: Modern Academic Blue & Emerald
   ============================================================ */

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

:root {
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;

    --accent-emerald: #059669;
    --accent-emerald-light: #ecfdf5;
    --accent-emerald-border: #a7f3d0;

    --accent-amber: #d97706;
    --accent-amber-light: #fffbeb;
    --accent-amber-border: #fde68a;

    --accent-rose: #dc2626;
    --accent-rose-light: #fef2f2;
    --accent-rose-border: #fecaca;

    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --sidebar-text: #e2e8f0;
    --sidebar-text-muted: #94a3b8;
    --sidebar-active-bg: linear-gradient(90deg, #2563eb, #3b82f6);

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;

    --portal-bar-height: 42px;
    --sidebar-width: 270px;
    --topbar-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 12px 28px rgba(37, 99, 235, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ------------------------------------
   Layout Structure
------------------------------------ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.15);
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    padding-top: var(--portal-bar-height);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: var(--portal-bar-height);
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.content-body {
    padding: 28px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ------------------------------------
   Sidebar Elements
------------------------------------ */
.sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    flex-shrink: 0;
}

.sidebar-brand-text h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.sidebar-brand-text span {
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 12px 12px 6px 12px;
    margin-top: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-link:hover i {
    color: #60a5fa;
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.nav-link.active i {
    color: #ffffff;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.user-profile-mini:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-info {
    overflow: hidden;
    line-height: 1.3;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 0.7rem;
    color: #93c5fd;
}

/* ------------------------------------
   Topbar Elements
------------------------------------ */
.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-right: 14px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ------------------------------------
   Cards & Content UI
------------------------------------ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}

/* ------------------------------------
   Statistics Overview Cards
------------------------------------ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.rose { background: #fef2f2; color: #dc2626; }

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

/* ------------------------------------
   Buttons & Badges
------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    color: #ffffff;
}

.btn-success {
    background: var(--accent-emerald);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-success:hover {
    background: #047857;
    color: #ffffff;
}

.btn-danger {
    background: var(--accent-rose);
    color: #ffffff;
}

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

.btn-secondary {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

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

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: var(--accent-amber-light);
    color: var(--accent-amber);
    border: 1px solid var(--accent-amber-border);
}

.status-approved {
    background: var(--accent-emerald-light);
    color: var(--accent-emerald);
    border: 1px solid var(--accent-emerald-border);
}

.status-rejected {
    background: var(--accent-rose-light);
    color: var(--accent-rose);
    border: 1px solid var(--accent-rose-border);
}

/* ------------------------------------
   Course Item Dynamic Card (Form)
------------------------------------ */
.course-card-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.course-card-item:hover {
    border-color: var(--primary-border);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.course-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}

.course-number-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.course-fields-grid {
    display: grid;
    grid-template-columns: 1.1fr 2fr 1.6fr 1.1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 992px) {
    .course-fields-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .course-fields-grid {
        grid-template-columns: 1fr;
    }
}

/* Class Level Multi-Select Pills */
.class-level-pills-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.btn-level-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    outline: none;
}
.btn-level-pill.pill-sm {
    padding: 4px 10px;
    font-size: 0.82rem;
    border-radius: 6px;
}
.btn-level-pill:hover:not(:disabled) {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #1e293b;
    transform: translateY(-1px);
}
.btn-level-pill .pill-check {
    display: none;
    font-size: 0.75rem;
}
.btn-level-pill.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35) !important;
    transform: translateY(-1px);
}
.btn-level-pill.active .pill-check {
    display: inline-block;
}
.btn-level-pill:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

.form-label .required {
    color: #dc2626;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* File Upload Box (5MB limit) */
.file-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 16px;
    background: #f8fafc;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-zone.has-file {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald-light);
}

.file-upload-zone.file-too-large {
    border-color: var(--accent-rose);
    background: var(--accent-rose-light);
}

.file-preview-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-top: 8px;
    padding: 6px 10px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.size-tag {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.size-tag.valid { background: #dcfce7; color: #15803d; }
.size-tag.invalid { background: #fee2e2; color: #b91c1c; }

/* ------------------------------------
   Tables
------------------------------------ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table-custom th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-custom td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.table-custom tr:hover td {
    background: #f8fafc;
}

/* ------------------------------------
   Modals & Alerts
------------------------------------ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .content-body {
        padding: 16px;
    }
    .portal-pill span {
        display: none;
    }
    .portal-pill {
        padding: 4px 8px;
    }
    .portal-brand-link span {
        display: none;
    }
}

/* =========================================================================
   Academic Portal Universal Top Bar & App Switcher
   ========================================================================= */
.portal-top-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--portal-bar-height);
    background: #0f172a; /* deep sleek slate */
    color: #cbd5e1;
    z-index: 950;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
    transition: left 0.3s ease;
}

.portal-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.portal-bar-left::-webkit-scrollbar {
    display: none;
}

.portal-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    padding: 4px 6px;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.portal-brand-link i {
    color: #38bdf8; /* bright sky blue matching reference */
    font-size: 1rem;
}
.portal-brand-link:hover {
    color: #38bdf8;
}

.portal-bar-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 6px;
}

.portal-app-pills {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    text-decoration: none;
    padding: 4px 10px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    background: transparent;
}
.portal-pill:hover {
    color: #ffffff;
}
.portal-pill.active {
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 20px;
    padding: 4px 14px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
.portal-pill.active i {
    color: #ffffff !important;
}
.portal-pill-badge {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 12px;
    font-weight: 700;
    margin-left: 4px;
}

.portal-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.app-launcher-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.app-launcher-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* 9-Dots App Switcher Dropdown */
.app-switcher-dropdown {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
.app-switcher-dropdown.show {
    display: block;
}
.app-switcher-header {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.app-switcher-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.app-switcher-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 10px;
    border-radius: 10px;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    color: #1e293b;
}
.app-switcher-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}
.app-switcher-item.current {
    background: #eff6ff;
    border: 1.5px solid var(--primary);
}
.app-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 8px;
}
.app-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}
.app-item-desc {
    font-size: 0.72rem;
    color: #64748b;
}
.app-item-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    background: #dbeafe;
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: 4px;
}

/* ============================================================
   Enhanced Table & Administrative UI Components
   ============================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    background: #ffffff;
}

.custom-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 14px 16px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.custom-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    vertical-align: middle;
    color: var(--text-main);
}

.custom-table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.custom-table tbody tr:hover {
    background-color: #f8fafc;
}

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

/* User Code Pill */
.user-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: var(--primary-dark);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* User Avatar Bubble */
.user-avatar-bubble {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
    flex-shrink: 0;
}

/* Modern Action Buttons */
.btn-action-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: #ffffff;
}

.btn-action-icon.btn-edit {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.btn-action-icon.btn-edit:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.btn-action-icon.btn-key {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.btn-action-icon.btn-key:hover {
    background: #fef3c7;
    color: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(217, 119, 6, 0.15);
}

.btn-action-icon.btn-delete {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-action-icon.btn-delete:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.15);
}

/* Badge styling enhancements */
.badge-role-admin {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-role-head {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-role-committee {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-role-teacher {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-pill-active {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-pill-active:hover {
    background: #d1fae5;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
}

.status-pill-inactive {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-pill-inactive:hover {
    background: #fee2e2;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

/* ============================================================
   Modern Modal & Dialog System
   ============================================================ */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal-backdrop.show,
.modal-backdrop.active {
    display: flex !important;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-md, 14px);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color, #e2e8f0);
    overflow: hidden;
    position: relative;
    margin: auto;
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    padding: 18px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark, #1e3a8a);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f1f5f9;
    color: var(--text-main, #0f172a);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 130px);
}

.modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* ============================================================
   Project & Repository Archive Badges
   ============================================================ */
.project-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.project-pill.project-syllabus {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.project-pill.project-plan {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.project-pill.project-research {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}




/* Drag and Drop enhancement */
.file-upload-zone.dragover {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    transform: scale(1.02);
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.25);
}
.file-upload-zone > * {
    pointer-events: none;
}
