@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&display=swap');

:root {
    --blue-900: #0b2f4f;
    --blue-800: #0f4c81;
    --blue-700: #1464a5;
    --blue-100: #e8f3ff;
    --green-600: #22a06b;
    --green-100: #e9f9f1;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --red: #ef4444;
    --shadow: 0 18px 45px rgba(15, 76, 129, .14);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Sarabun', sans-serif;
    background: #f5f7fb;
    color: var(--gray-900);
}

.hidden {
    display: none !important;
}

.gateway {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 32px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gateway-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(34, 160, 107, .20), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(20, 100, 165, .18), transparent 34%),
        linear-gradient(135deg, #eef7ff, #f8fbff 42%, #eefaf4);
}

.gateway-card {
    position: relative;
    width: min(1120px, 100%);
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(15, 76, 129, .12);
    border-radius: 32px;
    box-shadow: var(--shadow);
    padding: 34px;
    text-align: center;
    backdrop-filter: blur(14px);
}

.gateway-logo-wrap {
    width: 92px;
    height: 92px;
    margin: 0 auto 12px;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 76, 129, .16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gateway-logo-text {
    font-size: 42px;
}

.gateway h1 {
    margin: 8px 0 4px;
    color: var(--blue-900);
    font-size: clamp(30px, 5vw, 56px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: .5px;
}

.gateway h2 {
    margin: 0;
    color: var(--blue-700);
    font-size: clamp(18px, 2.4vw, 28px);
    font-weight: 700;
}

.gateway-tagline {
    max-width: 890px;
    margin: 18px auto 12px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--gray-700);
}

.banner-quote {
    margin: 16px auto 26px;
    max-width: 920px;
    padding: 18px 22px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--blue-800), var(--green-600));
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 12px 30px rgba(15, 76, 129, .18);
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.role-card {
    border: 1px solid rgba(15, 76, 129, .14);
    background: #fff;
    border-radius: 24px;
    padding: 24px 18px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 76, 129, .08);
    transition: .18s ease;
    font-family: inherit;
}

.role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(15, 76, 129, .16);
    border-color: rgba(34, 160, 107, .45);
}

.role-card.active {
    border-color: var(--green-600);
    background: var(--green-100);
}

.role-icon {
    display: block;
    font-size: 42px;
    margin-bottom: 10px;
}

.role-title {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--blue-900);
}

.role-desc {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.5;
}

.access-box {
    margin: 28px auto 0;
    max-width: 440px;
    padding: 20px;
    border-radius: 22px;
    background: var(--blue-100);
    border: 1px solid rgba(20, 100, 165, .16);
}

.access-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--blue-900);
    margin-bottom: 12px;
}

.access-input {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 16px;
    background: #fff;
    outline: none;
}

.access-input:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 4px rgba(20, 100, 165, .10);
}

.access-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
}

.btn-primary {
    background: var(--blue-800);
    color: #fff;
}

.btn-light {
    background: #fff;
    color: var(--blue-800);
    border: 1px solid var(--gray-200);
}

.message {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
}

.message.ok {
    color: var(--green-600);
}

.message.err {
    color: var(--red);
}

