/* ==========================================================================
   University Teacher Evaluation System (IQA) — Master Design System
   Modern, Accessible, Bilingual (English & Khmer), Print-Ready
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Khmer:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Color Palette — Deep University Royal & Slate */
    --primary: #1e40af;            /* Royal Navy */
    --primary-hover: #1d4ed8;
    --primary-active: #172554;
    --primary-subtle: #eff6ff;
    --primary-border: #bfdbfe;

    --brand-dark: #0f172a;         /* Deep Slate */
    --brand-navy: #1e3a8a;
    
    --secondary: #475569;          /* Slate */
    --secondary-hover: #334155;
    --secondary-subtle: #f8fafc;
    --secondary-border: #e2e8f0;

    /* Semantic Status Colors */
    --success: #059669;            /* Emerald */
    --success-subtle: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;

    --warning: #d97706;            /* Amber */
    --warning-subtle: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;

    --danger: #dc2626;             /* Crimson */
    --danger-subtle: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;

    --info: #0284c7;               /* Sky */
    --info-subtle: #f0f9ff;
    --info-border: #bae6fd;
    --info-text: #0369a1;

    --purple: #7c3aed;
    --purple-subtle: #f5f3ff;
    --purple-border: #ddd6fe;

    /* Backgrounds & Surfaces */
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-sidebar: #0f172a;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;

    /* Text Colors */
    --text-main: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Geometry & Depth */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans Khmer', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-body);
    line-height: 1.6;
    font-size: 0.95rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.65rem; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ==========================================================================
   Main Application Layout (Sidebar + Topbar + Page Body)
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    min-width: 0;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.6);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.badge-tag {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    padding: 18px 14px;
    overflow-y: auto;
    flex: 1;
}

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 16px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 3px;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff !important;
    transform: translateX(2px);
}

.nav-item.active {
    background: #2563eb;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.nav-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.nav-content {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.nav-title {
    font-weight: 500;
    font-size: 0.88rem;
    white-space: normal;
}

