/* ==========================================================================
   University Teacher Evaluation System (IQA) — Version B: Academic Prestige
   Oxford Navy, Academic Brass, Kantumruy Pro Khmer, Responsive Desktop & Mobile
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Kantumruy+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
    /* Academic Prestige & Clarity Design System */
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-subtle: #f1f5f9;
    --bg-app: #f8fafc;
    --bg-sidebar: #0f172a;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-subtle: #f1f5f9;

    --text-heading: #0f172a;
    --text-main: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --primary: #1e3a8a;          /* Oxford Royal Navy */
    --primary-hover: #1e40af;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --primary-subtle: #eff6ff;
    --accent-gold: #b45309;      /* Academic Brass */
    --accent-gold-light: #fef3c7;

    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --info: #0284c7;
    --info-light: #f0f9ff;
    --purple: #7c3aed;
    --purple-light: #f5f3ff;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-subtle: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-card: 0 4px 12px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-pop: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
    --shadow-sm: 0 2px 5px rgba(15, 23, 42, .07);

    --font-latin: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-khmer: 'Kantumruy Pro', 'Inter', 'Noto Sans Khmer', sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

body {
    font-family: var(--font-latin);
    background: var(--bg-canvas);
    color: var(--text-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-heading);
    letter-spacing: -0.015em;
}

html[lang="km"] body, body.km, .khmer-text {
    font-family: var(--font-khmer);
    line-height: 1.68;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
}

html[lang="km"] h1, html[lang="km"] h2, html[lang="km"] h3, html[lang="km"] h4, html[lang="km"] h5, html[lang="km"] h6 {
    font-family: var(--font-khmer);
    line-height: 1.45;
}