.gateway-footer {
    margin-top: 22px;
    color: var(--gray-500);
    font-size: 14px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(11, 47, 79, .22);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.loader-card {
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    width: 260px;
    text-align: center;
    box-shadow: var(--shadow);
}

.loader {
    width: 44px;
    height: 44px;
    border: 5px solid #e5e7eb;
    border-top-color: var(--blue-800);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 1s linear infinite;
}

.loader-title {
    font-weight: 800;
    color: var(--blue-900);
}

.loader-subtitle {
    color: var(--gray-500);
    font-size: 13px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .role-grid {
        grid-template-columns: 1fr;
    }

    .gateway-card {
        padding: 22px;
    }

    .access-actions {
        flex-direction: column;
    }
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px 1fr;
    background: #f5f7fb;
}

.sidebar {
    background: linear-gradient(180deg, #0b2f4f, #0f4c81);
    color: #ffffff;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 12px;
    opacity: .78;
    line-height: 1.4;
    margin-top: 3px;
}

.user-panel {
    background: rgba(255, 255, 255, .11);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    padding: 14px;
}

.user-role {
    font-size: 12px;
    opacity: .82;
}

.user-name {
    font-weight: 800;
    margin-top: 4px;
    line-height: 1.35;
}

.user-school {
    font-size: 13px;
    margin-top: 5px;
    opacity: .85;
    line-height: 1.45;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: .16s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, .12);
    transform: translateX(2px);
}

.menu-item.active {
    background: #ffffff;
    color: #0b2f4f;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
}

.menu-icon {
    width: 26px;
    text-align: center;
    font-size: 18px;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 12px;
    opacity: .72;
    line-height: 1.55;
    padding: 10px 6px;
}

.main-area {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 76px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-size: 22px;
    font-weight: 800;
    color: #0b2f4f;
}

.topbar-subtitle {
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content {
    padding: 28px;
}

.page-header {
    margin-bottom: 20px;
}

.page-title {
    margin: 0;
    font-size: 30px;
    color: #0b2f4f;
    font-weight: 800;
}

.page-desc {
    margin-top: 7px;
    color: #6b7280;
    line-height: 1.65;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
}

.stat-value {
    margin-top: 7px;
    color: #0b2f4f;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

.stat-note {
    margin-top: 8px;
    font-size: 13px;
    color: #22a06b;
    font-weight: 700;
}

.card-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    margin-bottom: 18px;
}

.card-panel h3 {
    margin: 0 0 12px;
    color: #0b2f4f;
    font-size: 22px;
}

.card-panel p {
    color: #374151;
    line-height: 1.75;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
}

.simple-table th,
.simple-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.simple-table th {
    background: #e8f3ff;
    color: #0b2f4f;
    font-weight: 800;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    background: #e8f3ff;
    color: #0f4c81;
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -310px;
        top: 0;
        width: 292px;
        z-index: 50;
        transition: .2s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 18px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    font-weight: 800;
    color: #0b2f4f;
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 12px 14px;
    font-family: 'Sarabun', sans-serif;
    font-size: 16px;
    background: #ffffff;
    outline: none;
}

.form-control:focus {
    border-color: #1464a5;
    box-shadow: 0 0 0 4px rgba(20, 100, 165, .10);
}

textarea.form-control {
    min-height: 130px;
    resize: vertical;
    line-height: 1.7;
}

.form-help {
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.form-message {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 700;
}

.form-message.ok {
    background: #e9f9f1;
    color: #166534;
}

.form-message.err {
    background: #fef2f2;
    color: #b91c1c;
}

.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

@media (max-width: 760px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.file-box {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 18px;
    padding: 16px;
}

.file-box input[type="file"] {
    width: 100%;
    font-family: 'Sarabun', sans-serif;
}

.file-note {
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.detail-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
}

.detail-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-value {
    color: #0b2f4f;
    font-weight: 800;
    line-height: 1.55;
}

.evidence-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.evidence-item {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
}

.evidence-title {
    font-weight: 800;
    color: #0b2f4f;
    margin-bottom: 4px;
}

.evidence-meta {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    text-decoration: none;
    color: #0f4c81;
    font-weight: 800;
}

@media (max-width: 760px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.response-card {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.response-meta {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.response-text {
    white-space: pre-wrap;
    line-height: 1.75;
    color: #0b2f4f;
    font-weight: 600;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 255, 255, .28), transparent 28%),
        linear-gradient(135deg, #0b2f4f, #0f4c81 48%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.dashboard-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
}

.dashboard-hero p {
    margin: 10px 0 0;
    max-width: 860px;
    line-height: 1.75;
    opacity: .92;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 22px;
}

.hero-metric {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: 20px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.hero-metric-label {
    font-size: 13px;
    opacity: .85;
}

.hero-metric-value {
    margin-top: 6px;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.progress-wrap {
    margin-top: 22px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    margin-bottom: 8px;
}

.progress-track {
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .25);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #ffffff;
    width: 0%;
    transition: width .5s ease;
}

.status-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.status-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    position: relative;
    overflow: hidden;
}

.status-card::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -22px;
    width: 80px;
    height: 80px;
    border-radius: 999px;
    opacity: .16;
    background: #0f4c81;
}

.status-card.approved::after {
    background: #22a06b;
}

.status-card.warning::after {
    background: #f59e0b;
}

.status-card.danger::after {
    background: #ef4444;
}

.status-card.info::after {
    background: #1464a5;
}

.status-number {
    font-size: 34px;
    font-weight: 800;
    color: #0b2f4f;
    line-height: 1;
}

.status-label {
    margin-top: 8px;
    color: #6b7280;
    font-weight: 700;
}

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input {
    min-width: 280px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 11px 14px;
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 999px;
    padding: 8px 12px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 700;
    cursor: pointer;
    color: #0f4c81;
}

.filter-pill.active {
    background: #0f4c81;
    color: #ffffff;
    border-color: #0f4c81;
}

.school-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.school-status-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    transition: .16s ease;
}

.school-status-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 76, 129, .14);
}

.school-card-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
}

.school-name {
    color: #0b2f4f;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.school-code {
    color: #6b7280;
    font-size: 13px;
    margin-top: 3px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 800;
}

.status-not-submitted {
    background: #f3f4f6;
    color: #6b7280;
}

.status-submitted {
    background: #e8f3ff;
    color: #0f4c81;
}

.status-approved {
    background: #e9f9f1;
    color: #166534;
}

.status-need-revision {
    background: #fff7ed;
    color: #c2410c;
}

.status-need-more-evidence {
    background: #fef2f2;
    color: #b91c1c;
}

.status-resubmitted {
    background: #eef2ff;
    color: #4338ca;
}

.school-card-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.mini-metric {
    background: #f8fafc;
    border-radius: 14px;
    padding: 10px;
    text-align: center;
}

.mini-value {
    color: #0b2f4f;
    font-weight: 800;
    font-size: 20px;
    line-height: 1;
}

.mini-label {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.latest-line {
    margin-top: 12px;
    color: #374151;
    font-size: 13px;
    line-height: 1.55;
}

.dashboard-empty {
    padding: 22px;
    border-radius: 20px;
    background: #f8fafc;
    color: #6b7280;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 1180px) {
    .hero-metrics,
    .status-summary-grid,
    .school-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .hero-metrics,
    .status-summary-grid,
    .school-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-toolbar {
        align-items: stretch;
    }

    .search-input {
        min-width: 100%;
    }
}

.school-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 14% 22%, rgba(255, 255, 255, .30), transparent 28%),
        linear-gradient(135deg, #0b2f4f, #1464a5 52%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.school-hero h1 {
    margin: 0;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.15;
}

.school-hero p {
    margin: 10px 0 0;
    line-height: 1.75;
    opacity: .92;
}

.school-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.hero-chip {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .20);
    font-weight: 700;
}

.school-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.timeline-card {
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    margin-bottom: 14px;
    transition: .16s ease;
}

.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 76, 129, .14);
}

.timeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.timeline-title {
    color: #0b2f4f;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
}

.timeline-desc {
    margin-top: 6px;
    color: #6b7280;
    line-height: 1.6;
}

.timeline-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.timeline-mini {
    background: #f8fafc;
    border-radius: 14px;
    padding: 10px;
}

.timeline-mini-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.timeline-mini-value {
    margin-top: 3px;
    color: #0b2f4f;
    font-weight: 800;
}

.feedback-box {
    margin-top: 14px;
    border-left: 5px solid #f59e0b;
    background: #fffbeb;
    border-radius: 14px;
    padding: 12px 14px;
}

.feedback-label {
    font-weight: 800;
    color: #92400e;
    margin-bottom: 5px;
}

.feedback-text {
    color: #78350f;
    white-space: pre-wrap;
    line-height: 1.65;
}

.school-action-box {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status-timeline-not-started {
    background: #f3f4f6;
    color: #6b7280;
}

.status-timeline-submitted {
    background: #e8f3ff;
    color: #0f4c81;
}

.status-timeline-approved {
    background: #e9f9f1;
    color: #166534;
}

.status-timeline-need-revision {
    background: #fff7ed;
    color: #c2410c;
}

.status-timeline-need-more-evidence {
    background: #fef2f2;
    color: #b91c1c;
}

.status-timeline-resubmitted {
    background: #eef2ff;
    color: #4338ca;
}

.recent-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.recent-item {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 13px 14px;
    background: #ffffff;
}

.recent-title {
    color: #0b2f4f;
    font-weight: 800;
}

.recent-meta {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 980px) {
    .school-status-grid,
    .timeline-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .school-status-grid,
    .timeline-meta-grid {
        grid-template-columns: 1fr;
    }

    .timeline-head {
        flex-direction: column;
    }
}

.research-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 22%, rgba(255, 255, 255, .28), transparent 28%),
        linear-gradient(135deg, #1e3a8a, #0f4c81 50%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.research-hero h1 {
    margin: 0;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 800;
}

