/* جداول الامتحانات + أبحاث الدراسات العليا */
.erh-page { padding: 24px 0 60px; min-height: 60vh; }
.erh-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.erh-page-header h2 { font-size: 1.6rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 10px; }
.erh-back-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid rgba(108,76,241,0.25); background: #fff; color: var(--primary, #6c4cf1); font-weight: 700; cursor: pointer; text-decoration: none; }
.erh-back-btn:hover { background: rgba(108,76,241,0.06); }

.erh-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.erh-hub-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 22px; cursor: pointer; transition: box-shadow .25s, border-color .25s; text-align: right; }
.erh-hub-card:hover { border-color: var(--primary, #6c4cf1); box-shadow: 0 12px 32px rgba(108,76,241,0.12); transform: translateY(-2px); }
.erh-hub-card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: #fff; }
.erh-hub-card h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; color: #0f172a; }
.erh-hub-card p { font-size: 0.85rem; color: #64748b; margin: 0; }

.erh-step-hint { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: #64748b; margin-bottom: 18px; padding: 10px 14px; background: #f8fafc; border-radius: 10px; border: 1px solid #e2e8f0; }
.erh-step-hint i { width: 16px; height: 16px; color: var(--primary, #6c4cf1); flex-shrink: 0; }
.erh-hub-card-meta { display: inline-block; margin-top: 10px; font-size: 0.78rem; font-weight: 700; color: var(--primary, #6c4cf1); background: rgba(108,76,241,0.08); padding: 3px 10px; border-radius: 999px; }

.erh-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; font-size: 0.85rem; color: #64748b; }
.erh-breadcrumb-link { background: none; border: none; color: var(--primary, #6c4cf1); font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; }
.erh-breadcrumb-link:hover { background: rgba(108,76,241,0.08); }
.erh-breadcrumb-sep { color: #cbd5e1; }

.erh-program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.erh-program-card { display: flex; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; cursor: pointer; transition: box-shadow .2s, border-color .2s, transform .2s; text-align: right; }
.erh-program-card:hover { border-color: var(--primary, #6c4cf1); box-shadow: 0 8px 24px rgba(108,76,241,0.1); transform: translateY(-1px); }
.erh-program-card-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, rgba(108,76,241,0.12), rgba(108,76,241,0.06)); display: flex; align-items: center; justify-content: center; color: var(--primary, #6c4cf1); flex-shrink: 0; }
.erh-program-card-body { flex: 1; min-width: 0; }
.erh-program-card h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; color: #0f172a; }
.erh-program-badge { font-size: 0.75rem; font-weight: 700; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 999px; }
.erh-program-chevron { width: 18px; height: 18px; color: #94a3b8; flex-shrink: 0; }

.erh-program-detail-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; margin-bottom: 24px; }
.erh-content-block { width: 100%; }
.erh-content-title { margin: 0 0 14px; font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.erh-download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.erh-section-title { font-size: 1rem; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; color: #334155; }

.erh-schedule-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #e2e8f0; -webkit-overflow-scrolling: touch; margin-top: 8px; }
.erh-schedule-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 560px; }
.erh-schedule-table thead { background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.erh-schedule-table th { padding: 12px 14px; text-align: right; font-weight: 800; color: #334155; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.erh-schedule-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; color: #475569; }
.erh-schedule-table tr:hover td { background: rgba(108,76,241,0.03); }

.erh-table-editor { margin-top: 8px; }
.erh-table-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.85rem; font-weight: 700; color: #475569; }
.erh-table-row-editor { display: grid; grid-template-columns: 1fr 1.2fr 0.8fr 0.8fr 1fr auto; gap: 6px; margin-bottom: 8px; align-items: center; }
.erh-upload-row { display: flex; flex-direction: column; gap: 8px; }
.erh-subjects-admin { border-top: 1px dashed #e2e8f0; padding-top: 8px; margin-top: 8px; }

.erh-program-block { margin-bottom: 32px; }
.erh-program-title { font-size: 1.15rem; font-weight: 800; color: #1e293b; padding: 12px 18px; background: linear-gradient(135deg, #f8fafc, #f1f5f9); border-radius: 12px; border-right: 4px solid var(--primary, #6c4cf1); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.erh-subject-list { display: flex; flex-direction: column; gap: 12px; }
.erh-subject-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.erh-subject-card h4 { margin: 0; font-size: 1rem; font-weight: 700; color: #0f172a; flex: 1; min-width: 180px; }
.erh-subject-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.erh-btn-sm { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; border: none; cursor: pointer; text-decoration: none; }
.erh-btn-primary { background: var(--primary, #6c4cf1); color: #fff; }
.erh-btn-outline { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.erh-text-preview { background: #f8fafc; border-radius: 12px; padding: 16px; margin-top: 12px; font-size: 0.9rem; line-height: 1.7; color: #334155; white-space: pre-wrap; border: 1px solid #e2e8f0; }

.erh-research-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.erh-research-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 22px; transition: box-shadow .25s; }
.erh-research-card:hover { box-shadow: 0 10px 28px rgba(15,23,42,0.08); }
.erh-research-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; margin-bottom: 10px; }
.erh-badge-published { background: #dcfce7; color: #166534; }
.erh-badge-proposal { background: #dbeafe; color: #1d4ed8; }
.erh-research-card h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 14px; line-height: 1.5; color: #0f172a; }
.erh-meta-row { display: flex; align-items: flex-start; gap: 8px; font-size: 0.85rem; color: #475569; margin-bottom: 8px; }
.erh-meta-row i { width: 16px; height: 16px; margin-top: 2px; color: var(--primary, #6c4cf1); flex-shrink: 0; }

.erh-admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.erh-admin-tab { padding: 10px 18px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; font-weight: 700; cursor: pointer; font-size: 0.9rem; }
.erh-admin-tab.active { background: var(--primary, #6c4cf1); color: #fff; border-color: var(--primary, #6c4cf1); }
.erh-nested-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.erh-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* أيقونات الهيرو — جداول الامتحانات + الأبحاث */
.erh-hero-hub-btn {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(108, 76, 241, 0.22) !important;
    background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95)) !important;
    box-shadow: 0 4px 18px rgba(108, 76, 241, 0.1);
    transition: transform .2s, box-shadow .25s, border-color .25s;
}
.erh-hero-hub-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(108, 76, 241, 0.16);
    border-color: rgba(108, 76, 241, 0.4) !important;
}
.erh-hero-hub-btn__ring {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.08), transparent 55%);
    pointer-events: none;
}
.erh-hero-hub-btn__ring--research {
    background: radial-gradient(circle at 30% 20%, rgba(124, 58, 237, 0.1), transparent 55%);
}
.erh-hero-hub-btn__icon { width: 18px; height: 18px; flex-shrink: 0; }
.erh-hero-research-btn .erh-hero-hub-btn__icon { color: #7c3aed !important; }
.erh-hero-exam-btn .erh-hero-hub-btn__icon { color: #2563eb !important; }

.erh-page-subtitle { margin: 6px 0 0; font-size: 0.92rem; color: #64748b; font-weight: 500; }
.erh-research-public-body { padding: 20px 24px 28px; border-radius: 16px; }

.erh-research-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.erh-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all .2s;
}
.erh-filter-chip:hover { border-color: #c4b5fd; color: #6c4cf1; }
.erh-filter-chip.active {
    background: linear-gradient(135deg, #6c4cf1, #7c3aed);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(108, 76, 241, 0.28);
}
.erh-filter-count {
    background: rgba(255,255,255,0.25);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}
.erh-filter-chip:not(.active) .erh-filter-count { background: #f1f5f9; color: #64748b; }

.erh-research-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}
.erh-research-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 720px;
}
.erh-research-table thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
.erh-research-table th {
    padding: 14px 16px;
    text-align: right;
    font-weight: 800;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.erh-research-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    vertical-align: middle;
}
.erh-research-row:hover td { background: rgba(108, 76, 241, 0.03); }
.erh-td-title { font-weight: 700; color: #0f172a; max-width: 280px; line-height: 1.5; }
.erh-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.erh-type-pub { background: #dcfce7; color: #166534; }
.erh-type-prop { background: #dbeafe; color: #1d4ed8; }
.erh-table-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(108, 76, 241, 0.08);
    color: #6c4cf1;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
}
.erh-table-link:hover { background: #6c4cf1; color: #fff; }
.erh-research-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}
.erh-research-empty i { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.5; }

@media (max-width: 768px) {
    .erh-page-header h2 { font-size: 1.25rem; }
    .erh-hub-grid, .erh-research-grid, .erh-program-grid { grid-template-columns: 1fr; }
    .erh-program-card { padding: 14px; }
    .erh-table-row-editor { grid-template-columns: 1fr 1fr; }
    .erh-table-row-editor .btn-text { grid-column: span 2; justify-self: end; }
    .erh-schedule-table { min-width: 0; }
    .erh-schedule-table thead { display: none; }
    .erh-schedule-table tbody tr { display: block; margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 4px 0; background: #fff; }
    .erh-schedule-table tbody td { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border: none; border-bottom: 1px solid #f8fafc; }
    .erh-schedule-table tbody td:last-child { border-bottom: none; }
    .erh-schedule-table tbody td::before { content: attr(data-label); font-weight: 800; color: #64748b; font-size: 0.76rem; flex-shrink: 0; }
    .erh-breadcrumb { font-size: 0.78rem; }
    .erh-research-public-body { padding: 14px 12px 20px; }
    .erh-research-table { min-width: 0; }
    .erh-research-table thead { display: none; }
    .erh-research-table tr.erh-research-row {
        display: block;
        margin-bottom: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 4px 0;
        background: #fff;
    }
    .erh-research-table tr.erh-research-row td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 14px;
        border: none;
        border-bottom: 1px solid #f8fafc;
    }
    .erh-research-table tr.erh-research-row td:last-child { border-bottom: none; }
    .erh-research-table tr.erh-research-row td::before {
        content: attr(data-label);
        font-weight: 800;
        color: #64748b;
        font-size: 0.78rem;
        flex-shrink: 0;
    }
    .erh-td-title { max-width: none; text-align: left; }
}
