/* ============================================================
   Sub-Revision Styles
   ใช้ร่วมกันในหน้าปรับปรุงรายวิชา (SubjectManagementTabForm)
   และหน้าอาจารย์ (CourseLecturerTabForm, ProgramDirectorTabForm)
   ============================================================ */

/* ── Subject Management header ──────────────────────────── */
.cst-page-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #335c81 100%);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 14px 28px rgba(30, 58, 95, 0.12);
}

.cst-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.cst-header-title {
    color: white !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
}

.cst-header-subtitle {
    color: rgba(255,255,255,0.78) !important;
    margin-top: 2px;
}

.cst-count-chip {
    background: rgba(255,255,255,0.14) !important;
    color: white !important;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.26) !important;
    backdrop-filter: blur(8px);
}

/* ── Subject revision card tabs ──────────────────────────── */
.rev-card-tabs-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rev-card-tab {
    flex: 0 0 auto;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 12px 12px;
    border: 1.5px solid #e5e7eb;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    background: #f9fafb;
    text-align: center;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.rev-card-tab:hover { background: #f3f4f6; }

.rev-card-tab__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #9ca3af;
}

.rev-card-tab__count {
    font-size: 0.72rem;
    color: #9ca3af;
}

/* Previous revision tab */
.rev-card-tab--prev {
    border-color: #fed7aa;
    background: #fff7ed;
}
.rev-card-tab--prev .rev-card-tab__title { color: #c2410c; }
.rev-card-tab--prev .rev-card-tab__count { color: #ea580c; }
.rev-card-tab--prev:hover { background: #ffedd5; }
.rev-card-tab--prev.rev-card-tab--active-select {
    background: #fff7ed;
    border-color: #f97316;
}
.rev-card-tab--prev.rev-card-tab--active-select .rev-card-tab__title { color: #9a3412; font-weight: 800; }

/* Active: เลือกวิชา */
.rev-card-tab--active-select {
    background: white;
    border-color: #6b7280;
}
.rev-card-tab--active-select .rev-card-tab__title { color: #374151; }
.rev-card-tab--active-select .rev-card-tab__count { color: #6b7280; }

/* Active: วิชาที่เลือก (orange) */
.rev-card-tab--edit {
    border-color: #fed7aa;
    background: #fff7ed;
}
.rev-card-tab--edit .rev-card-tab__title { color: #c2410c; }
.rev-card-tab--edit .rev-card-tab__count { color: #ea580c; }
.rev-card-tab--edit:hover { background: #ffedd5; }

.rev-card-tab--active-edit {
    background: #fff7ed;
    border-color: #f97316;
}
.rev-card-tab--active-edit .rev-card-tab__title { color: #9a3412; }

/* Revision detail cards */
.rev-detail-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.rev-detail-section__heading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rev-detail-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rev-detail-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-width: 160px;
    flex: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.rev-detail-card__label {
    font-size: 0.70rem;
    color: #9ca3af;
    font-weight: 500;
}

.rev-detail-card__value {
    font-size: 0.92rem;
    color: #111827;
    font-weight: 600;
}

/* Content box below subject revision card tabs */
.rev-card-content {
    border: 1.5px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: white;
    min-height: 100px;
}

/* ── Lecturer revision tabs (อาจารย์ผู้สอน / อาจารย์ประจำหลักสูตร) ── */
.lec-form-rev-tabs-row {
    display: flex;
    gap: 10px;
}

.lec-form-rev-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 12px 12px;
    border: 1.5px solid #e5e7eb;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    background: #f9fafb;
    text-align: center;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.lec-form-rev-tab:hover { background: #f3f4f6; }

.lec-form-rev-tab__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #9ca3af;
}

.lec-form-rev-tab__count {
    font-size: 0.72rem;
    color: #9ca3af;
}

.lec-form-rev-tab--active-before {
    background: white;
    border-color: #6b7280;
}
.lec-form-rev-tab--active-before .lec-form-rev-tab__title { color: #374151; }
.lec-form-rev-tab--active-before .lec-form-rev-tab__count { color: #6b7280; }

.lec-form-rev-tab--edit {
    border-color: #fed7aa;
    background: #fff7ed;
}
.lec-form-rev-tab--edit .lec-form-rev-tab__title { color: #c2410c; }
.lec-form-rev-tab--edit .lec-form-rev-tab__count { color: #ea580c; }
.lec-form-rev-tab--edit:hover { background: #ffedd5; }

.lec-form-rev-tab--active-edit {
    background: #fff7ed;
    border-color: #f97316;
}
.lec-form-rev-tab--active-edit .lec-form-rev-tab__title { color: #9a3412; }

.lec-form-rev-content {
    border: 1.5px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: white;
    padding: 16px;
    min-height: 100px;
}