.research-hero p {
    margin: 10px 0 0;
    line-height: 1.75;
    opacity: .92;
}

.research-layout {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 18px;
    align-items: start;
}

.research-step-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 10px;
}

.research-step-title {
    color: #0b2f4f;
    font-weight: 800;
    margin-bottom: 4px;
}

.research-step-desc {
    color: #6b7280;
    line-height: 1.6;
    font-size: 14px;
}

.research-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.research-item-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 76, 129, .07);
}

.research-item-title {
    color: #0b2f4f;
    font-size: 18px;
    line-height: 1.45;
    font-weight: 800;
}

.research-item-meta {
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
}

.research-detail-section {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.research-detail-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 5px;
}

.research-detail-value {
    color: #0b2f4f;
    line-height: 1.75;
    white-space: pre-wrap;
    font-weight: 600;
}

@media (max-width: 1080px) {
    .research-layout {
        grid-template-columns: 1fr;
    }
}

.review-history {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.review-history-item {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 18px;
    padding: 16px;
}

.review-history-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.review-history-name {
    font-weight: 800;
    color: #0b2f4f;
}

.review-history-date {
    color: #6b7280;
    font-size: 13px;
}

.review-history-text {
    color: #0b2f4f;
    line-height: 1.75;
    white-space: pre-wrap;
}

.review-form-panel {
    border: 1px solid #c7d2fe;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.research-status-line {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.edit-alert {
    border-radius: 20px;
    padding: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    line-height: 1.7;
    font-weight: 700;
    margin-bottom: 16px;
}

.edit-alert strong {
    color: #7c2d12;
}

.adjust-history {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.adjust-history-item {
    border: 1px solid #dbeafe;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
}

.adjust-history-meta {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.adjust-history-text {
    color: #0b2f4f;
    line-height: 1.75;
    white-space: pre-wrap;
    font-weight: 600;
}

.research-dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, .30), transparent 28%),
        radial-gradient(circle at 90% 10%, rgba(34, 160, 107, .28), transparent 32%),
        linear-gradient(135deg, #111827, #1e3a8a 46%, #0f4c81 72%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.research-dashboard-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
}

.research-dashboard-hero p {
    margin: 10px 0 0;
    max-width: 900px;
    line-height: 1.75;
    opacity: .92;
}

.research-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.subject-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
}

.subject-title {
    color: #0b2f4f;
    font-weight: 800;
    font-size: 18px;
    line-height: 1.35;
}

.subject-total {
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    color: #0f4c81;
}

.subject-meta {
    margin-top: 10px;
    color: #6b7280;
    line-height: 1.6;
    font-size: 13px;
}

.research-school-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.research-school-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    transition: .16s ease;
}

.research-school-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 76, 129, .14);
}

.research-school-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.research-school-name {
    color: #0b2f4f;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.research-school-code {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.research-latest-title {
    margin-top: 12px;
    color: #374151;
    font-size: 13px;
    line-height: 1.55;
}

.research-dashboard-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.research-tab {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #0f4c81;
    border-radius: 999px;
    padding: 8px 12px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 800;
    cursor: pointer;
}

.research-tab.active {
    background: #0f4c81;
    color: #ffffff;
    border-color: #0f4c81;
}

@media (max-width: 1180px) {
    .research-subject-grid,
    .research-school-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .research-subject-grid,
    .research-school-grid {
        grid-template-columns: 1fr;
    }
}

.bp-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 255, 255, .30), transparent 28%),
        radial-gradient(circle at 90% 12%, rgba(245, 158, 11, .24), transparent 30%),
        linear-gradient(135deg, #111827, #7c2d12 44%, #0f4c81 78%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.bp-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
}

.bp-hero p {
    margin: 10px 0 0;
    line-height: 1.75;
    max-width: 900px;
    opacity: .92;
}

.bp-layout {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 18px;
    align-items: start;
}

.bp-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.bp-item-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
}

.bp-item-title {
    color: #0b2f4f;
    font-size: 19px;
    line-height: 1.4;
    font-weight: 800;
}

.bp-item-meta {
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
}

.bp-connect-box {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 12px;
}

.bp-connect-title {
    color: #0b2f4f;
    font-weight: 800;
    margin-bottom: 5px;
}

.bp-connect-desc {
    color: #6b7280;
    line-height: 1.65;
    font-size: 14px;
}

.bp-detail-section {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.bp-detail-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 5px;
}

.bp-detail-value {
    color: #0b2f4f;
    white-space: pre-wrap;
    line-height: 1.75;
    font-weight: 600;
}

@media (max-width: 1080px) {
    .bp-layout {
        grid-template-columns: 1fr;
    }
}

.bp-edit-alert {
    border-radius: 20px;
    padding: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    line-height: 1.7;
    font-weight: 700;
    margin-bottom: 16px;
}

.bp-dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 22%, rgba(255, 255, 255, .28), transparent 28%),
        radial-gradient(circle at 90% 10%, rgba(245, 158, 11, .28), transparent 32%),
        linear-gradient(135deg, #111827, #7c2d12 44%, #0f4c81 76%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.bp-dashboard-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
}

.bp-dashboard-hero p {
    margin: 10px 0 0;
    max-width: 940px;
    line-height: 1.75;
    opacity: .92;
}

.bp-level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.bp-level-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
}

.bp-level-title {
    color: #0b2f4f;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.35;
}

.bp-level-total {
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    color: #7c2d12;
}

.bp-level-meta {
    margin-top: 10px;
    color: #6b7280;
    line-height: 1.6;
    font-size: 13px;
}

.bp-school-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.bp-school-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    transition: .16s ease;
}

.bp-school-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 76, 129, .14);
}

.bp-school-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.bp-school-name {
    color: #0b2f4f;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.bp-school-code {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.bp-latest-title {
    margin-top: 12px;
    color: #374151;
    font-size: 13px;
    line-height: 1.55;
}