.ui-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Sidebar and navigation */
.sidebar {
    width: 264px;
    min-width: 264px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: #0f172a;
    border-right: 1px solid #243047;
    box-shadow: none;
    z-index: 120;
}
.sidebar-header { padding: 18px 18px 16px; background: #0f172a; border-bottom-color: #243047; }
.sidebar-brand { gap: 9px; font-size: 1.02rem; }
.brand-icon {
    width: 30px; height: 30px; padding: 6px; flex: none;
    color: #fbbf24; background: #1e3a5f; border: 1px solid #315999; border-radius: 8px;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar .badge-tag { background: #2563eb; box-shadow: none; }
.sidebar-nav { padding: 10px 10px 20px; scrollbar-color: #475569 #0f172a; scrollbar-width: thin; overscroll-behavior: contain; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #475569; border-radius: 8px; }
.nav-section-title { margin: 12px 10px 5px; padding: 8px 0 5px; border-bottom: 1px solid #273449; color: #94a3b8; font-size: .65rem; letter-spacing: .09em; }
.nav-item { min-height: 36px; margin: 2px 0; padding: 7px 10px; gap: 10px; border-radius: 7px; font-size: .83rem; line-height: 1.3; }
.nav-item:hover { background: #1e293b; transform: none; }
.nav-item.active { background: #1d4ed8; box-shadow: none; }
.nav-icon {
    width: 17px; height: 17px; flex: 0 0 17px; margin: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tone-blue { color: #60a5fa; } .tone-cyan { color: #22d3ee; } .tone-sky { color: #7dd3fc; }
.tone-indigo { color: #a5b4fc; } .tone-violet { color: #c4b5fd; } .tone-green { color: #86efac; }
.tone-rose { color: #fda4af; } .tone-amber { color: #fcd34d; } .tone-orange { color: #fdba74; }
.tone-teal { color: #5eead4; } .tone-slate { color: #cbd5e1; }
.nav-item.active .nav-icon { color: #fff; }
.nav-title { font-size: .82rem; line-height: 1.3; }
.nav-code { font-size: .65rem; margin-top: 2px; }
.nav-item:focus-visible, .sidebar-toggle:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* Topbar and ordinary page surfaces */
.main-content { min-width: 0; }
.topbar { min-height: 66px; padding: 10px clamp(16px, 2vw, 28px); background: #fff; box-shadow: none; }
.topbar-inst-name { color: #0f172a; font-size: .96rem; font-weight: 700; }
.topbar-right { gap: 12px; }
.topbar-role-badge { border-radius: 999px; letter-spacing: .03em; }
.topbar-notif-pill { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; }
.topbar-notif-pill:hover { background: #fef3c7; }
.page-body { max-width: 1288px; padding: 26px 24px 44px; }
.page-header { margin-bottom: 18px; }
.page-title { font-size: clamp(1.28rem, 1.8vw, 1.55rem); }
.card, .form-card, .section-card, .stat-card, .kpi-card {
    border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow-sm); background: #fff;
}
.card { margin-bottom: 20px; }
.card-header { padding: 16px 20px; background: #fff; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; }
.stat-card { min-height: 100px; }
.btn { border-radius: 9px; font-size: .84rem; font-weight: 600; padding: 8px 13px; box-shadow: none; }
.btn-primary { background: #1d4ed8; border-color: #1d4ed8; }
.btn-primary:hover { background: #1e40af; }
.form-label { color: #52647e; font-size: .79rem; font-weight: 600; }
.form-control, .form-select { border: 1px solid #cbd5e1; border-radius: 9px; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.table-responsive { width: 100%; max-width: 100%; overflow-x: auto; }
.table-responsive > .table { width: 100%; min-width: 0; table-layout: auto; }
.table th, .table td { overflow-wrap: break-word; }
.table .btn, .table .badge { max-width: 100%; white-space: normal; }
.table code, .table .font-monospace { white-space: nowrap; }
.table th { background: #f8fafc; color: #52647e; font-size: .75rem; }
.alert { border-radius: 10px; }

/* The same application shell is used by every staff role. */
.sidebar-toggle { display: none; }
.sidebar-backdrop[hidden] { display: none !important; }
.topbar { border-bottom: 1px solid #e2e8f0; }
.topbar .lang-switch { border-radius: 8px; }
.topbar .lang-switch a { border-radius: 6px; }
.topbar-logout-btn { white-space: nowrap; }
.nav-item.active { position: relative; }
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 7px; bottom: 7px;
    width: 3px; border-radius: 0 3px 3px 0; background: #fff;
}
.nav-item:focus-visible, .sidebar-toggle:focus-visible {
    outline: 2px solid #93c5fd; outline-offset: 2px;
}
.table th { border-bottom-color: var(--border); }
.table td { padding: 8px 10px; }
.table tbody tr:hover { background: #f8fafc; }
.btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
    outline: 2px solid #2563eb; outline-offset: 2px;
}

@media (max-width: 1100px) {
    .topbar { flex-wrap: wrap; gap: 8px; }
    .topbar-right { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 960px) {
    .sidebar {
        display: flex; position: fixed; inset: 0 auto 0 0; height: 100dvh;
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: 8px 0 30px rgba(15, 23, 42, .2);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open { overflow: hidden; }
    .sidebar-backdrop {
        position: fixed; inset: 0; z-index: 110; border: 0;
        background: rgba(15, 23, 42, .48); cursor: pointer;
    }
    .sidebar-toggle {
        display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 4px; width: 38px; height: 38px; padding: 0; border: 1px solid #cbd5e1;
        border-radius: 9px; background: #fff; cursor: pointer; flex: none;
    }
    .sidebar-toggle span { display: block; width: 17px; height: 2px; background: #334155; border-radius: 2px; }
    .page-body { max-width: 100%; padding: 20px; }
}
@media (max-width: 640px) {
    .topbar { padding: 10px 14px; }
    .topbar-inst-name { font-size: .82rem; }
    .topbar-right { width: 100%; justify-content: flex-start; gap: 8px; }
    .topbar-user-wrap { margin-left: auto; }
    .page-body { padding: 16px 12px 32px; }
    .card-header, .card-body { padding: 15px; }
}
@media print {
    .sidebar-backdrop, .sidebar-toggle { display: none !important; }
    .page-body { max-width: 100%; padding: 0; }
}

/* Phase 2: TE-02 document body. All data and controls remain in the TE-02 view. */
.te02-page { color: #334155; }
.te02-page .institution-letterhead-card,
.te02-page .card,
.te02-page .te02-header-bar,
.te02-page .workflow-status-panel {
    background: #fff; border: 1px solid #d7e0eb; border-radius: 12px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .07);
}
.te02-page .institution-letterhead-card { margin-bottom: 16px; }
.te02-page .letterhead-admin-toolbar { position: static; display: flex; justify-content: flex-end; padding: 10px 14px 0; }
.te02-page .letterhead-admin-toolbar + .institution-letterhead-content { padding-top: 8px; }
.te02-page .institution-letterhead-content { padding: 17px 22px; gap: 14px 24px; background: #fff; }
.te02-page .institution-letterhead-left { gap: 14px; }
.te02-page .institution-letterhead-seal { width: 50px; height: 50px; box-shadow: none; }
.te02-page .institution-seal-icon { font-size: 1.45rem; }
.te02-page .institution-univ-km { font-family: 'Kantumruy Pro', 'Noto Sans Khmer', sans-serif; font-size: 1.02rem; line-height: 1.45; }
.te02-page .institution-univ-en { font-size: .86rem; letter-spacing: .025em; }
.te02-page .institution-dept-sub { font-size: .68rem; letter-spacing: .025em; }
.te02-page .institution-form-title-badge { padding: 3px 9px; margin-top: 5px; border-radius: 6px; font-size: .7rem; }
.te02-page .institution-doc-meta-box { min-width: 190px; padding: 8px 12px; border-color: #e2e8f0; background: #f8fafc; border-radius: 8px; }
.te02-page .institution-doc-meta-row { gap: 18px; }
.te02-page .institution-meta-label { font-size: .68rem; }
.te02-page .institution-meta-val { font-size: .73rem; }
.te02-page .institution-letterhead-accent-bar { height: 4px; }
.te02-page .institution-letterhead-img-wrapper { max-height: 145px; overflow: hidden; }
.te02-page .institution-letterhead-img { max-height: 145px; object-fit: contain; }

.te02-page .te02-workflow .workflow-status-panel { margin-bottom: 16px !important; padding: 14px 18px !important; }
.te02-page .te02-workflow .workflow-status-panel > div:first-child { margin-bottom: 10px !important; padding-bottom: 10px !important; }
.te02-page .te02-workflow .workflow-status-panel > div:nth-child(2) { gap: 10px !important; }
.te02-page .te02-workflow .workflow-status-panel > div:nth-child(2) > div { padding: 10px 12px !important; border-radius: 8px !important; }

.te02-page .te02-header-bar { align-items: flex-start; gap: 0; padding: 0; margin-bottom: 18px; overflow: hidden; }
.te02-page .te02-header-info { min-width: 260px; padding: 18px 22px 16px; }
.te02-page .te02-header-title-row { gap: 8px; }
.te02-page .te02-page-title { font-size: clamp(1.17rem, 1.5vw, 1.4rem); line-height: 1.3; letter-spacing: -.02em; }
.te02-page .te02-header-meta { margin: 5px 0 0; color: #1e40af; font-size: .82rem; }
.te02-page .te02-header-meta strong { overflow-wrap: anywhere; }
.te02-page .te02-header-actions { justify-content: flex-end; padding: 18px 20px 16px 4px; gap: 7px; }
.te02-page .te02-header-actions .btn { padding: 7px 10px; font-size: .77rem !important; white-space: normal; }
.te02-page .te02-header-actions .btn-outline-secondary,
.te02-page .te02-header-actions .btn-outline-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.te02-page .te02-header-actions .btn-outline-secondary:hover,
.te02-page .te02-header-actions .btn-outline-info:hover { background: #dbeafe; }
.te02-page .te02-header-actions .btn-outline-primary { background: #0f172a; border: 1px solid #0f172a; color: #fff; }
.te02-page .te02-context-strip {
    flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 7px 10px;
    padding: 9px 20px; border-top: 1px solid #e2e8f0; background: #f8fafc;
    color: #475569; font-size: .76rem;
}
.te02-page .te02-context-strip span { max-width: 100%; padding: 4px 9px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; overflow-wrap: anywhere; }
.te02-page .te02-context-strip strong { color: #64748b; font-weight: 600; }

.te02-page .card { margin-bottom: 18px; overflow: hidden; }
.te02-page .card-header { min-height: 54px; padding: 13px 19px; gap: 10px; background: #f8fafc; border-bottom-color: #e2e8f0; }
.te02-page .card-header h3 { color: #1e3a8a; font-size: .98rem; line-height: 1.4; }
.te02-page .te02-section-a > .card-header,
.te02-page .te02-section-b > .card-header,
.te02-page .te02-section-c > .card-header { justify-content: flex-start; }
.te02-page .te02-section-a > .card-header::before,
.te02-page .te02-section-b > .card-header::before,
.te02-page .te02-section-c > .card-header::before {
    display: inline-grid; place-items: center; flex: 0 0 27px;
    width: 27px; height: 27px; border-radius: 7px;
    background: #2563eb; color: #fff; font-size: .8rem; font-weight: 800;
}
.te02-page .te02-section-a > .card-header::before { content: 'A'; }
.te02-page .te02-section-b > .card-header::before { content: 'B'; }
.te02-page .te02-section-c > .card-header::before { content: 'C'; }
.te02-page .card-body { padding: 20px 22px; }
.te02-page .te02-section-a .grid-4,
.te02-page .te02-section-a .grid-3 { gap: 18px 22px; }
.te02-page .te02-section-a .grid-4 > div,
.te02-page .te02-section-a .grid-3 > div { min-width: 0; overflow-wrap: anywhere; }
.te02-page .te02-section-a .form-label { display: block; margin-bottom: 5px; }
.te02-page .form-group { margin-bottom: 18px; }
.te02-page .form-label { color: #475569; line-height: 1.45; }
.te02-page .form-control,
.te02-page .form-select { color: #1e293b; border-color: #cbd5e1; border-radius: 8px; line-height: 1.45; }
.te02-page textarea.form-control { padding: 10px 12px; resize: vertical; }
.te02-page .form-control:focus,
.te02-page .form-select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.te02-page .clo-card.card { margin-bottom: 0; padding: 16px !important; border-color: #dbe5ef !important; border-radius: 10px !important; box-shadow: none; }
.te02-page .clo-card > .d-flex { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.te02-page .clo-card .input-group { display: flex; align-items: stretch; width: 140px; }
.te02-page .clo-card .input-group-text { display: inline-flex; align-items: center; border: 1px solid #cbd5e1; border-radius: 7px 0 0 7px; }
.te02-page .clo-card .clo-num-input { width: 80px; min-width: 0; border-radius: 0 7px 7px 0; }
.te02-page .clo-card .mb-2 { margin-bottom: 12px; }
.te02-page .clo-mappings-section { border-radius: 8px !important; }
.te02-page .clo-mappings-section .add-mapping-btn,
.te02-page #add-clo-row-btn { color: #1d4ed8; border: 1px solid #bfdbfe; background: #eff6ff; }
.te02-page .clo-mappings-section .add-mapping-btn:hover,
.te02-page #add-clo-row-btn:hover { background: #dbeafe; }
.te02-page .clo-mapping-row { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(80px, 110px) minmax(150px, 1.4fr) auto; align-items: center; gap: 8px; }
.te02-page .clo-mapping-row > div { min-width: 0; }
.te02-page .clo-mapping-row .form-control,
.te02-page .clo-mapping-row .form-select { width: 100%; }
.te02-page .clo-card .remove-clo-btn,
.te02-page .clo-card .remove-mapping-btn { color: #b91c1c; border: 1px solid #fecaca; background: #fff; }
.te02-page .clo-card .remove-clo-btn:hover,
.te02-page .clo-card .remove-mapping-btn:hover { background: #fef2f2; }
.te02-page .clo-classification-legend { margin-top: 18px !important; padding: 14px 16px !important; border-style: solid !important; border-radius: 8px !important; }

.te02-page .te02-schedule-card { border-color: #d7e0eb; }
.te02-page .te02-table-title-bar { min-height: 68px; padding: 14px 20px !important; border-radius: 0; }
.te02-page .te02-table-title-bar .te02-title-heading { font-size: 1rem; }
.te02-page .te02-table-title-bar .te02-title-subheading { font-size: .76rem; }
.te02-page .te02-table-title-bar .no-print { flex-wrap: wrap; }
.te02-page .te02-table-title-bar .btn { font-size: .76rem; }
.te02-page .te02-schedule-scroll-container { max-width: 100%; overflow-x: auto; }
.te02-page .te02-schedule-table { min-width: 1850px; border: 0; font-size: .8rem; }
.te02-page .te02-schedule-table thead th {
    padding: 10px 11px; color: #164e78; background: #eff8ff;
    border-color: #dbe9f4; border-bottom: 2px solid #93c5fd;
    font-size: .7rem; line-height: 1.35; white-space: normal;
}
.te02-page .te02-schedule-table tbody td { padding: 7px 8px; border-color: #e2e8f0; }
.te02-page .te02-schedule-table tbody tr:nth-child(even) td { background: #fbfdff; }
.te02-page .te02-schedule-table .form-control,
.te02-page .te02-schedule-table textarea.te02-table-textarea {
    border-radius: 6px;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    resize: none !important;
    max-height: none !important;
    min-height: 42px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.te02-page .te02-schedule-table textarea.te02-table-textarea::-webkit-scrollbar,
.te02-schedule-table textarea.te02-table-textarea::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Fullscreen Section D Syllabus Matrix Mode */
.te02-schedule-card.te02-table-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.te02-schedule-card.te02-table-fullscreen > .card-header {
    flex-shrink: 0;
    border-radius: 0 !important;
    background: #0f172a !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}
.te02-schedule-card.te02-table-fullscreen > .card-header .te02-title-heading {
    color: #ffffff !important;
    font-size: 1.15rem !important;
}
.te02-schedule-card.te02-table-fullscreen > .card-header .te02-title-subheading {
    color: #94a3b8 !important;
}
.te02-schedule-card.te02-table-fullscreen > .card-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 16px 24px 32px !important;
    background: #f8fafc !important;
}
.te02-schedule-card.te02-table-fullscreen #te02-fullscreen-btn {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
    font-weight: 700 !important;
}
.te02-page .te02-spreadsheet-footer { padding: 13px 18px; gap: 14px; background: #f8fafc; }
.te02-page .te02-section-gh .form-group + .form-group { padding-top: 18px; border-top: 1px solid #e2e8f0; }
.te02-page .te02-section-gh .form-label { display: block; margin-bottom: 8px; color: #1e3a8a; font-size: .96rem; }
.te02-page .te02-final-actions {
    display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px;
    padding: 16px 20px; margin-bottom: 28px; border: 1px solid #d7e0eb;
    border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(15, 23, 42, .07);
}
.te02-page .te02-final-actions .btn { min-width: 125px; }
.te02-page .te02-report-footer { margin-top: 18px !important; }

@media (max-width: 1100px) {
    .te02-page .te02-header-actions { justify-content: flex-start; padding: 0 22px 16px; }
    .te02-page .te02-header-info { flex: 0 0 100%; }
}
@media (max-width: 640px) {
    .te02-page .institution-letterhead-content { padding: 18px 16px; }
    .te02-page .institution-letterhead-left { min-width: 0; }
    .te02-page .institution-letterhead-right { width: 100%; }
    .te02-page .institution-doc-meta-box { width: 100%; }
    .te02-page .te02-workflow .workflow-status-panel { padding: 13px !important; }
    .te02-page .te02-header-info { padding: 16px; }
    .te02-page .te02-header-actions { padding: 0 16px 16px; }
    .te02-page .te02-context-strip { padding: 9px 16px; }
    .te02-page .card-header, .te02-page .card-body { padding: 16px; }
    .te02-page .te02-section-a .grid-4, .te02-page .te02-section-a .grid-3 { grid-template-columns: 1fr; }
    .te02-page .clo-mapping-row { grid-template-columns: 1fr 1fr; }
    .te02-page .clo-mapping-row > div:first-child,
    .te02-page .clo-mapping-row > div:nth-child(3) { grid-column: 1 / -1; }
    .te02-page .te02-table-title-bar { padding: 15px 16px !important; }
    .te02-page .te02-final-actions .btn { width: 100%; }
}
@media print {
    .te02-page .institution-letterhead-img-wrapper,
    .te02-page .institution-letterhead-img { max-height: none; }
    .te02-page .institution-letterhead-card,
    .te02-page .card,
    .te02-page .te02-header-bar,
    .te02-page .workflow-status-panel { box-shadow: none !important; }
    .te02-page .te02-final-actions { display: none !important; }
}

/* Phase 3: academic administration surfaces, scoped to existing page markup. */
.academic-master-data-page, .course-offerings-page { width: 100%; min-width: 0; color: #334155; }
.academic-master-data-heading, .course-offerings-heading { align-items: flex-end !important; gap: 16px; }
.academic-master-data-heading h1, .course-offerings-heading h1 { color: #0f172a; font-size: clamp(1.3rem, 1.8vw, 1.65rem) !important; line-height: 1.35; }
.academic-master-data-heading p, .course-offerings-heading p { max-width: 780px; line-height: 1.6; }
.academic-master-data-page .academic-master-data-tabs { gap: 6px !important; overflow-x: auto; flex-wrap: nowrap !important; padding: 0 0 8px !important; border-bottom: 1px solid #dbe3ed !important; scrollbar-width: thin; }
.academic-master-data-page .academic-master-data-tabs a { flex: 0 0 auto; border: 1px solid #dbe3ed; border-radius: 8px !important; padding: 8px 12px !important; color: #475569; background: #fff !important; font-size: .8rem !important; line-height: 1.4; }
.academic-master-data-page .academic-master-data-tabs a:hover { color: #1d4ed8; border-color: #93c5fd; background: #eff6ff !important; }
.academic-master-data-page .academic-master-data-tabs a[style*="background: #2563eb"] { color: #fff; border-color: #1d4ed8; background: #1d4ed8 !important; }
.academic-master-data-card, .academic-master-data-form-card, .course-offerings-page .card { border: 1px solid #d7e0eb !important; border-radius: 12px; box-shadow: 0 2px 8px rgba(15,23,42,.05); background: #fff; }
.academic-master-data-card { overflow: hidden; }
.academic-master-data-card > div { max-width: 100%; overflow-x: auto; }
.academic-master-data-card table { width: 100%; min-width: 0; border-collapse: separate !important; border-spacing: 0; }
.academic-master-data-card th, .academic-master-data-card td { padding: 12px 15px !important; border-bottom: 1px solid #e8edf3; vertical-align: middle; }
.academic-master-data-card th { position: sticky; top: 0; z-index: 1; background: #f8fafc !important; color: #52647e !important; font-size: .74rem; letter-spacing: .025em; }
.academic-master-data-card tbody tr:hover { background: #f8fbff; }
.academic-master-data-page .btn, .course-offerings-page .btn { border-radius: 8px; font-weight: 600; }
.academic-master-data-form { width: min(100%, 900px); }
.academic-master-data-form-card { padding: 24px !important; }
.academic-master-data-form-card h3 { color: #1e3a8a !important; }
.academic-master-data-form-card label { line-height: 1.5; }
.academic-master-data-form-card input, .academic-master-data-form-card select, .academic-master-data-form-card textarea { max-width: 100%; }
.course-offerings-page .card-header { gap: 12px; min-height: 54px; border-bottom: 1px solid #e8edf3; border-radius: 12px 12px 0 0; }
.course-offerings-page .card-header h3 { color: #1e3a8a; font-size: .97rem; line-height: 1.45; }
.course-offerings-create-card { border-left: 4px solid #2563eb !important; }
.course-offerings-create-card .card-body { padding: 20px; }
.course-offerings-create-card .grid-4, .course-offerings-create-card .grid-2 { gap: 16px; }
.course-offerings-create-card .form-group { min-width: 0; }
.course-offerings-create-card input, .course-offerings-create-card select { min-width: 0; width: 100%; }
.course-offerings-create-card .grid-4[style*="background"] { gap: 12px; border-color: #dbe5ef !important; border-radius: 9px !important; }
.course-offerings-list-card .card-body { padding: 16px 20px 20px; }
.course-offerings-page .table { width: 100%; min-width: 0; table-layout: fixed; }
.course-offerings-page .table th, .course-offerings-page .table td { padding: 8px 9px; vertical-align: middle; }
.course-offerings-page .course-offerings-table th:nth-child(1) { width: 5%; }
.course-offerings-page .course-offerings-table th:nth-child(2) { width: 16%; }
.course-offerings-page .course-offerings-table th:nth-child(3) { width: 14%; }
.course-offerings-page .course-offerings-table th:nth-child(4) { width: 7%; }
.course-offerings-page .course-offerings-table th:nth-child(5) { width: 7%; }
.course-offerings-page .course-offerings-table th:nth-child(6) { width: 10%; }
.course-offerings-page .course-offerings-table th:nth-child(7) { width: 13%; }
.course-offerings-page .course-offerings-table th:nth-child(8) { width: 6%; }
.course-offerings-page .course-offerings-table th:nth-child(9) { width: 8%; }
.course-offerings-page .course-offerings-table th:nth-child(10) { width: 14%; }
.course-offerings-page .course-offerings-actions { min-width: 112px; }
.course-offerings-page .badge { border-radius: 999px; padding: 5px 9px; font-weight: 600; }
.course-offerings-page .alert { line-height: 1.55; }

/* Evaluation Cycles stays tabular on desktop and becomes labeled records on small screens. */
.evaluation-cycles-table { width: 100%; min-width: 0; table-layout: fixed; }
.evaluation-cycles-table th:nth-child(1) { width: 12%; }
.evaluation-cycles-table th:nth-child(2) { width: 13%; }
.evaluation-cycles-table th:nth-child(3) { width: 15%; }
.evaluation-cycles-table th:nth-child(4) { width: 20%; }
.evaluation-cycles-table th:nth-child(5) { width: 11%; }
.evaluation-cycles-table th:nth-child(6) { width: 9%; }
.evaluation-cycles-table th:nth-child(7) { width: 10%; }
.evaluation-cycles-table th:nth-child(8) { width: 10%; }
.evaluation-cycles-table td { vertical-align: middle; }

/* Phase 4: Teacher workspace and personal Course Plan drafts. */
.teacher-workspace { width: min(100%, 1180px); margin: 0 auto; color: #334155; }
.teacher-workspace h1, .teacher-workspace h2, .teacher-workspace h3 { color: #17366f; }
.teacher-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.teacher-page-heading h1 { margin: 4px 0 5px; color: #17366f; font-size: clamp(1.55rem, 2vw, 1.9rem); line-height: 1.3; font-weight: 750; }
.teacher-page-heading p { margin: 0; max-width: 720px; color: #64748b; line-height: 1.65; }
.teacher-eyebrow { color: #2563eb; font-size: .68rem; font-weight: 750; letter-spacing: .11em; }
.teacher-guidance { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 20px; padding: 15px 17px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; color: #1e3a8a; line-height: 1.65; }
.teacher-guidance-icon { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.teacher-guidance strong { display: block; margin: 0 0 2px; color: #1e3a8a; }
.teacher-guidance p { margin: 0; color: #475569; }
.teacher-empty-state { display: grid; justify-items: center; padding: clamp(28px, 6vw, 58px) 22px; text-align: center; }
.teacher-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 0 14px; border-radius: 15px; background: #eff6ff; color: #2563eb; font-size: 1.45rem; }
.teacher-empty-state h2 { margin: 0 0 8px; font-size: 1.16rem; }
.teacher-empty-state p { margin: 0 0 18px; color: #64748b; line-height: 1.6; }
.teacher-plan-list { display: grid; gap: 12px; }
.teacher-plan-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; padding: 20px 22px; }
.teacher-plan-card-main { min-width: 0; flex: 1; }
.teacher-plan-card-topline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 9px; }
.teacher-status { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: 5px 10px; border: 1px solid transparent; border-radius: 999px; font-size: .74rem; font-weight: 650; line-height: 1.35; text-decoration: none; white-space: normal; }
.teacher-status-draft { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }
.teacher-status-pending { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
.teacher-status-complete { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.teacher-plan-updated { color: #64748b; font-size: .78rem; }
.teacher-plan-card h2 { margin: 0 0 7px; overflow-wrap: anywhere; font-size: 1.08rem; line-height: 1.5; }
.teacher-plan-course { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0; color: #475569; line-height: 1.55; }
.teacher-course-code { color: #1d4ed8; font-weight: 750; }
.teacher-plan-open { flex: none; white-space: nowrap; }
.teacher-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 16px; color: #64748b; font-size: .82rem; }
.teacher-breadcrumb a { color: #1d4ed8; text-decoration: none; }
.teacher-breadcrumb a:hover { text-decoration: underline; }
.teacher-form-heading { align-items: center; }
.teacher-form-section { overflow: hidden; margin: 0 0 18px; }
.teacher-section-heading { display: flex; align-items: flex-start; gap: 12px; padding: 17px 20px; border-bottom: 1px solid #e8edf3; background: #fff; }
.teacher-section-heading h2 { margin: 0 0 3px; font-size: 1rem; line-height: 1.45; }
.teacher-section-heading p { margin: 0; color: #64748b; font-size: .82rem; font-weight: 400; line-height: 1.55; }
.teacher-cycle-section > .teacher-section-heading { justify-content: flex-start; text-align: left; }
.teacher-section-number { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; background: #eff6ff; color: #1d4ed8; font-size: .75rem; font-weight: 750; }
.teacher-plan-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.teacher-plan-meta-grid .form-group, .teacher-session-field { min-width: 0; margin: 0; }
.teacher-plan-meta-grid .form-control, .teacher-session-field .form-control { width: 100%; min-width: 0; }
.teacher-field-help { display: block; margin-top: 6px; color: #64748b; font-size: .76rem; line-height: 1.5; }
.teacher-sessions-heading { justify-content: space-between; align-items: center; gap: 18px; }
.teacher-section-title { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.teacher-session-list { display: grid; gap: 14px; }
.teacher-session-card { min-width: 0; padding: 18px; border: 1px solid #dbe3ed; border-radius: 12px; background: #fbfdff; }
.teacher-session-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 1px solid #e2e8f0; }
.teacher-session-card-heading h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: .94rem; }
.teacher-session-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-size: .75rem; font-weight: 750; }
.teacher-session-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.teacher-session-group-title { grid-column: 1 / -1; margin: 5px 0 -5px; padding: 0 0 6px; border-bottom: 1px solid #e8edf3; color: #475569; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.teacher-session-field-session_week, .teacher-session-field-contact_hours { grid-column: span 1; }
.teacher-session-field-lecture_topics, .teacher-session-field-assessment_weightage, .teacher-session-field-tl_resources { grid-column: 1 / -1; }
.teacher-session-field textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
.teacher-form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 0; padding: 13px 0; border-top: 1px solid #d7e0eb; background: rgba(248,250,252,.96); backdrop-filter: blur(8px); }
.teacher-save-draft { min-width: 160px; }
.teacher-dashboard-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 20px; }
.teacher-summary-card { display: flex; align-items: center; gap: 13px; min-width: 0; margin: 0; padding: 16px 18px; }
.teacher-summary-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; font-size: 1.15rem; }
.teacher-icon-blue { background: #eff6ff; color: #2563eb; }
.teacher-icon-indigo { background: #eef2ff; color: #4f46e5; }
.teacher-summary-card > div { display: grid; gap: 3px; min-width: 0; }
.teacher-summary-card > div > span { color: #64748b; font-size: .78rem; }
.teacher-summary-card strong { color: #17366f; font-size: 1.12rem; }
.teacher-summary-link { margin-left: auto; color: #1d4ed8; font-weight: 650; text-decoration: none; }
.teacher-cycle-section { overflow: hidden; }
.teacher-cycle-section > .card-header { border-bottom: 1px solid #e8edf3; }
.teacher-cycle-list { display: grid; gap: 12px; }
.teacher-cycle-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(160px, .85fr) auto; align-items: center; gap: 18px; padding: 16px; border: 1px solid #dbe3ed; border-radius: 11px; background: #fff; }
.teacher-cycle-main { min-width: 0; }
.teacher-cycle-code { color: #1d4ed8; white-space: nowrap; }
.teacher-cycle-main h3 { margin: 5px 0 3px; font-size: .96rem; line-height: 1.45; overflow-wrap: anywhere; }
.teacher-cycle-main p { margin: 0; color: #64748b; font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }
.teacher-cycle-main .teacher-cycle-hours { margin-top: 7px; color: #334155; }
.teacher-cycle-statuses { display: flex; flex-wrap: wrap; gap: 7px 12px; min-width: 0; }
.teacher-cycle-statuses > div { display: grid; gap: 4px; justify-items: start; }
.teacher-cycle-statuses > div > span:first-child { color: #64748b; font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.teacher-cycle-action { white-space: nowrap; }
.teacher-course-name, .teacher-muted-line { display: block; margin-top: 3px; color: #64748b; font-size: .78rem; line-height: 1.45; }
.teacher-empty-inline { display: flex; align-items: flex-start; gap: 16px; padding: 8px; }
.teacher-empty-inline .teacher-empty-icon { flex: 0 0 52px; }
.teacher-empty-inline h3 { margin: 1px 0 5px; font-size: 1rem; }
.teacher-empty-inline p { margin: 0 0 14px; color: #64748b; line-height: 1.55; }
@media (max-width: 760px) {
    .academic-master-data-heading, .course-offerings-heading { align-items: flex-start !important; flex-direction: column; }
    .academic-master-data-heading > div:last-child { width: 100%; }
    .academic-master-data-heading #btn-add-master-item { width: 100%; justify-content: center; }
    .academic-master-data-form { max-width: 100% !important; }
    .academic-master-data-form-card { padding: 18px !important; }
    .course-offerings-create-card .grid-4, .course-offerings-create-card .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .course-offerings-create-card .grid-4, .course-offerings-create-card .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .course-offerings-create-card .card-body, .course-offerings-list-card .card-body { padding: 14px; }
    .academic-master-data-card table { min-width: 0; }
}
@media (max-width: 640px) {
    .teacher-page-heading { align-items: stretch; flex-direction: column; gap: 14px; }
    .teacher-page-heading > .btn { justify-content: center; width: 100%; }
    .teacher-page-heading h1 { font-size: 1.48rem; }
    .teacher-guidance { padding: 13px; }
    .teacher-plan-card { align-items: stretch; flex-direction: column; gap: 14px; padding: 17px; }
    .teacher-plan-open { display: flex; justify-content: center; width: 100%; }
    .teacher-form-heading { align-items: flex-start; }
    .teacher-form-heading > .teacher-status { align-self: flex-start; }
    .teacher-plan-meta-grid, .teacher-dashboard-summary { grid-template-columns: minmax(0, 1fr); gap: 13px; }
    .teacher-section-heading { padding: 15px; }
    .teacher-section-heading p { font-size: .78rem; }
    .teacher-sessions-heading { align-items: stretch; flex-direction: column; }
    .teacher-sessions-heading > .btn { width: 100%; justify-content: center; }
    .teacher-session-card { padding: 14px; }
    .teacher-session-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .teacher-session-field-lecture_topics, .teacher-session-field-assessment_weightage, .teacher-session-field-tl_resources { grid-column: auto; }
    .teacher-session-card-heading { align-items: flex-start; }
    .teacher-session-card-heading .btn { flex: none; }
    .teacher-cycle-card { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px; }
    .teacher-cycle-action { width: 100%; justify-content: center; }
    .teacher-form-actions { margin: 0 -12px; padding: 12px; }
    .teacher-form-actions > .btn { flex: 1 1 100%; justify-content: center; }
    .teacher-save-draft { order: -1; }
    .teacher-empty-inline { flex-direction: column; }
    .teacher-empty-inline .btn { width: 100%; justify-content: center; }
}
@media (max-width: 760px) {
    .evaluation-cycles-table thead { display: none; }
    .evaluation-cycles-table,
    .evaluation-cycles-table tbody,
    .evaluation-cycles-table tr,
    .evaluation-cycles-table td { display: block; width: 100%; }
    .evaluation-cycles-table { table-layout: auto; }
    .evaluation-cycles-table tbody { display: grid; gap: 12px; }
    .evaluation-cycles-table tr { overflow: hidden; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; }
    .evaluation-cycles-table td { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); align-items: start; gap: 10px; padding: 9px 11px; border-bottom: 1px solid #edf1f5; overflow-wrap: anywhere; }
    .evaluation-cycles-table td::before { content: attr(data-label); color: #64748b; font-size: .75rem; font-weight: 700; line-height: 1.4; }
    .evaluation-cycles-table td:last-child { border-bottom: 0; }
    .evaluation-cycles-table td .btn { width: fit-content; max-width: 100%; }
    .course-offerings-page .course-offerings-table thead { display: none; }
    .course-offerings-page .course-offerings-table,
    .course-offerings-page .course-offerings-table tbody,
    .course-offerings-page .course-offerings-table tr,
    .course-offerings-page .course-offerings-table td { display: block; width: 100%; }
    .course-offerings-page .course-offerings-table { min-width: 0; table-layout: auto; }
    .course-offerings-page .course-offerings-table tbody { display: grid; gap: 12px; }
    .course-offerings-page .course-offerings-table tr { overflow: hidden; border: 1px solid #dbe3ed; border-radius: 10px; }
    .course-offerings-page .course-offerings-table td { display: grid; grid-template-columns: minmax(92px, 34%) minmax(0, 1fr); gap: 10px; padding: 9px 11px; border-bottom: 1px solid #edf1f5; overflow-wrap: anywhere; }
    .course-offerings-page .course-offerings-table td::before { content: attr(data-label); color: #64748b; font-size: .75rem; font-weight: 700; }
    .course-offerings-page .course-offerings-table td[colspan] { display: block; text-align: center; }
    .course-offerings-page .course-offerings-table td[colspan]::before { display: none; }
    .course-offerings-page .course-offerings-table td:last-child { border-bottom: 0; }
    .course-offerings-page .course-offerings-table .course-offerings-actions { min-width: 0; }
    .course-offerings-page .course-offerings-table .course-offerings-actions button { max-width: 100%; white-space: normal !important; }
}

/* ==========================================================================
   ACADEMIC PRESTIGE DESIGN SUITE — Comprehensive Component System
   ========================================================================== */

/* 1. Global Elevation, Cards & Surfaces */
.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
    border-color: #cbd5e1;
}
.card-header {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h2, .card-header h3, .card-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}
.card-body {
    padding: 22px;
}
.card-footer {
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    padding: 14px 22px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 2. Key Performance Indicator (KPI) Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
}
.kpi-card.kpi-primary::before { background: var(--primary); }
.kpi-card.kpi-gold::before { background: var(--accent-gold); }
.kpi-card.kpi-success::before { background: var(--success); }
.kpi-card.kpi-warning::before { background: var(--warning); }
.kpi-card.kpi-purple::before { background: var(--purple); }
.kpi-card.kpi-info::before { background: var(--info); }
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-pop);
}
.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.kpi-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.kpi-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    line-height: 1;
    background: #f1f5f9;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.85);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    flex-shrink: 0;
}
.kpi-card.kpi-primary .kpi-icon-badge {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #1e40af !important;
    border-color: #bfdbfe !important;
}
.kpi-card.kpi-purple .kpi-icon-badge {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%) !important;
    color: #6d28d9 !important;
    border-color: #ddd6fe !important;
}
.kpi-card.kpi-success .kpi-icon-badge {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
}
.kpi-card.kpi-gold .kpi-icon-badge {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%) !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}
.kpi-card.kpi-warning .kpi-icon-badge {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}
.kpi-card:hover .kpi-icon-badge {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}
.kpi-val {
    font-size: 1.85rem;
    font-weight: 800;
    font-family: var(--font-display);
    color: var(--text-heading);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}
.kpi-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 3. Academic Badge Suite */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 650;
    border-radius: 999px;
    line-height: 1.35;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}
.badge-primary {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}
.badge-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}
.badge-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.badge-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.badge-info {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}
.badge-purple {
    background: #f5f3ff;
    color: #6b21a8;
    border-color: #ddd6fe;
}
.badge-gold {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* 4. Academic Button Suite */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font-latin);
    font-weight: 600;
    font-size: 0.84rem;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    line-height: 1.35;
    white-space: nowrap;
}
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.18);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.25);
    transform: translateY(-1px);
}
.btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a !important;
}
.btn-gold {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(180, 83, 9, 0.2);
}
.btn-gold:hover {
    background: #92400e;
    border-color: #92400e;
    color: #ffffff !important;
    transform: translateY(-1px);
}
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff !important;
}
.btn-success:hover {
    background: #047857;
    border-color: #047857;
    color: #ffffff !important;
}
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff !important;
}
.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff !important;
}
.btn-outline-primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af !important;
}
.btn-outline-primary:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8 !important;
}
.btn-outline-gold {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e !important;
}
.btn-outline-gold:hover {
    background: #fde68a;
    color: #78350f !important;
}
.btn-sm {
    padding: 6px 11px;
    font-size: 0.77rem;
    border-radius: 6px;
}
.btn-lg {
    padding: 12px 22px;
    font-size: 0.95rem;
    border-radius: 10px;
}

/* 5. Modern Desktop Tables */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}
.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
    border-top: 0;
    white-space: nowrap;
    vertical-align: middle;
}
.table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
    color: var(--text-body);
    font-size: 0.86rem;
    line-height: 1.45;
}
.table tbody tr:hover td {
    background-color: #f8fbff;
}
.table tbody tr:last-child td {
    border-bottom: 0;
}
.table-nums {
    font-variant-numeric: tabular-nums;
}

/* 6. Form Controls & Inputs */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 650;
    color: #334155;
    line-height: 1.4;
}
.form-control, .form-select {
    width: 100%;
    padding: 9px 13px;
    font-size: 0.88rem;
    font-family: inherit;
    color: #0f172a;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.45;
}
.form-control:focus, .form-select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.form-text {
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 5px;
    line-height: 1.45;
}

/* 7. Institutional Letterhead Header & Banner */
.institution-banner-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #d7e0eb;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 22px 26px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}
.institution-brand-group {
    display: flex;
    align-items: center;
    gap: 16px;
}
.institution-brand-seal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.08);
}
.institution-brand-text h1, .institution-brand-text h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 750;
    line-height: 1.3;
}
.institution-brand-text p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
}

/* 8. 5-Phase Milestone Stepper Component */
.milestone-stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-card);
}
.milestone-phase {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}
.milestone-phase.phase-active {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.08);
}
.milestone-phase.phase-completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.milestone-phase-num {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}
.milestone-phase.phase-active .milestone-phase-num { color: #1e40af; }
.milestone-phase.phase-completed .milestone-phase-num { color: #15803d; }
.milestone-phase-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 6px;
}
.milestone-phase-status {
    margin-top: auto;
    font-size: 0.72rem;
    font-weight: 650;
    color: #64748b;
}

@media (max-width: 860px) {
    .milestone-stepper {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .milestone-phase {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* =========================================================================
   Academic Prestige: Workflow Tracker & Status Panels
   ========================================================================= */
.workflow-tracker-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-card) !important;
    padding: 22px 24px !important;
    margin-bottom: 24px !important;
}
.tracker-header {
    padding-bottom: 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
.tracker-module-badge {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2) !important;
    border-radius: 6px !important;
    font-weight: 750 !important;
}
.tracker-step.step-completed .step-marker {
    background: #059669 !important;
    box-shadow: 0 0 0 4px #d1fae5 !important;
}
.tracker-step.step-current .step-marker {
    background: #1e3a8a !important;
    box-shadow: 0 0 0 4px #dbeafe !important;
}
.workflow-status-panel {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-card) !important;
    background: #ffffff !important;
}
.step-number-badge {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 800;
    font-size: 0.8rem;
    border: 1px solid #bfdbfe;
    font-variant-numeric: tabular-nums;
}

/* =========================================================================
   STUDENT SURVEY & INSTRUMENT PRESTIGE STYLING (TE-03 through TE-08)
   ========================================================================= */
.student-survey-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 16px 50px;
}

.student-survey-header-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-top: 4px solid #1e3a8a !important;
    border-radius: 14px !important;
    padding: 28px 32px !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05) !important;
    margin-bottom: 24px !important;
}

.student-survey-title {
    font-family: 'Inter', 'Kantumruy Pro', sans-serif !important;
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1.35 !important;
    margin: 4px 0 8px !important;
}

.student-survey-subtitle {
    font-size: 0.94rem !important;
    color: #475569 !important;
    line-height: 1.62 !important;
    margin-bottom: 20px !important;
}

.student-survey-meta-grid {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 16px 20px !important;
    gap: 16px !important;
}

.student-survey-meta-label {
    font-size: 0.72rem !important;
    font-weight: 750 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #64748b !important;
}

.student-survey-meta-val {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.student-survey-notice {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 12px !important;
    padding: 18px 22px !important;
    margin-bottom: 22px !important;
}

.student-survey-notice.notice-formative {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
}

.survey-progress-card {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 14px 22px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08) !important;
}

.survey-domain-header {
    background: #f1f5f9 !important;
    border-left: 4px solid #1e3a8a !important;
    border-radius: 0 10px 10px 0 !important;
    padding: 14px 20px !important;
    margin-bottom: 16px !important;
}

.survey-domain-title {
    font-size: 1.1rem !important;
    font-weight: 750 !important;
    color: #1e3a8a !important;
}

.survey-question-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 22px 24px !important;
    margin-bottom: 18px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.survey-question-card:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07) !important;
}

.survey-question-num-badge {
    background: #eff6ff !important;
    color: #1e3a8a !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums !important;
}

.student-survey-scale-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px 6px !important;
    transition: background 0.15s ease, border-color 0.15s ease !important;
}

.student-survey-scale-num {
    color: #1e3a8a !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums !important;
}

/* Formal Reports Styling */
.report-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 12px 16px 40px;
}

.report-header-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%) !important;
    color: #ffffff !important;
    border-radius: 14px !important;
    padding: 28px 32px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
    position: relative !important;
    overflow: hidden !important;
}

.report-header-card::after {
    content: "OFFICIAL IQA DOCUMENT";
    position: absolute;
    right: 25px;
    bottom: -15px;
    font-size: 3.2rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.035);
    pointer-events: none;
    user-select: none;
}

.report-doc-code {
    font-size: 0.78rem !important;
    font-weight: 750 !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    color: #93c5fd !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
}

.report-title-lg {
    font-size: 1.68rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin: 6px 0 8px !important;
    letter-spacing: -0.02em !important;
}

.report-subtitle {
    font-size: 0.94rem !important;
    color: #cbd5e1 !important;
    line-height: 1.55 !important;
}

.slip-card {
    border: 1.5px dashed #94a3b8 !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    padding: 18px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.tab-btn {
    padding: 9px 18px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #334155 !important;
    border-radius: 8px !important;
    font-weight: 650 !important;
    font-size: 0.88rem !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.tab-btn.active {
    background: #1e3a8a !important;
    border-color: #1e3a8a !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25) !important;
}

/* Teacher Dashboard Responsive Cycle Row */
.teacher-cycle-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr) auto !important;
    align-items: center !important;
    gap: 20px !important;
}

@media (max-width: 900px) {
    .teacher-cycle-row {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}