.nav-code {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.nav-item.active .nav-code {
    color: rgba(255, 255, 255, 0.82);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 0;
    z-index: 100;
    min-width: 0;
    box-sizing: border-box;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-inst-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.05rem;
    line-height: 1.3;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.topbar-role-badge {
    flex-shrink: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.topbar-notif-wrap {
    position: relative;
    flex-shrink: 0;
}

.topbar-notif-pill {
    font-size: 0.9rem;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    color: #334155;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.topbar-notif-pill:hover {
    background: #e2e8f0;
}

.topbar-notif-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    z-index: 1000;
}

.topbar-notif-wrap:hover .topbar-notif-dropdown,
.topbar-notif-wrap:focus-within .topbar-notif-dropdown,
.topbar-notif-dropdown.show {
    display: block;
}

.topbar-notif-header {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-notif-list {
    max-height: 360px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.topbar-notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
    line-height: 1.4;
    transition: background 0.15s ease;
}

.topbar-notif-item:hover {
    background: #f8fafc;
}

.topbar-notif-item-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 3px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.topbar-notif-item-title span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.topbar-notif-item-title .unread-dot {
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    margin-top: 5px;
}

.topbar-notif-item-msg {
    color: #475569;
    margin-bottom: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.45;
}

.topbar-notif-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 0.75rem;
    color: #94a3b8;
    min-width: 0;
}

.topbar-notif-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
}

.topbar-user-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-user-info {
    text-align: right;
    line-height: 1.2;
    min-width: 0;
}

.topbar-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.topbar-user-email {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.topbar-logout-form {
    margin: 0;
    flex-shrink: 0;
}

.topbar-logout-btn {
    white-space: nowrap;
}

.lang-switch {
    display: flex;
    background-color: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.lang-switch a {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary) !important;
    text-decoration: none !important;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.lang-switch a.active {
    background: #ffffff;
    color: var(--primary) !important;
    box-shadow: var(--shadow-xs);
}

/* Responsive Topbar */
@media (max-width: 768px) {
    .topbar {
        padding: 10px 16px;
        gap: 12px;
    }
    .topbar-inst-name {
        font-size: 0.95rem;
    }
    .topbar-user-name,
    .topbar-user-email {
        max-width: 140px;
    }
    .page-body {
        padding: 20px 16px;
    }
}

@media (max-width: 600px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 14px;
        min-width: 0;
    }

    .topbar-left {
        width: 100%;
        min-width: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .topbar-left > * {
        min-width: 0;
    }

    .topbar-inst-name {
        font-size: 0.88rem;
        font-weight: 600;
        line-height: 1.25;
        flex: 1;
        min-width: 0;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .topbar-role-badge {
        font-size: 0.68rem;
        padding: 3px 8px;
        flex-shrink: 0;
        align-self: center;
    }

    .topbar-right {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px 8px;
    }

    .lang-switch {
        padding: 2px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .lang-switch a {
        padding: 4px 8px;
        font-size: 0.75rem;
        border-radius: 5px;
    }

    .topbar-notif-pill {
        font-size: 0.78rem;
        padding: 3px 8px;
        border-radius: 16px;
    }

    .topbar-notif-wrap {
        position: static;
    }

    .topbar-notif-dropdown {
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc(100% + 6px);
        width: auto;
        max-width: none;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
        z-index: 1050;
    }

    .topbar-notif-list {
        max-height: 60vh;
    }

    .topbar-user-wrap {
        gap: 8px;
        min-width: 0;
        flex-shrink: 1;
    }

    .topbar-user-info {
        text-align: right;
        min-width: 0;
        line-height: 1.15;
    }

    .topbar-user-name {
        font-size: 0.8rem;
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-user-email {
        font-size: 0.68rem;
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-logout-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

@media (max-width: 390px) {
    .topbar {
        padding: 8px 10px;
        gap: 6px;
    }

    .topbar-inst-name {
        font-size: 0.82rem;
        line-height: 1.2;
    }

    .topbar-role-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .topbar-right {
        gap: 4px 6px;
    }

    .lang-switch a {
        padding: 3px 6px;
        font-size: 0.72rem;
    }

    .topbar-notif-pill {
        font-size: 0.74rem;
        padding: 2px 6px;
    }

    .topbar-notif-dropdown {
        left: 10px;
        right: 10px;
    }

    .topbar-user-wrap {
        gap: 6px;
    }

    .topbar-user-name {
        font-size: 0.75rem;
        max-width: 90px;
    }

    .topbar-user-email {
        font-size: 0.65rem;
        max-width: 90px;
    }

    .topbar-logout-btn {
        padding: 3px 6px;
        font-size: 0.72rem;
    }

    .page-body {
        padding: 12px 8px;
    }
}

/* Student Header Language Switcher Overrides */
.student-header .lang-switch {
    display: inline-flex;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.student-header .lang-switch a {
    color: #334155 !important;
    background: #f8fafc !important;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
}

.student-header .lang-switch a:hover:not(.active) {
    color: #0f172a !important;
    background: #ffffff !important;
}

.student-header .lang-switch a.active {
    background: #1e40af !important;
    background-color: #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.3);
    font-weight: 700;
}


.page-body {
    padding: 30px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   Cards & Content Containers
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.card-header h2, .card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    background: var(--secondary-subtle);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 960px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}

/* Page Header Standard */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.page-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Metric Grid & KPI Cards (Dashboard) */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    border-left: 4px solid #cbd5e1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.stat-card.stat-primary { border-left-color: var(--primary); }
.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-warning { border-left-color: var(--warning); }
.stat-card.stat-danger  { border-left-color: var(--danger); }
.stat-card.stat-info    { border-left-color: var(--info); }
.stat-card.stat-purple  { border-left-color: var(--purple); }
.stat-card.stat-secondary { border-left-color: var(--secondary); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.stat-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    display: block;
    line-height: 1.25;
}

.stat-icon {
    font-size: 1.15rem;
    line-height: 1;
    margin-left: 8px;
    opacity: 0.85;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 4px;
    display: block;
}

.stat-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.3;
    display: block;
}

/* ==========================================================================
   Central Institutional Letterhead & Academic Schedule Table
   ========================================================================== */
.te02-letterhead-card,
.institution-letterhead-card,
.official-letterhead-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.te02-letterhead-img-wrapper,
.institution-letterhead-img-wrapper,
.official-letterhead {
    width: 100%;
    background: #ffffff;
    text-align: center;
    padding: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.te02-letterhead-img,
.institution-letterhead-img,
.official-letterhead img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.te02-letterhead-content,
.institution-letterhead-content {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.te02-letterhead-left,
.institution-letterhead-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 300px;
}

.te02-letterhead-seal,
.institution-letterhead-seal {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(30, 58, 138, 0.25);
    border: 2px solid #fbbf24;
    flex-shrink: 0;
}

.te02-seal-icon,
.institution-seal-icon {
    font-size: 1.85rem;
    line-height: 1;
}

.te02-letterhead-titles,
.institution-letterhead-titles {
    display: flex;
    flex-direction: column;
}

.te02-univ-km,
.institution-univ-km {
    font-size: 1.12rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.te02-univ-en,
.institution-univ-en {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 2px;
}

.te02-dept-sub,
.institution-dept-sub {
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.04em;
    margin-top: 3px;
    text-transform: uppercase;
}

.te02-form-title-badge,
.institution-form-title-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 2px 10px;
    margin-top: 6px;
    letter-spacing: 0.02em;
}

.te02-letterhead-right,
.institution-letterhead-right {
    flex-shrink: 0;
}

.te02-doc-meta-box,
.institution-doc-meta-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    padding: 8px 14px;
    font-size: 0.78rem;
    min-width: 175px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.te02-doc-meta-row,
.institution-doc-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 3px;
}

.te02-doc-meta-row:last-child,
.institution-doc-meta-row:last-child {
    margin-bottom: 0;
}

.te02-meta-label,
.institution-meta-label {
    color: #64748b;
    font-weight: 600;
    font-size: 0.73rem;
}

.te02-meta-val,
.institution-meta-val {
    color: #0f172a;
    font-weight: 700;
}

.te02-letterhead-accent-bar,
.institution-letterhead-accent-bar {
    height: 4px;
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #fbbf24 100%);
    width: 100%;
}

/* Admin Toolbar inside Letterhead */
.letterhead-admin-toolbar {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 10;
}

.letterhead-change-btn {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    color: #1e3a8a;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.letterhead-change-btn:hover {
    background: #ffffff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}

/* Central Letterhead Modal Dialog */
.letterhead-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.letterhead-modal-dialog {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: letterheadModalFade 0.2s ease-out;
}

@keyframes letterheadModalFade {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.letterhead-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.letterhead-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
}

.letterhead-modal-close:hover {
    color: #0f172a;
}

.letterhead-modal-body {
    padding: 20px;
}

/* TE-02 Page Header Toolbar */
.te02-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.te02-header-info {
    flex: 1;
    min-width: 280px;
}

.te02-header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.te02-page-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.te02-header-meta {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.te02-meta-sep {
    color: #cbd5e1;
}

.te02-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================================
   TE-02 Spreadsheet / Excel-Style Planning Grid
   ========================================================================== */

/* Schedule Section Card & Blue Title Bar */
.te02-schedule-card {
    border: 1px solid #93c5fd;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.te02-table-title-bar {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    padding: 10px 16px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom: 2px solid #1e40af !important;
}

.te02-table-title-bar .te02-title-heading {
    margin: 0;
    font-size: 1.10rem;
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

.te02-table-title-bar .te02-title-subheading {
    display: block;
    font-size: 0.81rem;
    color: #dbeafe !important;
    margin-top: 2px;
    font-weight: 400;
}

.te02-btn-add-session {
    background: #ffffff !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.te02-btn-add-session:hover {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

.te02-top-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
    background: #f8fafc;
    border-top: 1px solid #cbd5e1;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #e2e8f0;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.te02-top-scroll-container::-webkit-scrollbar {
    height: 10px;
}

.te02-top-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.te02-top-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.te02-top-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.te02-top-scroll-inner {
    height: 1px;
}

.te02-schedule-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: none;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.te02-schedule-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.te02-schedule-scroll-container::-webkit-scrollbar-track {
    background: #f8fafc;
}

.te02-schedule-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.te02-schedule-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Excel Spreadsheet Table */
.te02-schedule-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    font-size: 0.84rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

/* 2. Column Header Row: Light Blue Background */
.te02-schedule-table thead th {
    background: #e0f2fe; /* Light / pale blue */
    color: #0369a1;      /* Crisp dark blue text */
    font-weight: 700;
    font-size: 0.79rem;
    padding: 7px 8px;
    text-align: left;
    border: 1px solid #bae6fd;
    border-bottom: 2px solid #38bdf8;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    user-select: none;
}

.te02-schedule-table tbody td {
    padding: 2px 4px;
    border: 1px solid #cbd5e1;
    vertical-align: top;
    background: #ffffff;
    transition: background-color 0.1s ease;
}

.te02-schedule-table tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}

.te02-schedule-table tbody tr:hover td {
    background-color: #eff6ff;
}

/* Excel Row Header Column (Session #) */
.te02-schedule-table .col-session {
    width: 48px;
    min-width: 46px;
    max-width: 52px;
    text-align: center;
}

.te02-schedule-table .cell-row-index {
    background: #f0f9ff !important;
    color: #0369a1;
    font-weight: 700;
    font-size: 0.82rem;
    text-align: center;
    vertical-align: middle !important;
    border-right: 2px solid #bae6fd !important;
    user-select: none;
}

/* 9-Column OBE Syllabus Columns */
.te02-schedule-table .col-session-week {
    width: 160px;
    min-width: 150px;
}

.te02-schedule-table .col-teaching-status {
    width: 150px;
    min-width: 140px;
}

.te02-schedule-table .col-class-observation {
    width: 160px;
    min-width: 150px;
}

.te02-schedule-table .col-contact-hours {
    width: 105px;
    min-width: 95px;
    text-align: center;
}

.te02-schedule-table .col-clos {
    width: 110px;
    min-width: 100px;
}

.te02-schedule-table .col-llos {
    min-width: 250px;
}

.te02-schedule-table .col-lecture-topics {
    min-width: 260px;
}

.te02-schedule-table .col-teaching-method {
    min-width: 210px;
}

.te02-schedule-table .col-learning-method {
    min-width: 210px;
}

.te02-schedule-table .col-assessment-weightage {
    min-width: 200px;
}

.te02-schedule-table .col-tl-resources {
    min-width: 190px;
}

/* Legacy Column Compatibility */
.te02-schedule-table .col-date {
    width: 135px;
    min-width: 130px;
}

.te02-schedule-table .col-hours {
    width: 70px;
    min-width: 65px;
    text-align: center;
}

.te02-schedule-table .col-topic {
    min-width: 260px;
}

.te02-schedule-table .col-objective {
    min-width: 225px;
}

.te02-schedule-table .col-activity {
    min-width: 225px;
}

.te02-schedule-table .col-assessment {
    min-width: 200px;
}

.te02-schedule-table .col-notes {
    min-width: 190px;
}

.te02-schedule-table .col-action {
    width: 44px;
    min-width: 40px;
    text-align: center;
    vertical-align: middle !important;
}

@media print {
    .no-print, .te02-btn-add-session, .btn-grid-delete, .remove-row-btn, .te02-spreadsheet-footer .no-print {
        display: none !important;
    }
    .te02-schedule-scroll-container {
        overflow: visible !important;
        border: none !important;
    }
    .te02-schedule-table {
        min-width: 100% !important;
        font-size: 0.72rem !important;
    }
    .te02-schedule-table thead th {
        position: static !important;
        background: #f1f5f9 !important;
        color: #0f172a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 4px 6px !important;
        font-size: 0.68rem !important;
    }
    .te02-schedule-table td {
        padding: 4px 6px !important;
    }
    .te02-schedule-table textarea.te02-table-textarea,
    .te02-schedule-table input {
        border: none !important;
        background: transparent !important;
        resize: none !important;
        height: auto !important;
        overflow: visible !important;
        font-size: 0.72rem !important;
        padding: 0 !important;
        line-height: 1.3 !important;
    }
}

/* 3. Input Controls: Minimal border by default, visible on hover, clear active border on focus/click */
.te02-schedule-table .form-control,
.te02-schedule-table input,
.te02-schedule-table select,
.te02-schedule-table textarea.te02-table-textarea {
    width: 100%;
    border-radius: 2px !important;
    border: 1px solid transparent !important;
    background-color: transparent !important;
    color: #0f172a;
    box-sizing: border-box;
    font-family: inherit;
    box-shadow: none !important;
    transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.te02-schedule-table input.form-control-sm,
.te02-schedule-table select.form-control-sm {
    height: 28px;
    padding: 2px 6px;
    font-size: 0.82rem;
}

.te02-schedule-table textarea.te02-table-textarea {
    min-height: 46px;
    max-height: 220px;
    font-size: 0.83rem;
    line-height: 1.35;
    padding: 3px 6px;
    resize: vertical;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Hover State: visible border */
.te02-schedule-table .form-control:hover:not([readonly]):not(:disabled),
.te02-schedule-table input:hover:not([readonly]):not(:disabled),
.te02-schedule-table select:hover:not([readonly]):not(:disabled),
.te02-schedule-table textarea.te02-table-textarea:hover:not([readonly]):not(:disabled) {
    border: 1px solid #94a3b8 !important;
    background-color: #ffffff !important;
}

/* Focus / Click State: clearly visible border + active state ring */
.te02-schedule-table .form-control:focus,
.te02-schedule-table input:focus,
.te02-schedule-table select:focus,
.te02-schedule-table textarea.te02-table-textarea:focus {
    border: 1px solid #2563eb !important;
    background-color: #ffffff !important;
    box-shadow: inset 0 0 0 1px #2563eb !important;
    outline: none !important;
}

/* Readonly fields */
.te02-schedule-table .form-control[readonly],
.te02-schedule-table input[readonly],
.te02-schedule-table select:disabled,
.te02-schedule-table textarea.te02-table-textarea[readonly] {
    background-color: transparent !important;
    color: #334155;
    border-color: transparent !important;
    box-shadow: none !important;
    resize: none !important;
    cursor: default;
}

/* Compact Grid Delete Button */
.btn-grid-delete {
    width: 24px;
    height: 24px;
    border: 1px solid #fca5a5;
    border-radius: 2px;
    background: #fff1f2;
    color: #e11d48;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

.btn-grid-delete:hover {
    background: #ffe4e6;
    border-color: #f87171;
    color: #be123c;
}

/* Compact Spreadsheet Footer Summary Bar */
.te02-spreadsheet-footer {
    background: #f8fafc;
    padding: 10px 16px;
    border-top: 2px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.86rem;
}

/* TE-02 Structured Session Card (Fallback / legacy) */
.te02-session-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.te02-session-card:hover {
    border-color: #93c5fd;
}

.te02-session-header {
    background: #f8fafc;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.te02-session-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.te02-session-body {
    padding: 16px 18px;
}

.te02-session-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .te02-session-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FORMS: Clean, Structured, Highly Usable Form Controls
   ========================================================================== */
.form-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 25px;
}

.form-section {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
}

.form-label .required {
    color: var(--danger);
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text-main);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background-color: #ffffff;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    padding-right: 38px;
    appearance: none;
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

textarea.form-control-sm {
    min-height: 75px;
}

textarea.form-control-lg {
    min-height: 135px;
}

.form-text, .form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   REPORTS: Institutional Quality Assurance Documents
   ========================================================================== */
.report-container {
    max-width: 1100px;
    margin: 0 auto;
}

.report-header-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 30px 35px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.report-header-card::after {
    content: "OFFICIAL IQA DOCUMENT";
    position: absolute;
    right: 25px;
    bottom: -15px;
    font-size: 3.5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
    user-select: none;
}

.report-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.report-doc-code {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #93c5fd;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.report-title-lg {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.report-subtitle {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin: 0;
}

/* Executive KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

@media (max-width: 900px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
}

.kpi-card.highlight {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.kpi-grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 900;
    color: #1e40af;
    background: #dbeafe;
    border-radius: 12px;
    padding: 4px 16px;
    width: fit-content;
}

/* Domain Progress Bar */
.domain-meter {
    margin-bottom: 16px;
}

.domain-meter-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Qualitative Comments Cards */
.comment-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
    position: relative;
}

.comment-card.strength {
    border-left: 4px solid var(--success);
    background: #fcfdfd;
}

.comment-card.improvement {
    border-left: 4px solid var(--warning);
    background: #fffdfb;
}

.comment-text {
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.5;
}

.comment-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

/* Formal Sign-off Box */
.signoff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px dashed var(--border);
}

.signoff-box {
    background: var(--secondary-subtle);
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.signature-line {
    width: 75%;
    margin: 40px auto 10px;
    border-bottom: 1.5px solid #64748b;
}

/* ==========================================================================
   TABLES: High-Legibility, Crisp Data Grids
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: #1e293b;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table-sm th, .table-sm td {
    padding: 9px 12px;
    font-size: 0.85rem;
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.badge-success { background: var(--success-subtle); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-subtle); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-subtle); color: var(--danger-text); border: 1px solid var(--danger-border); }
.badge-info    { background: var(--info-subtle); color: var(--info-text); border: 1px solid var(--info-border); }
.badge-primary { background: var(--primary-subtle); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-secondary { background: var(--secondary-subtle); color: var(--secondary); border: 1px solid var(--border); }

/* ==========================================================================
   BUTTONS: Distinct, Tactile, Modern
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: #2563eb;
    color: #ffffff !important;
    border-color: #1d4ed8;
}
.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
    background: #ffffff;
    color: #334155 !important;
    border-color: #cbd5e1;
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-success {
    background: #059669;
    color: #ffffff !important;
}
.btn-success:hover {
    background: #047857;
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.25);
}

.btn-danger {
    background: #dc2626;
    color: #ffffff !important;
}
.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   ALERTS / CALLOUTS
   ========================================================================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    font-size: 0.93rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-xs);
}

.alert-success { background: var(--success-subtle); color: var(--success-text); border-color: var(--success-border); }
.alert-danger  { background: var(--danger-subtle); color: var(--danger-text); border-color: var(--danger-border); }
.alert-warning { background: var(--warning-subtle); color: var(--warning-text); border-color: var(--warning-border); }
.alert-info    { background: var(--info-subtle); color: var(--info-text); border-color: var(--info-border); }

/* ==========================================================================
   12-STEP EVALUATION TRACKER
   ========================================================================== */
.step-tracker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.step-card {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
    position: relative;
    transition: all 0.2s ease;
}

.step-card:hover {
    border-color: #94a3b8;
    box-shadow: var(--shadow-sm);
}

.step-card.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.step-card.completed {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.step-code {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 4px 0 10px;
}

/* ==========================================================================
   PRINT STYLESHEET (Clean A4 Institutional Format)
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 12mm 12mm 12mm;
    }

    .sidebar, .topbar, nav, header:not(.print-header), .btn, form button, .no-print, .flash-message, .lang-switch, .screen-only, .te08-screen-only, .letterhead-admin-toolbar, .letterhead-change-btn, .letterhead-modal-backdrop {
        display: none !important;
    }

    body:has(.institution-letterhead-card) .print-header,
    body:has(.official-letterhead) .print-header {
        display: none !important;
    }

    .institution-letterhead-card,
    .te02-letterhead-card,
    .official-letterhead-card {
        border: none !important;
        box-shadow: none !important;
        margin: 0 0 14px 0 !important;
        padding: 0 !important;
        background: transparent !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .institution-letterhead-img-wrapper,
    .te02-letterhead-img-wrapper,
    .official-letterhead {
        padding: 0 !important;
        background: transparent !important;
        min-height: 0 !important;
    }

    .institution-letterhead-img,
    .te02-letterhead-img,
    .official-letterhead img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt !important;
        line-height: 1.35 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .app-container, .main-content, .page-body, .report-container {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .card, .form-card, .kpi-card, .section-card, .te02-session-card {
        border: 1px solid #94a3b8 !important;
        box-shadow: none !important;
        margin-bottom: 12px !important;
        page-break-inside: avoid;
        break-inside: avoid;
        background: #ffffff !important;
    }

    .card-body, .section-body {
        padding: 12px 14px !important;
    }

    .card-header, .section-header {
        padding: 8px 14px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #cbd5e1 !important;
    }

    .print-avoid-break, .report-section, tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .table {
        margin-bottom: 8px !important;
    }

    .table th, .table td {
        border: 1px solid #94a3b8 !important;
        padding: 5px 8px !important;
        font-size: 9pt !important;
    }

    .table th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
    }

    .te02-top-scroll-container {
        display: none !important;
    }

    .print-only-block {
        display: block !important;
    }

    .te02-schedule-scroll-container {
        overflow-x: visible !important;
        border: none !important;
    }

    .te02-schedule-table {
        min-width: 100% !important;
        width: 100% !important;
        font-size: 8.5pt !important;
        page-break-inside: auto;
    }

    .te02-schedule-table th,
    .te02-schedule-table td {
        padding: 4px 6px !important;
        border: 1px solid #94a3b8 !important;
    }

    .te02-table-textarea {
        border: none !important;
        padding: 0 !important;
        min-height: 0 !important;
        background: transparent !important;
        font-size: 8.5pt !important;
        resize: none !important;
    }

    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 16px;
        border-bottom: 2px solid #000000;
        padding-bottom: 10px;
    }

    .print-inst-name {
        font-size: 1.12rem;
        font-weight: 800;
        color: #0f172a;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .print-inst-sub {
        font-size: 0.9rem;
        font-weight: 600;
        color: #1e3a8a;
        margin-top: 2px;
    }

    .print-inst-conf {
        font-size: 0.78rem;
        font-weight: 600;
        color: #555555;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-top: 3px;
    }

    .report-header-card {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1.5px solid #000000 !important;
        padding: 16px 20px !important;
        margin-bottom: 14px !important;
    }

    .report-title-lg {
        color: #000000 !important;
        font-size: 1.3rem !important;
        margin: 6px 0 !important;
    }

    .report-subtitle, .report-doc-code {
        color: #333333 !important;
    }

    .print-only, .te08-print-only {
        display: block !important;
    }

    /* Print Form Controls Reset: No scrollbars, no dropdown arrows, no resize handles */
    textarea {
        overflow: visible !important;
        resize: none !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        line-height: 1.35 !important;
        font-size: 9.5pt !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
    }

    input, select {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        padding: 0 !important;
        height: auto !important;
        font-size: 9.5pt !important;
    }

    .report-footer, .te01-report-footer {
        margin-top: 24px !important;
        padding-top: 10px !important;
        border-top: 1px solid #94a3b8 !important;
        text-align: center !important;
        font-size: 8.5pt !important;
        color: #475569 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

.print-header, .print-only, .te08-print-only {
    display: none;
}

/* Readonly & Disabled Form Controls - TE-08 Permission Styling */
input[readonly], textarea[readonly], select[disabled] {
    background-color: #f8fafc;
    cursor: default;
}

textarea[readonly] {
    resize: none !important;
}

/* ==========================================================================
   Student Response Forms (TE-03A & TE-03C) — Clean, Modern, Khmer-Friendly
   ========================================================================== */

.student-survey-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 10px 0 40px;
}

/* 1. Header Card */
.student-survey-header-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
}

.student-survey-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #3b82f6 100%);
}

.student-survey-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.student-survey-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.student-survey-class-pill {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.student-survey-title {
    margin: 0 0 6px 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
}

.student-survey-subtitle {
    margin: 0 0 18px 0;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

/* Course & Instructor Meta Grid */
.student-survey-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
}

.student-survey-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.student-survey-meta-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.student-survey-meta-val {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
}

/* 2. Confidentiality & Anonymity Notice */
.student-survey-notice {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.student-survey-notice.notice-formative {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.student-survey-notice-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.student-survey-notice-body {
    flex: 1;
}

.student-survey-notice-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 4px;
}

.notice-formative .student-survey-notice-title {
    color: #1e40af;
}

.student-survey-notice-text {
    font-size: 0.88rem;
    color: #14532d;
    line-height: 1.65;
    margin: 0;
}

.notice-formative .student-survey-notice-text {
    color: #1e3a8a;
}

.student-survey-notice-sub {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #bfdbfe;
    font-size: 0.85rem;
    color: #0369a1;
    line-height: 1.6;
}

/* 3. Rating Scale Legend */
.student-survey-scale-legend {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.student-survey-scale-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 10px;
}

.student-survey-scale-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.student-survey-scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 4px;
}

.student-survey-scale-num {
    font-weight: 800;
    font-size: 1rem;
    color: #1e40af;
    line-height: 1.2;
}

.student-survey-scale-text {
    font-size: 0.76rem;
    color: #475569;
    line-height: 1.35;
    margin-top: 2px;
}

/* 4. Sticky / Live Progress Bar */
.survey-progress-card {
    position: -webkit-sticky;
    position: sticky;
    top: 12px;
    z-index: 99;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
}

.survey-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.survey-progress-label {
    font-weight: 700;
    color: #0f172a;
}

.survey-progress-stats {
    font-weight: 600;
    color: #475569;
}

.survey-progress-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.survey-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #059669);
    border-radius: 9999px;
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 5. Domains and Question Sections */
.survey-domain-block {
    margin-bottom: 26px;
}

.survey-domain-header {
    background: #f1f5f9;
    border-left: 4px solid #1e40af;
    border-radius: 0 8px 8px 0;
    padding: 12px 18px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.survey-domain-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.4;
}

.survey-domain-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* 6. Question Cards */
.survey-question-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.survey-question-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
}

.survey-question-card.has-error {
    border-color: #ef4444 !important;
    background-color: #fffbfb !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.survey-question-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.survey-question-num-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.survey-question-texts {
    flex: 1;
}

.survey-question-en {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 4px;
}

.survey-question-km {
    font-family: 'Noto Sans Khmer', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.8;
    word-break: normal;
    overflow-wrap: break-word;
}

.survey-validation-alert {
    display: none;
    margin-top: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
}

.survey-question-card.has-error .survey-validation-alert {
    display: block;
}

/* 7. Rating Options Grid / Buttons */
.survey-rating-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.rating-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease-in-out;
    min-height: 58px;
    position: relative;
}

.rating-option:hover {
    border-color: #93c5fd;
    background: #f0f7ff;
    transform: translateY(-1px);
}

.rating-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.rating-option:focus-within {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
}

.rating-option.selected,
.rating-option:has(input[type="radio"]:checked) {
    background: #1e40af;
    border-color: #1e40af;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.25);
    transform: translateY(-2px);
}

.rating-option-num {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e40af;
    line-height: 1;
    margin-bottom: 4px;
}

.rating-option.selected .rating-option-num,
.rating-option:has(input[type="radio"]:checked) .rating-option-num {
    color: #ffffff;
}

.rating-option-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.3;
    text-align: center;
}

.rating-option.selected .rating-option-label,
.rating-option:has(input[type="radio"]:checked) .rating-option-label {
    color: #e0e7ff;
}

/* 8. Separate Overall Item */
.survey-domain-overall {
    border: 2px solid #3b82f6;
    border-radius: 12px;
    background: #f8fafc;
    padding: 20px;
    margin-bottom: 26px;
}

.survey-overall-badge {
    display: inline-block;
    background: #1e40af;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* 9. Comments Section */
.survey-comments-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 26px;
}

.survey-comments-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.survey-comments-title {
    margin: 0 0 4px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.survey-comments-sub {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.survey-comment-card {
    margin-bottom: 20px;
}

.survey-comment-card:last-child {
    margin-bottom: 0;
}

.survey-comment-label {
    display: block;
    margin-bottom: 8px;
}

.survey-comment-en {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.survey-comment-km {
    display: block;
    font-family: 'Noto Sans Khmer', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.75;
    word-break: normal;
    overflow-wrap: break-word;
    margin-top: 4px;
}

.survey-comment-badge-opt {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-left: 6px;
    vertical-align: middle;
}

.survey-textarea {
    width: 100%;
    min-height: 115px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #0f172a;
    background: #ffffff;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.survey-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 10. Submit Area */
.survey-submit-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    text-align: center;
}

.survey-submit-title {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.survey-submit-notice {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.6;
    max-width: 650px;
    margin: 0 auto 20px auto;
}

.survey-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    padding: 16px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.survey-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1d4ed8 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.survey-submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .student-survey-header-card {
        padding: 18px;
    }
    .student-survey-title {
        font-size: 1.25rem;
    }
    .student-survey-meta-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
    .student-survey-scale-items {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
    .student-survey-scale-text {
        font-size: 0.68rem;
    }
    .survey-rating-group {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    .rating-option {
        padding: 10px 2px;
        min-height: 52px;
    }
    .rating-option-num {
        font-size: 1.1rem;
    }
    .rating-option-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .survey-wrapper .student-survey-container {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    .student-survey-scale-items {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .student-survey-scale-item {
        flex-direction: row;
        gap: 8px;
        padding: 6px 10px;
        text-align: left;
    }
    .survey-rating-group {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 3px;
        width: 100%;
        min-width: 0;
    }
    .student-survey-container .survey-question-card {
        padding: 12px 4px !important;
    }
    .survey-domain-overall {
        padding: 6px;
    }
    .rating-option {
        box-sizing: border-box;
        min-width: 0;
        min-height: 68px;
        padding: 8px 1px;
    }
    .rating-option-label {
        display: block;
        width: 100%;
        font-size: 0.65rem;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }
}

/* ==========================================================================
   System Guide & Workflow Handbook Styles
   ========================================================================== */
.guide-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.guide-hero-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #2563eb 100%);
    border-radius: 16px;
    padding: 32px 36px 24px;
    color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(30, 64, 175, 0.25);
    margin-bottom: 32px;
}

.guide-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 12px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

.guide-hero-title {
    color: #ffffff;
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.guide-hero-subtitle {
    color: #e2e8f0;
    font-size: 0.98rem;
    max-width: 850px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.guide-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: #cbd5e1;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Guide Navigation */
.guide-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.quick-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc !important;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease-in-out;
}

.quick-nav-pill:hover,
.quick-nav-pill.active {
    background: #ffffff;
    color: #1e3a8a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.guide-module-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
}

.guide-pills-label {
    font-size: 0.78rem;
    color: #cbd5e1;
    font-weight: 600;
    margin-right: 4px;
}

.mod-pill {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
}

.mod-pill:hover,
.mod-pill.active-mod-pill {
    background: #38bdf8;
    color: #0f172a !important;
    font-weight: 800;
}

/* Sections */
.guide-section {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 30px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 100px;
}

.guide-section-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.section-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.section-title {
    margin: 0 0 4px 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand-dark);
}

.section-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Concurrency Alert */
.journey-concurrency-alert {
    display: flex;
    gap: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #2563eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.journey-concurrency-alert .alert-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.journey-concurrency-alert strong {
    color: #1e3a8a;
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.journey-concurrency-alert p {
    margin: 0;
    color: #1e40af;
    font-size: 0.88rem;
    line-height: 1.55;
}

/* Visual Flow */
.journey-visual-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 20px 0 32px;
}

.journey-step-box {
    width: 100%;
    max-width: 720px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: transform 0.15s ease;
}

.journey-step-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.step-num {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.step-module {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.step-desc {
    font-size: 0.84rem;
    color: var(--text-body);
    line-height: 1.45;
}

.step-prep {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.step-gate {
    border-color: #f59e0b;
    background: #fffbeb;
}

.step-gate .step-num {
    color: #b45309;
}

.step-gate .step-title {
    color: #92400e;
}

.step-feedback {
    border-color: #3b82f6;
    background: #f0fdf4;
}

.journey-flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #64748b;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1;
}

.journey-flow-arrow small {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-top: 2px;
}

/* Parallel Box */
.journey-parallel-box {
    width: 100%;
    max-width: 960px;
    background: #f8fafc;
    border: 2px dashed #3b82f6;
    border-radius: 16px;
    padding: 24px 20px 20px;
    position: relative;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.06);
}

.parallel-box-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 12px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.parallel-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.parallel-columns .journey-step-box {
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Phases Detail Grid */
.phases-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 24px;
}

.phase-detail-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.phase-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.phase-badge {
    background: #1e3a8a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.phase-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.phase-description {
    font-size: 0.85rem;
    color: var(--text-body);
    line-height: 1.5;
    margin-bottom: 12px;
}

.phase-meta-tags {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meta-tag strong {
    color: var(--text-main);
}

/* Module Guides Stack */
.modules-guide-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.module-guide-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    scroll-margin-top: 100px;
    transition: all 0.25s ease-in-out;
}

.module-card-target,
.deep-link-highlight {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3), 0 8px 24px rgba(37, 99, 235, 0.15) !important;
    animation: targetPulse 1.2s ease-in-out;
}

@keyframes targetPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

.module-card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.module-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.module-code-badge {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.module-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.module-submeta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    gap: 8px;
}

.module-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.guide-block {
    background: #ffffff;
}

.block-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-count-badge {
    background: #e2e8f0;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.purpose-block p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-body);
    margin: 0;
    background: #f8fafc;
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

/* Workflow Step Track */
.workflow-steps-track {
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 0 8px;
}

.workflow-step-node {
    flex: 1;
    min-width: 170px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.step-node-final {
    border-color: #10b981;
    background: #ecfdf5;
}

.node-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.node-number {
    width: 20px;
    height: 20px;
    background: #334155;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-grey { background: #f1f5f9; color: #475569; }

.node-meaning {
    font-size: 0.8rem;
    color: var(--text-body);
    line-height: 1.45;
    margin-bottom: 8px;
    flex-grow: 1;
}

.node-next-action {
    font-size: 0.75rem;
    color: #1e40af;
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1.35;
}

.workflow-step-arrow {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #94a3b8;
}

/* Callout blocks */
.formative-notice-block {
    display: flex;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.88rem;
    color: #166534;
}

.formative-notice-block .notice-icon {
    font-size: 1.3rem;
}

.readiness-contrast-block {
    display: flex;
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 5px solid #d97706;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 0.88rem;
    color: #78350f;
}

.readiness-contrast-block ul {
    margin: 6px 0 8px 18px;
}

.readiness-contrast-block code {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.timing-info-block,
.subblock-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.timing-info-block ul {
    margin: 6px 0 0 18px;
    font-size: 0.85rem;
    color: var(--text-body);
}

/* Prerequisites Grid */
.prereqs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.prereq-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.prereq-code {
    display: inline-block;
    background: #1e3a8a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.prereq-desc {
    font-size: 0.82rem;
    color: var(--text-body);
    line-height: 1.4;
    margin-bottom: 4px;
}

.prereq-req {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 600;
}

/* Branches Container */
.branches-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.branch-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    background: #f8fafc;
}

.branch-a { border-left: 4px solid #10b981; }
.branch-bc { border-left: 4px solid #f59e0b; }
.branch-undetermined { border-left: 4px solid #94a3b8; }

.branch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stage-pill {
    font-size: 0.72rem;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.branch-decision-key code {
    font-size: 0.78rem;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    color: #2563eb;
}

.branch-path {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    margin: 8px 0;
    line-height: 1.4;
}

.branch-expl {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

/* Exceptions Grid */
.exceptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.exception-item {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    padding: 12px 14px;
}

.exception-desc {
    font-size: 0.82rem;
    color: var(--text-body);
    margin: 6px 0 4px;
    line-height: 1.4;
}

.exception-rule {
    font-size: 0.75rem;
    color: #7e22ce;
}

/* Management Block */
.mgmt-block {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
}

.mgmt-purpose,
.mgmt-completion {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 4px 0 0;
}

/* Status Dictionary */
.status-categories-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.status-category-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.cat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cat-badge {
    font-size: 0.88rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 6px;
}

.cat-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.cat-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.cat-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dict-status-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.dict-status-left {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.status-key {
    font-size: 0.72rem;
    color: #64748b;
}

.dict-status-body {
    flex: 1;
}

.dict-meaning {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: 4px;
}

.dict-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.text-green { color: #059669; font-weight: 600; }
.text-amber { color: #d97706; font-weight: 600; }

/* Timing Rules */
.timing-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.timing-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.timing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.basis-pill {
    font-size: 0.72rem;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.timing-metric {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.metric-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e3a8a;
}

.metric-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.timing-guidance {
    font-size: 0.85rem;
    color: var(--text-body);
    line-height: 1.5;
    margin-bottom: 14px;
}

.timing-rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.timing-rules-table th {
    text-align: left;
    padding: 6px 10px;
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
}

.timing-rules-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
}

/* Roles Matrix */
.roles-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.role-matrix-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.role-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.role-badge {
    background: #1e3a8a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.role-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
}

.role-summary {
    font-size: 0.85rem;
    color: var(--text-body);
    line-height: 1.5;
    margin-bottom: 14px;
}

.role-subhead {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.role-resps-list {
    margin: 0 0 14px 18px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-body);
}

.role-access-block {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.role-access-block strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}

.role-access-block p {
    margin: 0;
    line-height: 1.4;
}

/* Master Exceptions Grid */
.exceptions-master-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.exception-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    font-size: 0.84rem;
}

.ex-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ex-target {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.exception-card p {
    margin: 0 0 6px 0;
    line-height: 1.45;
}

/* FAQ Accordion */
.faq-accordion-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: background 0.15s ease;
}

.faq-item[open] {
    background: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.faq-question {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    user-select: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-q-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
}

.faq-q-text {
    flex: 1;
}

.faq-q-chevron {
    font-size: 1rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-q-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px 18px 52px;
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.65;
}

.faq-answer p {
    margin: 0;
}

/* Guide Meta Card */
.guide-meta-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.meta-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.meta-val {
    font-size: 0.88rem;
    color: var(--text-main);
}

.meta-val code {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.meta-card-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.text-link-sm {
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.text-link-sm:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .parallel-columns,
    .branches-container,
    .timing-rules-grid,
    .meta-card-grid {
        grid-template-columns: 1fr;
    }
    .phases-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .phases-detail-grid,
    .roles-matrix-grid {
        grid-template-columns: 1fr;
    }
    .guide-hero-card {
        padding: 22px 20px;
    }
    .guide-hero-title {
        font-size: 1.45rem;
    }
    .dict-status-row {
        flex-direction: column;
        gap: 6px;
    }
    .dict-status-left {
        min-width: auto;
    }
    .faq-answer {
        padding: 0 16px 14px 16px;
    }
}

/* ==========================================================================
   System Guide — Mobile & Small-Screen Responsive Fixes
   Target: ~390px (mobile), ~768px (tablet)
   Principle: no document-level overflow-x; workflow-steps-track uses local
              horizontal scroll; flex/grid children get min-width:0;
              long code strings wrap safely; grids collapse to 1 column.
   ========================================================================== */

/* Ensure guide-wrapper never exceeds viewport width */
.guide-wrapper {
    box-sizing: border-box;
    width: 100%;
}

@media (max-width: 480px) {
    /* Hero card */
    .guide-hero-card {
        padding: 18px 14px;
    }
    .guide-hero-title {
        font-size: 1.3rem;
        word-break: break-word;
    }
    .guide-hero-subtitle {
        font-size: 0.88rem;
    }
    .guide-hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Navigation pills — allow wrap, prevent min-width forcing overflow */
    .guide-quick-nav {
        gap: 6px;
    }
    .quick-nav-pill {
        font-size: 0.78rem;
        padding: 5px 10px;
        min-width: 0;
    }
    .guide-module-pills {
        gap: 4px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .mod-pill {
        font-size: 0.72rem;
        padding: 3px 7px;
        min-width: 0;
    }

    /* Guide sections */
    .guide-section {
        padding: 16px 14px;
        scroll-margin-top: 120px;
    }
    .module-guide-card {
        scroll-margin-top: 120px;
    }
    .module-card-body {
        padding: 14px;
    }
    .module-card-header {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
    }
    .module-header-left {
        flex-wrap: wrap;
        gap: 8px;
    }
    .module-title {
        font-size: 1.05rem;
    }
    .module-code-badge {
        font-size: 0.9rem;
    }

    /* Workflow step track — local horizontal scroll, never expands page width */
    .workflow-steps-track {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        box-sizing: border-box;
    }
    .workflow-step-node {
        min-width: 140px;
        flex-shrink: 0;
    }

    /* Branches container — stack vertically on mobile */
    .branches-container {
        grid-template-columns: 1fr;
    }
    .branch-path {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .branch-decision-key code {
        overflow-wrap: anywhere;
        word-break: break-all;
        display: inline-block;
        max-width: 100%;
    }

    /* Parallel columns & badge */
    .parallel-columns {
        grid-template-columns: 1fr;
    }
    .parallel-box-badge {
        white-space: normal;
        max-width: calc(100% - 20px);
        text-align: center;
        font-size: 0.72rem;
        line-height: 1.25;
        padding: 4px 10px;
        box-sizing: border-box;
    }

    /* Phases detail grid */
    .phases-detail-grid {
        grid-template-columns: 1fr;
    }

    /* Status dictionary rows */
    .dict-status-row {
        flex-direction: column;
        gap: 4px;
    }
    .dict-status-left {
        min-width: 0;
        width: 100%;
    }
    .dict-status-body {
        min-width: 0;
        width: 100%;
    }
    .dict-meta {
        flex-direction: column;
        gap: 3px;
    }

    /* Timing rules: single-column layout */
    .timing-rules-grid {
        grid-template-columns: 1fr;
    }
    /* Timing table: contained local horizontal scroll */
    .timing-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .timing-rules-table {
        min-width: 340px;
    }

    /* Role matrix */
    .roles-matrix-grid {
        grid-template-columns: 1fr;
    }
    .role-matrix-card {
        min-width: 0;
    }

    /* Exception master grid */
    .exceptions-master-grid {
        grid-template-columns: 1fr;
    }
    .exception-card {
        min-width: 0;
    }

    /* Meta card */
    .meta-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .meta-val code {
        overflow-wrap: anywhere;
        word-break: break-all;
        font-size: 0.72rem;
    }

    /* Prerequisites grid */
    .prereqs-grid {
        grid-template-columns: 1fr;
    }

    /* Exception grid (per-module) */
    .exceptions-grid {
        grid-template-columns: 1fr;
    }

    /* Code elements inside guide — wrap safely */
    .guide-section code,
    .module-guide-card code {
        overflow-wrap: anywhere;
        word-break: break-all;
    }

    /* FAQ */
    .faq-answer {
        padding: 0 12px 12px 12px;
    }
    .faq-question {
        padding: 12px 14px;
        font-size: 0.88rem;
    }

    /* Timing info block lists */
    .timing-info-block ul,
    .readiness-contrast-block ul {
        padding-left: 14px;
    }

    /* Section icon layout */
    .section-title-wrap {
        gap: 10px;
    }
    .section-icon {
        font-size: 1.4rem;
        flex-shrink: 0;
    }
    .section-title {
        font-size: 1.15rem;
    }
}

@media (max-width: 390px) {
    /* Further shrink to fit narrowest common viewport */
    .guide-hero-card {
        padding: 14px 12px;
        border-radius: 10px;
    }
    .guide-section {
        padding: 12px 10px;
        border-radius: 10px;
        scroll-margin-top: 120px;
    }
    .module-guide-card {
        scroll-margin-top: 120px;
    }
    .module-card-body {
        padding: 10px;
    }
    /* Collapse meta grid to single column on very narrow viewports */
    .meta-card-grid {
        grid-template-columns: 1fr;
    }
    /* Prevent journey concurrency alert from expanding */
    .journey-concurrency-alert {
        flex-direction: column;
        gap: 8px;
    }
}

/* =========================================================================
   LIVE WORKFLOW / STATUS PROGRESS TRACKER (STEP 4)
   ========================================================================= */

.workflow-tracker-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-width: 0;
    box-sizing: border-box;
}

.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.tracker-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.tracker-module-badge {
    background: var(--primary, #2563eb);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.tracker-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
}

.tracker-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.tracker-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tracker-current-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.tracker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.pill-blue, .pill-primary {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.pill-amber, .pill-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.pill-green, .pill-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.pill-grey, .pill-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.pill-red, .pill-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.pill-purple {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.tracker-guide-link {
    font-size: 0.82rem;
    color: var(--primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.tracker-guide-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Stepper Track */
.tracker-stepper-container {
    margin: 20px 0;
    padding: 18px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    min-width: 0;
}

.tracker-stepper {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.tracker-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    padding-right: 14px;
    min-width: 0;
    box-sizing: border-box;
}

.step-marker {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 2;
    margin-bottom: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tracker-step.step-completed .step-marker {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 0 0 3px #dcfce7;
}

.tracker-step.step-current .step-marker {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 4px #dbeafe;
}

.tracker-step.step-future .step-marker {
    background: #f8fafc;
    color: #94a3b8;
    border: 2px solid #cbd5e1;
}

.step-connector {
    position: absolute;
    top: 17px;
    left: 38px;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.tracker-step.step-completed .step-connector {
    background: #16a34a;
}

.step-content {
    min-width: 0;
    width: 100%;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.step-number {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.step-you-are-here {
    font-size: 0.65rem;
    font-weight: 800;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.step-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.25;
}

.step-current .step-label {
    color: #1d4ed8;
}

.step-meaning {
    font-size: 0.76rem;
    color: #64748b;
    margin: 0;
    line-height: 1.35;
}

/* Summary Grid */
.tracker-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
    min-width: 0;
}

.tracker-summary-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tracker-summary-card.highlight-card {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.summary-value-wrap {
    min-width: 0;
}

.next-action-title {
    font-size: 0.92rem;
    color: #1e3a8a;
    display: block;
    line-height: 1.25;
}

.progress-main-stat {
    font-size: 0.92rem;
    color: #0f172a;
    display: block;
    line-height: 1.25;
}

.summary-subtext {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.3;
}

.progress-bar-wrap {
    background: #e2e8f0;
    height: 6px;
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #2563eb, #10b981);
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Timing Exception Banner */
.tracker-exception-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.exception-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.exception-body {
    min-width: 0;
    flex: 1;
}

.exception-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 4px 0;
}

.exception-desc {
    font-size: 0.82rem;
    color: #78350f;
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.exception-justification {
    background: #fef3c7;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: #78350f;
    margin: 6px 0;
}

.exception-notice {
    font-size: 0.74rem;
    color: #92400e;
    display: block;
    margin-top: 4px;
    font-style: italic;
}

/* "Why This Status?" Expandable */
.tracker-why-status {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.why-status-summary {
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.why-status-summary:hover {
    background: #f1f5f9;
}

.why-toggle-icon {
    font-size: 0.65rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.tracker-why-status[open] .why-toggle-icon {
    transform: rotate(180deg);
}

.why-status-content {
    padding: 12px 14px;
    font-size: 0.82rem;
    color: #475569;
    border-top: 1px solid #e2e8f0;
    line-height: 1.45;
}

.why-explanation {
    margin: 0 0 6px 0;
}

.why-guidance-note {
    margin: 6px 0 0 0;
    color: #1e3a8a;
}

/* TE-07 Readiness Panel */
.tracker-readiness-panel {
    margin-top: 18px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-left: 4px solid #9333ea;
    border-radius: 8px;
    padding: 16px 18px;
    min-width: 0;
}

.readiness-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.readiness-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.readiness-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.readiness-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #581c87;
    margin: 0 0 2px 0;
}

.readiness-desc {
    font-size: 0.78rem;
    color: #7e22ce;
    display: block;
    line-height: 1.3;
}

.readiness-result-pill {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 16px;
    white-space: nowrap;
}

.readiness-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    min-width: 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    padding: 4px 0;
    min-width: 0;
}

.checklist-item.check-passed {
    color: #15803d;
}

.checklist-item.check-failed {
    color: #b91c1c;
}

.check-icon {
    font-weight: 800;
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.check-label {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

.check-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.readiness-note {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #d8b4fe;
    font-size: 0.8rem;
    color: #581c87;
    line-height: 1.35;
}

/* Compact Table Display */
.tracker-compact-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
    min-width: 130px;
}

.tracker-compact-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tracker-compact-meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.25;
}

.tracker-compact-stat {
    font-weight: 700;
    color: #0f172a;
}

.tracker-compact-sep {
    color: #cbd5e1;
}

.tracker-compact-next {
    color: #475569;
}

.tracker-compact-guide-link {
    font-size: 0.72rem;
    color: var(--primary, #2563eb);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 1px;
}

.tracker-compact-guide-link:hover {
    text-decoration: underline;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .tracker-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .readiness-checklist {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (max-width: 600px) {
    .workflow-tracker-card {
        padding: 14px 12px;
        border-radius: 10px;
    }

    .tracker-stepper {
        flex-direction: column;
        gap: 16px;
    }

    .tracker-step {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        padding-right: 0;
        width: 100%;
    }

    .step-marker {
        margin-bottom: 0;
    }

    .step-connector {
        top: 34px;
        left: 16px;
        bottom: -16px;
        width: 2px;
        height: auto;
        right: auto;
    }

    .tracker-step:last-child .step-connector {
        display: none;
    }
}

@media (max-width: 390px) {
    .workflow-tracker-card {
        padding: 12px 10px;
    }

    .tracker-title {
        font-size: 1.1rem;
    }

    .tracker-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .readiness-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tracker-summary-card {
        padding: 10px 12px;
    }
}

/* TE-03C Survey Administration & Distribution Controls Responsive Styles */
@media (max-width: 768px) {
    .shared-distribution-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

@media (max-width: 480px) {
    .shared-distribution-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .shared-distribution-card-body {
        padding: 14px 12px !important;
    }
    .shared-survey-url-container {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .shared-survey-url-container input {
        width: 100% !important;
        min-width: 0 !important;
    }
    .shared-survey-url-container button {
        width: 100% !important;
    }
    .shared-distribution-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .shared-distribution-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
    .te03-view-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .te03-view-header-actions {
        width: 100% !important;
    }
    .te03-view-header-actions .btn {
        flex: 1 1 auto !important;
        text-align: center !important;
    }
}

/* ==========================================================================
   ROLE-AWARE WORKFLOW STATUS & NEXT ACTION PANEL
   ========================================================================== */
.workflow-status-panel {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.workflow-status-panel:hover {
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
    .workflow-status-panel {
        padding: 14px 16px !important;
    }
}

@media (max-width: 480px) {
    .workflow-status-panel {
        padding: 12px 14px !important;
    }
    .workflow-status-panel h3 {
        font-size: 1.05rem !important;
    }
}