.bp-link-chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.bp-link-chip {
    border-radius: 999px;
    padding: 5px 9px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.bp-link-chip.ok {
    background: #dcfce7;
    color: #166534;
}

.bp-dashboard-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.bp-tab {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #0f4c81;
    border-radius: 999px;
    padding: 8px 12px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 800;
    cursor: pointer;
}

.bp-tab.active {
    background: #7c2d12;
    color: #ffffff;
    border-color: #7c2d12;
}

@media (max-width: 1180px) {
    .bp-level-grid,
    .bp-school-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .bp-level-grid,
    .bp-school-grid {
        grid-template-columns: 1fr;
    }
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.export-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 12px 32px rgba(15, 76, 129, .09);
}

.export-icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 10px;
}

.export-title {
    color: #0b2f4f;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.export-desc {
    color: #6b7280;
    line-height: 1.75;
    margin-bottom: 16px;
}

.export-note {
    border-radius: 20px;
    padding: 16px;
    background: #f8fbff;
    border: 1px solid #dbeafe;
    color: #0b2f4f;
    line-height: 1.75;
    margin-top: 18px;
}

@media (max-width: 840px) {
    .export-grid {
        grid-template-columns: 1fr;
    }
}

.overview-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 22%, rgba(255, 255, 255, .30), transparent 28%),
        radial-gradient(circle at 86% 10%, rgba(34, 160, 107, .25), transparent 30%),
        linear-gradient(135deg, #020617, #0f4c81 42%, #1e3a8a 72%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.overview-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
}

.overview-hero p {
    margin: 10px 0 0;
    max-width: 960px;
    line-height: 1.75;
    opacity: .92;
}

.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.pipeline-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 12px 32px rgba(15, 76, 129, .09);
}

.pipeline-title {
    color: #0b2f4f;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 8px;
}

.pipeline-number {
    color: #0f4c81;
    font-size: 38px;
    line-height: 1;
    font-weight: 800;
}

.pipeline-desc {
    color: #6b7280;
    line-height: 1.65;
    font-size: 13px;
    margin-top: 8px;
}

.pipeline-progress {
    margin-top: 12px;
}

.overview-school-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.overview-school-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    transition: .16s ease;
}

.overview-school-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 76, 129, .14);
}

.overview-school-name {
    color: #0b2f4f;
    font-weight: 800;
    font-size: 17px;
    line-height: 1.35;
}

.overview-school-meta {
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
}

.pipeline-status-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 14px;
}

.pipeline-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-radius: 14px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.pipeline-status-label {
    color: #374151;
    font-weight: 800;
    font-size: 13px;
}

.pipeline-step-bar {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.pipeline-step-dot {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
}

.pipeline-step-dot.done {
    background: #22a06b;
}

.follow-reason {
    margin-top: 12px;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 10px;
    line-height: 1.6;
    font-size: 13px;
    font-weight: 700;
}

.overview-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.overview-tab {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #0f4c81;
    border-radius: 999px;
    padding: 8px 12px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 800;
    cursor: pointer;
}

.overview-tab.active {
    background: #0f4c81;
    color: #ffffff;
    border-color: #0f4c81;
}

@media (max-width: 1180px) {
    .pipeline-grid,
    .overview-school-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .pipeline-grid,
    .overview-school-grid {
        grid-template-columns: 1fr;
    }
}

.go-live-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 22%, rgba(255, 255, 255, .30), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(34, 160, 107, .28), transparent 30%),
        linear-gradient(135deg, #020617, #0f4c81 48%, #22a06b);
    box-shadow: 0 18px 45px rgba(15, 76, 129, .18);
    margin-bottom: 20px;
}

.go-live-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
}

.go-live-hero p {
    margin: 10px 0 0;
    max-width: 920px;
    line-height: 1.75;
    opacity: .92;
}

.go-live-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.go-live-metric {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
}

.go-live-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
}

.go-live-value {
    margin-top: 6px;
    color: #0f4c81;
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
}

.go-live-ready {
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 18px;
    font-weight: 800;
    line-height: 1.7;
}

.go-live-ready.ok {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.go-live-ready.err {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.check-section {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .08);
    margin-bottom: 16px;
}

.check-section h3 {
    margin: 0 0 12px;
    color: #0b2f4f;
}

.check-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.check-item {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 16px;
    padding: 10px 12px;
}

.check-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.check-icon.ok {
    background: #dcfce7;
    color: #166534;
}

.check-icon.err {
    background: #fee2e2;
    color: #991b1b;
}

.check-name {
    color: #0b2f4f;
    font-weight: 800;
    line-height: 1.45;
}

.check-detail {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 3px;
}

.check-level {
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    background: #e0f2fe;
    color: #075985;
}

.check-level.critical {
    background: #fff7ed;
    color: #9a3412;
}

@media (max-width: 980px) {
    .go-live-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .check-item {
        grid-template-columns: 34px 1fr;
    }

    .check-level {
        grid-column: 2;
        width: fit-content;
    }
}

@media (max-width: 640px) {
    .go-live-summary {
        grid-template-columns: 1fr;
    }
}

.download-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.download-form-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 76, 129, .06);
}

.download-form-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.download-form-title {
    font-size: 18px;
    font-weight: 800;
    color: #0b2f4f;
    line-height: 1.5;
}

.download-form-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

.download-form-desc {
    margin-top: 10px;
    color: #374151;
    line-height: 1.7;
    white-space: pre-wrap;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

@media (max-width: 900px) {
    .download-card-grid {
        grid-template-columns: 1fr;
    }
}

/* STEP 32: Formal Login + Home Dashboard */

.gateway {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 15%, rgba(34, 160, 107, .20), transparent 28%),
        radial-gradient(circle at 88% 10%, rgba(15, 76, 129, .22), transparent 32%),
        linear-gradient(135deg, #eef7ff 0%, #f8fbff 48%, #f0fff7 100%);
}

.gateway-bg {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(15, 76, 129, .06), transparent 42%),
        linear-gradient(300deg, rgba(34, 160, 107, .07), transparent 44%);
    pointer-events: none;
}

.gateway-card {
    border-radius: 34px;
    border: 1px solid rgba(15, 76, 129, .12);
    box-shadow: 0 28px 90px rgba(15, 76, 129, .18);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
}

.gateway-logo-wrap {
    width: 92px;
    height: 92px;
    margin: 0 auto 16px;
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    box-shadow: 0 14px 34px rgba(15, 76, 129, .16);
    display: grid;
    place-items: center;
}

.gateway-logo-text {
    width: 70px;
    height: 70px;
    font-size: 0;
    border-radius: 18px;
    background-image: url('https://www.spmcr.go.th/wp-content/uploads/2025/03/logo-e1741976583114.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.gateway-card h1 {
    color: #0b2f4f;
    letter-spacing: .3px;
    font-weight: 900;
}

.gateway-card h2 {
    color: #166534;
    font-weight: 700;
}

.gateway-tagline {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    font-size: 17px;
    line-height: 1.9;
}

.banner-quote {
    border: 1px solid #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4, #eff6ff);
    color: #0b2f4f;
    border-radius: 22px;
    font-weight: 700;
}

.role-card {
    border-radius: 22px;
    border: 1px solid #dbeafe;
    box-shadow: 0 12px 30px rgba(15, 76, 129, .06);
}

.role-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(15, 76, 129, .14);
}

.role-card.active {
    background: linear-gradient(135deg, #0f4c81, #22a06b);
    border-color: transparent;
}

.access-box {
    border-radius: 24px;
    border: 1px solid #dbeafe;
    background: #f8fbff;
}

.access-title {
    color: #0b2f4f;
    font-weight: 900;
}

.access-input {
    border-radius: 16px;
    border: 1px solid #cbd5e1;
}

.gateway-footer {
    margin-top: 18px;
    color: #475569;
    line-height: 1.8;
}

/* Home dashboard */

.formal-home-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(15, 76, 129, .96), rgba(34, 160, 107, .92)),
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .32), transparent 28%);
    box-shadow: 0 24px 60px rgba(15, 76, 129, .20);
    margin-bottom: 22px;
}

.formal-home-hero::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -100px;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

.formal-home-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .24);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
}

.formal-home-title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 900;
    line-height: 1.25;
}

.formal-home-desc {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: 12px 0 0;
    line-height: 1.9;
    font-size: 16px;
    opacity: .95;
}

.home-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.home-pipeline-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 14px 34px rgba(15, 76, 129, .07);
}

.home-pipeline-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    font-size: 24px;
    margin-bottom: 12px;
}

.home-pipeline-title {
    color: #0b2f4f;
    font-weight: 900;
    font-size: 18px;
    margin-bottom: 8px;
}

.home-pipeline-desc {
    color: #64748b;
    line-height: 1.75;
}

.home-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.home-quick-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 22px;
    padding: 18px;
    cursor: pointer;
    transition: .16s ease;
    min-height: 132px;
}

.home-quick-card:hover {
    transform: translateY(-3px);
    border-color: #93c5fd;
    box-shadow: 0 18px 40px rgba(15, 76, 129, .12);
}

.home-quick-icon {
    font-size: 26px;
    margin-bottom: 8px;
}

.home-quick-title {
    color: #0b2f4f;
    font-weight: 900;
}

.home-quick-desc {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 5px;
}

.home-role-note {
    border-left: 6px solid #22a06b;
    background: #f0fdf4;
    border-radius: 20px;
    padding: 18px;
    line-height: 1.85;
    color: #14532d;
}

@media (max-width: 1100px) {
    .home-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-pipeline-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .home-quick-grid {
        grid-template-columns: 1fr;
    }

    .formal-home-hero {
        padding: 22px;
        border-radius: 24px;
    }
}

/* STEP 34-R: Timeline Due Warning */

.step34-timeline-panel {
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.step34-timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.step34-timeline-title {
    font-size: 18px;
    font-weight: 900;
    color: #0b2f4f;
}

.step34-timeline-desc {
    color: #64748b;
    line-height: 1.7;
    margin-top: 4px;
}

.step34-timeline-list {
    display: grid;
    gap: 10px;
}

.step34-timeline-item {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
}

.step34-timeline-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.step34-timeline-name {
    font-weight: 900;
    color: #0b2f4f;
    line-height: 1.55;
}

.step34-timeline-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.step34-due-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

.step34-due-ok {
    background: #dcfce7;
    color: #166534;
}

.step34-due-soon {
    background: #fef3c7;
    color: #92400e;
}

.step34-due-today {
    background: #ffedd5;
    color: #9a3412;
}

.step34-due-over {
    background: #fee2e2;
    color: #991b1b;
}

.step34-due-none {
    background: #f1f5f9;
    color: #475569;
}

.step34-plc-warning {
    margin: 12px 0 16px;
    border-radius: 18px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #78350f;
    padding: 14px;
    line-height: 1.75;
}

@media (max-width: 760px) {
    .step34-timeline-item-head {
        flex-direction: column;
    }

    .step34-timeline-head {
        flex-direction: column;
    }
}

/* STEP 35-R: Timeline Matrix */

.tm-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tm-filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.tm-filter-row select {
    min-width: 220px;
}

.tm-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.tm-stat-card {
    border-radius: 18px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.tm-stat-label {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 4px;
}

.tm-stat-value {
    color: #0b2f4f;
    font-size: 28px;
    font-weight: 900;
}

.tm-matrix-scroll {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
}

.timeline-matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 1100px;
}

.timeline-matrix-table th,
.timeline-matrix-table td {
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    padding: 12px;
    vertical-align: top;
    background: #ffffff;
}

.timeline-matrix-table th {
    background: #f8fafc;
    color: #0b2f4f;
    font-weight: 900;
    text-align: left;
    font-size: 13px;
}

.tm-sticky-school {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 240px;
    box-shadow: 8px 0 14px rgba(15, 23, 42, .05);
}

.timeline-matrix-table th.tm-sticky-school {
    z-index: 3;
}

.tm-school-name {
    color: #0b2f4f;
    font-weight: 900;
    line-height: 1.55;
}

.tm-school-code {
    color: #64748b;
    font-size: 13px;
    margin-top: 3px;
}

.tm-task-head {
    min-width: 190px;
}

.tm-task-title {
    font-weight: 900;
    color: #0b2f4f;
    line-height: 1.45;
}

.tm-task-meta {
    color: #64748b;
    font-size: 12px;
    margin-top: 5px;
    line-height: 1.5;
}

.tm-cell {
    border-radius: 16px;
    padding: 10px;
    min-height: 92px;
}

.tm-cell-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 8px;
}

.tm-cell-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.5;
}

.tm-cell-note {
    color: #64748b;
    font-size: 12px;
    line-height: 1.55;
    margin-top: 4px;
}

.tm-status-not {
    background: #f1f5f9;
    color: #475569;
}

.tm-status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.tm-status-submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.tm-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.tm-status-approved {
    background: #dcfce7;
    color: #166534;
}

.tm-status-revision {
    background: #ffedd5;
    color: #9a3412;
}

.tm-note-box {
    border-left: 6px solid #0f4c81;
    background: #eff6ff;
    color: #0b2f4f;
    padding: 14px;
    border-radius: 18px;
    line-height: 1.75;
    margin-top: 16px;
}

@media (max-width: 1100px) {
    .tm-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .tm-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* STEP 38-R: Timeline Matrix Filters */

.tm-filter-row input {
    min-width: 260px;
}

.tm-filter-row .tm-status-select {
    min-width: 190px;
}

.tm-filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 14px;
}

.tm-filter-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eff6ff;
    color: #0b2f4f;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 800;
}

.tm-filter-chip.warn {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.tm-filter-chip.ok {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

@media (max-width: 760px) {
    .tm-filter-row input,
    .tm-filter-row select,
    .tm-filter-row .tm-status-select {
        width: 100%;
        min-width: 100%;
    }
}

/* STEP 39-R: Follow-up Target Schools */

.fu-hero {
    border-radius: 28px;
    padding: 24px;
    background: linear-gradient(135deg, #0f4c81, #22a06b);
    color: #ffffff;
    margin-bottom: 18px;
    box-shadow: 0 22px 50px rgba(15, 76, 129, .18);
}

.fu-hero-title {
    font-size: 30px;
    font-weight: 900;
    line-height: 1.3;
}

.fu-hero-desc {
    margin-top: 8px;
    line-height: 1.8;
    opacity: .95;
}

.fu-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.fu-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.fu-filter-row input {
    min-width: 260px;
}

.fu-filter-row select {
    min-width: 210px;
}

.fu-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.fu-summary-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.fu-summary-label {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 5px;
}

.fu-summary-value {
    color: #0b2f4f;
    font-size: 30px;
    font-weight: 900;
}

.fu-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.fu-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eff6ff;
    color: #0b2f4f;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 800;
}

.fu-table-wrap {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
}

.fu-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: separate;
    border-spacing: 0;
}

.fu-table th,
.fu-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    vertical-align: top;
    text-align: left;
}

.fu-table th {
    background: #f8fafc;
    color: #0b2f4f;
    font-weight: 900;
    font-size: 13px;
}

.fu-priority {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
}

.fu-priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.fu-priority-medium {
    background: #ffedd5;
    color: #9a3412;
}

.fu-priority-watch {
    background: #fef3c7;
    color: #92400e;
}

.fu-school-name {
    color: #0b2f4f;
    font-weight: 900;
    line-height: 1.5;
}

.fu-school-code {
    color: #64748b;
    font-size: 13px;
    margin-top: 3px;
}

.fu-task-name {
    font-weight: 900;
    color: #0f172a;
    line-height: 1.45;
}

.fu-task-meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 4px;
}

.fu-note {
    color: #475569;
    line-height: 1.6;
    font-size: 13px;
}

.fu-empty {
    border-radius: 20px;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 22px;
    line-height: 1.8;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .fu-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .fu-filter-row input,
    .fu-filter-row select {
        width: 100%;
        min-width: 100%;
    }

    .fu-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* STEP 41-R: User Management */

.user-admin-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.user-form-card,
.user-list-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.user-list-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.user-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.user-search-row input,
.user-search-row select {
    min-width: 220px;
}

.user-table-wrap {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
}

.user-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
}

.user-table th,
.user-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.user-table th {
    background: #f8fafc;
    color: #0b2f4f;
    font-weight: 900;
    font-size: 13px;
}

.user-name {
    font-weight: 900;
    color: #0b2f4f;
    line-height: 1.5;
}

.user-code {
    color: #64748b;
    font-size: 12px;
    margin-top: 3px;
}

.user-role-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 900;
    font-size: 12px;
    background: #eff6ff;
    color: #0b2f4f;
    border: 1px solid #bfdbfe;
}

.user-status-on {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 900;
    font-size: 12px;
    background: #dcfce7;
    color: #166534;
}

.user-status-off {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 900;
    font-size: 12px;
    background: #fee2e2;
    color: #991b1b;
}

.user-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 1050px) {
    .user-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* STEP 42-R: Grouped Sidebar Menu */

.menu-group {
    margin-bottom: 8px;
}

.menu-group-title {
    width: 100%;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .82);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-family: Sarabun, Tahoma, Arial, sans-serif;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
    transition: .18s ease;
}

.menu-group-title:hover {
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
}

.menu-group-icon {
    width: 24px;
    text-align: center;
    flex: 0 0 24px;
}

.menu-group-label {
    flex: 1;
}

.menu-group-arrow {
    font-size: 11px;
    opacity: .85;
    transition: transform .18s ease;
}

.menu-group.open .menu-group-arrow {
    transform: rotate(90deg);
}

.menu-group-items {
    display: none;
    padding-left: 10px;
    margin-top: 4px;
}

.menu-group.open .menu-group-items {
    display: block;
}

.menu-group-items .menu-item {
    width: calc(100% - 6px);
    margin-left: 6px;
    margin-bottom: 4px;
    border-radius: 14px;
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 14px;
}

.menu-group-items .menu-item .menu-icon {
    opacity: .95;
}

.menu-group.open .menu-group-title {
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
}

.menu-group:has(.menu-item.active) .menu-group-title {
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
}

/* FIX: Supervisor Work Center */

.sn-center-hero {
    border-radius: 28px;
    padding: 26px;
    background: linear-gradient(135deg, #0f4c81, #22a06b);
    color: #ffffff;
    margin-bottom: 18px;
    box-shadow: 0 22px 50px rgba(15, 76, 129, .18);
}

.sn-center-title {
    font-size: 30px;
    font-weight: 900;
    line-height: 1.35;
}

.sn-center-desc {
    margin-top: 8px;
    line-height: 1.8;
    opacity: .95;
}

.sn-center-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sn-center-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.sn-center-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #0f4c81;
    font-size: 24px;
    margin-bottom: 12px;
}

.sn-center-card-title {
    color: #0b2f4f;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 6px;
}

.sn-center-card-desc {
    color: #64748b;
    line-height: 1.7;
    min-height: 54px;
    margin-bottom: 12px;
}

.sn-center-note {
    margin-top: 18px;
    border-left: 6px solid #0f4c81;
    background: #eff6ff;
    color: #0b2f4f;
    padding: 14px;
    border-radius: 18px;
    line-height: 1.75;
}

@media (max-width: 1100px) {
    .sn-center-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sn-center-grid {
        grid-template-columns: 1fr;
    }
}

/* STEP 43-R: Best Practice Library */

.bp-lib-hero {
    border-radius: 28px;
    padding: 26px;
    background: linear-gradient(135deg, #0f4c81, #22a06b);
    color: #ffffff;
    margin-bottom: 18px;
    box-shadow: 0 22px 50px rgba(15, 76, 129, .18);
}

.bp-lib-title {
    font-size: 30px;
    font-weight: 900;
    line-height: 1.35;
}

.bp-lib-desc {
    margin-top: 8px;
    line-height: 1.8;
    opacity: .95;
}

.bp-lib-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.bp-lib-filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bp-lib-filter-row input {
    min-width: 280px;
}

.bp-lib-filter-row select {
    min-width: 220px;
}

.bp-lib-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.bp-lib-summary-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.bp-lib-summary-label {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 5px;
}

.bp-lib-summary-value {
    color: #0b2f4f;
    font-size: 30px;
    font-weight: 900;
}

.bp-lib-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.bp-lib-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.bp-lib-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.bp-lib-card-title {
    color: #0b2f4f;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.45;
}

.bp-lib-school {
    color: #64748b;
    line-height: 1.6;
    margin-top: 4px;
}

.bp-lib-level {
    display: inline-flex;
    white-space: nowrap;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eff6ff;
    color: #0b2f4f;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 900;
}

.bp-lib-section-title {
    color: #0f172a;
    font-weight: 900;
    margin-top: 10px;
    margin-bottom: 4px;
}

.bp-lib-text {
    color: #475569;
    line-height: 1.75;
}

.bp-lib-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.bp-lib-empty {
    border-radius: 20px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
    padding: 22px;
    line-height: 1.8;
    font-weight: 800;
}

.bp-lib-detail {
    border-top: 1px solid #e5e7eb;
    margin-top: 12px;
    padding-top: 12px;
}

@media (max-width: 1100px) {
    .bp-lib-grid {
        grid-template-columns: 1fr;
    }

    .bp-lib-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .bp-lib-filter-row input,
    .bp-lib-filter-row select {
        width: 100%;
        min-width: 100%;
    }

    .bp-lib-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* FIX: Download Forms Table View */

.download-group-section {
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.download-group-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.download-group-title {
    color: #0b2f4f;
    font-size: 18px;
    font-weight: 900;
}

.download-group-count {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    background: #eff6ff;
    color: #0f4c81;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 900;
}

.download-table-wrap {
    overflow: auto;
}

.download-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
}

.download-table th,
.download-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.download-table tr:last-child td {
    border-bottom: 0;
}

.download-table th {
    background: #ffffff;
    color: #0b2f4f;
    font-weight: 900;
    font-size: 13px;
}

.download-title-cell {
    color: #0b2f4f;
    font-weight: 900;
    line-height: 1.5;
}

.download-desc-cell {
    color: #64748b;
    line-height: 1.6;
    font-size: 13px;
}

.download-url-cell {
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.download-status-on {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    background: #dcfce7;
    color: #166534;
}

.download-status-off {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    background: #fee2e2;
    color: #991b1b;
}

.download-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.download-table-empty {
    border-radius: 20px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
    padding: 22px;
    line-height: 1.8;
    font-weight: 800;
}

/* FIX: Replace single logo with dual logo */

.dual-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 10px 14px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .10);
}

.dual-brand-logo img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    display: block;
}

.dual-brand-logo.login-size img {
    width: 78px;
    height: 78px;
}

.dual-brand-logo.app-size img {
    width: 48px;
    height: 48px;
}

.dual-brand-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dual-brand-logo-wrap.login-logo-replace {
    margin-bottom: 18px;
}

.dual-brand-logo-wrap.app-logo-replace {
    margin-bottom: 12px;
}

/* FIX: Hide old empty logo box on login */

#dualLogoLogin {
    display: none !important;
}

.login-logo:empty,
.system-logo:empty,
.brand-logo:empty,
.logo-wrap:empty,
.logo-box:empty,
.auth-logo:empty {
    display: none !important;
}

#loginDualLogoReplace {
    margin-bottom: 18px;
}

/* FINAL FIX: Login logo should show only dual logo */

#dualLogoLogin {
    display: none !important;
}

#loginDualLogoReplace {
    display: flex !important;
}

.login-card > .login-logo,
.login-card > .system-logo,
.login-card > .brand-logo,
.login-card > .logo-wrap,
.login-card > .logo-box,
.login-card > .auth-logo,
.login-card > .dual-logo-wrap:not(#loginDualLogoReplace),
.auth-card > .login-logo,
.auth-card > .system-logo,
.auth-card > .brand-logo,
.auth-card > .logo-wrap,
.auth-card > .logo-box,
.auth-card > .auth-logo,
.auth-card > .dual-logo-wrap:not(#loginDualLogoReplace),
.login-box > .login-logo,
.login-box > .system-logo,
.login-box > .brand-logo,
.login-box > .logo-wrap,
.login-box > .logo-box,
.login-box > .auth-logo,
.login-box > .dual-logo-wrap:not(#loginDualLogoReplace) {
    display: none !important;
}

/* FINAL V2: Keep only correct dual login logo */

#loginDualLogoReplace {
    display: flex !important;
}

#loginDualLogoReplace img {
    display: block !important;
}

#dualLogoLogin {
    display: none !important;
}

/* FINAL: Gateway dual logo */

.gateway-dual-logo-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.gateway-dual-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 26px;
    padding: 14px 18px;
    box-shadow: 0 14px 34px rgba(15, 76, 129, .12);
}

.gateway-dual-logo-box img {
    width: 82px;
    height: 82px;
    object-fit: contain;
    display: block;
}

.gateway-dual-logo-wrap .gateway-logo-text {
    display: none !important;
}

@media (max-width: 760px) {
    .gateway-dual-logo-box img {
        width: 68px;
        height: 68px;
    }
}

/* FINAL FIX: Gateway dual logo without old container */

.gateway-dual-logo-wrap {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    margin: 0 0 18px 0 !important;
    padding: 0 !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.gateway-dual-logo-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;

    width: auto !important;
    height: auto !important;

    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 26px !important;
    padding: 14px 18px !important;
    box-shadow: 0 14px 34px rgba(15, 76, 129, .12) !important;
}

.gateway-dual-logo-box img {
    width: 82px !important;
    height: 82px !important;
    object-fit: contain !important;
    display: block !important;
}

@media (max-width: 760px) {
    .gateway-dual-logo-box img {
        width: 68px !important;
        height: 68px !important;
    }
}

/* FINAL TUNE: ลดการเบียดกันของ Logo คู่กับข้อความในหน้าเว็บหลัก */

.app-logo-replace {
    margin-top: 4px !important;
    margin-bottom: 18px !important;
}

.app-logo-replace .dual-brand-logo {
    padding: 8px 11px !important;
    border-radius: 20px !important;
    gap: 10px !important;
}

.app-logo-replace .dual-brand-logo img {
    width: 42px !important;
    height: 42px !important;
    object-fit: contain !important;
}

/* เพิ่มระยะห่างระหว่างส่วนหัว sidebar กับเมนู/ข้อความถัดไป */
.sidebar-header,
.sidebar-brand,
.app-brand,
.brand-area {
    gap: 10px !important;
}

/* ถ้าข้อความชื่อระบบอยู่ชิด Logo มาก ให้เว้นลงมาอีกนิด */
.sidebar-header h1,
.sidebar-header h2,
.sidebar-header .brand-title,
.sidebar-header .brand-subtitle,
.app-brand h1,
.app-brand h2,
.app-brand .brand-title,
.app-brand .brand-subtitle {
    margin-top: 8px !important;
    line-height: 1.35 !important;
}

/* FIX: School PLC / Lesson Study Page */

.school-plc-hero {
    border-radius: 28px;
    padding: 24px;
    background: linear-gradient(135deg, #0f4c81, #22a06b);
    color: #ffffff;
    margin-bottom: 18px;
    box-shadow: 0 22px 50px rgba(15, 76, 129, .18);
}

.school-plc-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.35;
}

.school-plc-desc {
    margin-top: 8px;
    line-height: 1.8;
    opacity: .95;
}

.school-plc-grid {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.school-plc-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.school-plc-card h3 {
    margin-bottom: 12px;
    color: #0b2f4f;
}

.school-plc-note {
    border-left: 6px solid #0f4c81;
    background: #eff6ff;
    color: #0b2f4f;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.7;
    margin-bottom: 14px;
}

.school-plc-table-wrap {
    overflow: auto;
}

.school-plc-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
}

.school-plc-table th,
.school-plc-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 11px 12px;
    text-align: left;
    vertical-align: top;
}

.school-plc-table th {
    color: #0b2f4f;
    background: #f8fafc;
    font-weight: 900;
    font-size: 13px;
}

.school-plc-task-name {
    font-weight: 900;
    color: #0b2f4f;
    line-height: 1.5;
}

.school-plc-text {
    color: #475569;
    line-height: 1.65;
}

.school-plc-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.school-plc-status.submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.school-plc-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.school-plc-status.approved {
    background: #dcfce7;
    color: #166534;
}

.school-plc-status.revision {
    background: #fee2e2;
    color: #991b1b;
}

.school-plc-empty {
    border-radius: 18px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
    padding: 18px;
    line-height: 1.8;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .school-plc-grid {
        grid-template-columns: 1fr;
    }
}

/* STEP REVIEW-EVIDENCE: Review with evidence */

.wre-hero {
    border-radius: 28px;
    padding: 24px;
    background: linear-gradient(135deg, #0f4c81, #22a06b);
    color: #ffffff;
    margin-bottom: 18px;
    box-shadow: 0 22px 50px rgba(15, 76, 129, .18);
}

.wre-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.35;
}

.wre-desc {
    margin-top: 8px;
    line-height: 1.8;
    opacity: .95;
}

.wre-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.wre-filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.wre-filter-row input,
.wre-filter-row select {
    min-width: 220px;
}

.wre-list {
    display: grid;
    gap: 14px;
}

.wre-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(15, 76, 129, .06);
}

.wre-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.wre-work-title {
    color: #0b2f4f;
    font-weight: 900;
    font-size: 19px;
    line-height: 1.45;
}

.wre-meta {
    color: #64748b;
    line-height: 1.65;
    margin-top: 3px;
}

.wre-type-badge,
.wre-status-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.wre-type-badge {
    background: #eff6ff;
    color: #0f4c81;
    border: 1px solid #bfdbfe;
}

.wre-status-approved {
    background: #dcfce7;
    color: #166534;
}

.wre-status-revision {
    background: #fee2e2;
    color: #991b1b;
}

.wre-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.wre-detail {
    color: #475569;
    line-height: 1.75;
    margin: 10px 0 12px;
}

.wre-evidence-box {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 12px;
}

.wre-evidence-title {
    font-weight: 900;
    color: #0b2f4f;
    margin-bottom: 8px;
}

.wre-evidence-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 9px 0;
    border-bottom: 1px solid #e5e7eb;
}

.wre-evidence-row:last-child {
    border-bottom: 0;
}

.wre-evidence-name {
    font-weight: 800;
    color: #0f172a;
    line-height: 1.45;
}

.wre-evidence-meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.wre-review-box {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 140px;
    gap: 10px;
    align-items: start;
    margin-top: 12px;
}

.wre-empty {
    border-radius: 20px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
    padding: 22px;
    line-height: 1.8;
    font-weight: 800;
}

@media (max-width: 900px) {
    .wre-review-box {
        grid-template-columns: 1fr;
    }

    .wre-filter-row input,
    .wre-filter-row select {
        min-width: 100%;
        width: 100%;
    }
}