:root {
    --primary-color: #236b8c;
    --primary-dark: #17506b;
    --accent-color: #2e86ad;
    --accent-light: #d6e9f1;
    --border-color: #e4e0d9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --panel-dark: #17506b;
    --panel-dark-2: #236b8c;
    --gold: #a8813f;
    --gold-light: #fef3c7;
}

/* ─── شعار الحلقة (محسّن) ─── */
.circle-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.circle-logo__frame {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    transition: transform 0.35s ease;
}

.circle-logo__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    border-radius: 50%;
}

/* يخفي الخلفية البيضاء للصورة على الخلفيات الفاتحة */
.circle-logo__frame,
.circle-logo--header-brand,
.circle-logo--hero-brand {
    background: transparent !important;
    box-shadow: none !important;
}

.circle-logo__ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.circle-logo__ring--outer {
    inset: -4px;
    border: 1px solid rgba(20, 58, 77, 0.14);
    animation: none;
}

.circle-logo__ring--inner {
    display: none;
}

@keyframes logoRingPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes logoHalo {
    from { opacity: 0.45; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1.08); }
}

.circle-logo--hero {
    width: auto;
    height: auto;
    margin: 0 auto 14px;
    animation: logoFadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.circle-logo--hero::before {
    display: none;
}

.circle-logo--hero .circle-logo__frame {
    width: min(176px, 58vw);
    height: min(176px, 58vw);
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
}

.circle-logo--hero .circle-logo__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

.circle-logo--hero .circle-logo__ring--outer {
    inset: -3px;
    border-color: rgba(20, 58, 77, 0.12);
}

.circle-logo--hero:hover .circle-logo__frame {
    transform: scale(1.02);
}

/* ─── شعار الهيدر — دائري مع قص الحواف ─── */
.circle-logo--header-brand {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    padding: 0;
    background: #f7f5f1;
    border: 1px solid rgba(20, 58, 77, 0.12);
    box-shadow: none;
    overflow: hidden;
    transition: border-color 0.25s ease;
}

.circle-logo--header-brand:hover {
    border-color: rgba(20, 58, 77, 0.22);
    transform: none;
}

.circle-logo--header-brand .circle-logo__frame {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
}

.circle-logo--header-brand .circle-logo__img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 30%;
}

.circle-logo--hero-brand {
    width: min(176px, 58vw);
    height: min(176px, 58vw);
    padding: 0;
    border-radius: 50%;
    background: #f7f5f1;
    border: 1px solid rgba(20, 58, 77, 0.12);
    box-shadow: none;
    overflow: hidden;
}

.circle-logo--hero-brand .circle-logo__frame {
    width: 100%;
    height: 100%;
    padding: 0;
}

.circle-logo--hero-brand .circle-logo__img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 30%;
}

.page-header {
    background: linear-gradient(135deg, rgba(248,250,252,0.98) 0%, rgba(241,245,249,0.96) 100%);
    backdrop-filter: blur(6px);
}

.login-choice-box .circle-logo__img {
    object-fit: cover;
}

.brand-logo-header {
    display: flex; align-items: center; gap: 16px; min-width: 0;
}

.circle-logo--simple {
    width: auto;
    height: auto;
    flex-shrink: 0;
}
.circle-logo--simple .circle-logo__frame {
    width: auto;
    height: auto;
    padding: 3px 8px;
    box-shadow: 0 2px 8px rgba(20, 58, 77, 0.1);
}
.circle-logo--simple .circle-logo__img {
    height: 52px;
    width: auto;
    max-width: 130px;
}
.circle-logo--presentation {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid rgba(20, 58, 77, 0.12);
    background: #f7f5f1;
    overflow: hidden;
}
.circle-logo--presentation .circle-logo__frame {
    width: 100%;
    height: 100%;
    padding: 0;
}
.circle-logo--presentation .circle-logo__img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 30%;
}
.circle-logo--modal { width: 100px; height: 100px; margin: 0 auto 14px; }
.circle-logo--modal .circle-logo__frame { width: 100%; height: 100%; padding: 10px; }
.circle-logo--footer .circle-logo__frame { width: 40px; height: 40px; padding: 5px; }

.login-brand-block { margin-bottom: 6px; }
.login-brand-subtitle { font-size: 0.82rem; color: #1a4358; font-weight: 800; margin: 0 0 10px; letter-spacing: 0.01em; }
.brand-text-group h1 { font-size: 1.35rem; margin: 0; font-weight: 800; color: var(--primary-dark); line-height: 1.35; }
.brand-text-group span { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 700; margin-top: 2px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ─── قائمة ⋮ للمشرف ─── */
.admin-top-header { position: relative; z-index: 100; }
.admin-header-start { display: flex; align-items: center; gap: 12px; min-width: 0; }

.admin-menu-wrap { position: relative; flex-shrink: 0; }

.admin-menu-btn {
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff; color: var(--primary-dark);
    cursor: pointer; font-size: 1.15rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06));
    transition: 0.2s;
}
.admin-menu-btn:hover {
    background: var(--accent-light);
    border-color: #8fc4da;
    color: var(--primary-color);
}

.admin-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 8px;
    z-index: 200;
    animation: menuDrop 0.2s ease;
}
@keyframes menuDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-menu-item {
    width: 100%; border: none; background: transparent;
    padding: 12px 14px; border-radius: 10px;
    font-family: 'Tajawal', sans-serif; font-weight: 800; font-size: 0.92rem;
    color: var(--text-main); cursor: pointer;
    display: flex; align-items: center; gap: 10px; text-align: right;
    transition: 0.15s;
}
.admin-menu-item:hover {
    background: var(--accent-light);
    color: var(--primary-dark);
}
.admin-menu-item i { color: var(--primary-color); width: 20px; text-align: center; }

/* ─── صفحات فرعية للمشرف ─── */
.admin-view { animation: adminViewIn 0.25s ease; }
@keyframes adminViewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.admin-back-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--border-color);
    color: var(--primary-dark); padding: 10px 16px;
    border-radius: 10px; font-family: 'Tajawal', sans-serif;
    font-weight: 800; font-size: 0.88rem; cursor: pointer;
    margin-bottom: 18px; transition: 0.2s;
}
.admin-back-btn:hover { background: var(--accent-light); border-color: #8fc4da; }

.admin-subpage-head {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 18px; padding-bottom: 16px;
    border-bottom: 2px solid #eaf3f7;
}
.admin-subpage-title { margin: 0; font-size: 1.35rem; color: var(--primary-dark); font-weight: 800; }
.admin-subpage-desc { margin: 4px 0 0; font-size: 0.82rem; color: var(--text-muted); font-weight: 700; }
.admin-subpage-panel { margin-bottom: 24px; }

.chart-day-badge-lg { font-size: 0.95rem; padding: 8px 16px; margin-inline-start: auto; }

.excellence-list-full { max-height: none; min-height: 200px; }
.excellence-list-full .excellence-item { padding: 16px 20px; font-size: 1rem; }

.admin-home-knight { max-width: 420px; margin: 0 auto 22px; }

/* ─── نسبة الإنجاز ─── */
.progress-week-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 14px; margin-bottom: 18px;
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 14px; padding: 14px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.progress-week-select-wrap {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.progress-week-select-wrap label {
    font-weight: 800; color: var(--primary-dark); font-size: 0.88rem;
    display: inline-flex; align-items: center; gap: 6px;
}
.progress-week-select-wrap select {
    min-width: min(100%, 320px); padding: 8px 12px; border-radius: 10px;
    border: 2px solid #b9d8e6; font-family: 'Tajawal', sans-serif;
    font-weight: 700; font-size: 0.85rem; background: #fff;
}
.progress-week-summary { flex: 1; min-width: 220px; }
.progress-summary-card {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px;
    font-size: 0.82rem; font-weight: 700; color: #475569;
}
.progress-summary-label { color: var(--primary-dark); font-weight: 800; }
.progress-summary-stat strong { color: var(--primary-dark); }

.progress-table-wrap {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.progress-table { width: 100%; border-collapse: collapse; text-align: right; }
.progress-table th {
    background: var(--primary-dark); color: #b9d8e6;
    padding: 14px 16px; font-weight: 800; font-size: 0.82rem;
    white-space: nowrap;
}
.progress-table td {
    padding: 14px 16px; border-bottom: 1px solid #f2efe9;
    vertical-align: middle; font-size: 0.88rem;
}
.progress-table tbody tr:last-child td { border-bottom: none; }
.progress-table tbody tr:hover { background: #f7f5f1; }
.progress-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: #eaf3f7; color: var(--primary-dark);
    font-weight: 800; font-size: 0.82rem;
}
.progress-score-text { font-weight: 800; color: var(--primary-dark); }
.progress-score-text small { font-weight: 700; color: #94a3b8; font-size: 0.75rem; }
.progress-bar-cell {
    display: flex; align-items: center; gap: 10px; min-width: 140px;
}
.progress-bar-track {
    flex: 1; height: 10px; background: #e4e0d9;
    border-radius: 999px; overflow: hidden; min-width: 80px;
}
.progress-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.progress-bar-fill.high { background: linear-gradient(90deg, #2e86ad, #26749a); }
.progress-bar-fill.mid { background: linear-gradient(90deg, #f59e0b, #a8813f); }
.progress-bar-fill.low { background: linear-gradient(90deg, #f87171, #ef4444); }
.progress-percent { font-weight: 800; font-size: 0.82rem; min-width: 42px; }
.progress-percent.high { color: #26749a; }
.progress-percent.mid { color: #a8813f; }
.progress-percent.low { color: #dc2626; }
.progress-days-note {
    display: block; margin-top: 4px; font-size: 0.72rem;
    color: #94a3b8; font-weight: 700;
}
.progress-day-pills {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.progress-day-pill {
    display: inline-flex; flex-direction: column; align-items: center;
    min-width: 46px; padding: 4px 6px; border-radius: 8px;
    border: 1px solid #e4e0d9; background: #f7f5f1;
    font-size: 0.68rem; font-weight: 800; line-height: 1.2;
}
.progress-day-pill-name { color: #64748b; }
.progress-day-pill-score { color: var(--primary-dark); font-size: 0.75rem; }
.progress-day-pill.full { background: #eaf3f7; border-color: #8fc4da; }
.progress-day-pill.partial { background: #fffbeb; border-color: #fcd34d; }
.progress-day-pill.empty { opacity: 0.65; }

.progress-empty-state {
    text-align: center; padding: 48px 20px; color: #94a3b8;
    background: #fff; border: 1px dashed #d5d0c6; border-radius: 16px;
}
.progress-empty-state i { font-size: 2rem; margin-bottom: 10px; display: block; }
.progress-empty-state p { margin: 0; font-weight: 800; }

@media (max-width: 900px) {
    .progress-table thead { display: none; }
    .progress-table, .progress-table tbody, .progress-table tr, .progress-table td {
        display: block; width: 100%;
    }
    .progress-table tr {
        padding: 14px; border-bottom: 1px solid #e4e0d9;
    }
    .progress-table td {
        padding: 6px 0; border: none;
        display: flex; justify-content: space-between; align-items: center;
        gap: 12px;
    }
    .progress-table td::before {
        content: attr(data-label);
        font-weight: 800; color: #64748b; font-size: 0.75rem;
        flex-shrink: 0;
    }
    .progress-table td[data-label="#"] { display: none; }
    .progress-bar-cell { min-width: 0; flex: 1; }
}

.news-admin-panel--page { margin-bottom: 0; }
.btn-save-all { background: var(--accent-color) !important; margin: 0; padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn-add-compact { margin: 0; padding: 6px 14px; font-size: .8rem; border-radius: 8px; }
.btn-search-students {
    background: #fff;
    color: #236b8c;
    border: 1px solid #b9d8e6;
}
.btn-search-students:hover { background: #eaf3f7; }

.recorder-detail-section {
    margin: 12px 0 8px;
    color: #236b8c;
    font-weight: 800;
    font-size: 0.9rem;
}
.recorder-detail-who {
    display: block;
    color: #16303d;
    margin-bottom: 4px;
}
.recorder-detail-box h3 {
    margin: 0 0 12px;
    color: #17506b;
    font-size: 1.1rem;
    text-align: center;
}
.recorder-detail-entry {
    background: #f7f5f1;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.recorder-detail-entry p {
    margin: 6px 0 0;
    font-weight: 700;
    color: #16303d;
    line-height: 1.6;
    text-align: right;
}
.recorder-detail-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #236b8c;
    font-weight: 800;
    font-size: 0.85rem;
}
.recorder-detail-empty {
    text-align: center;
    color: #64748b;
    font-weight: 700;
}
.recorder-detail-box .app-confirm-no {
    width: 100%;
    margin-top: 8px;
}

.logs-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.logs-filter-btn {
    border: 1px solid #b9d8e6;
    background: #fff;
    color: #236b8c;
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
}
.logs-filter-btn.is-active {
    background: #236b8c;
    color: #fff;
    border-color: #236b8c;
}
.logs-section {
    background: #fff;
    border: 1px solid #d6e9f1;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.logs-section h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #236b8c;
}
.logs-device-block h3 + h3,
.logs-device-block .logs-account-list + h3,
.logs-device-block .logs-empty + h3 {
    margin-top: 16px;
}
.logs-empty { margin: 0; color: #64748b; font-weight: 700; }
.logs-highlight {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #eaf3f7;
    border-radius: 12px;
    padding: 12px 14px;
}
.logs-highlight strong { font-size: 1.15rem; color: #17506b; }
.logs-device-card {
    background: #f7f5f1;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.logs-device-card p { margin: 4px 0 0; font-weight: 700; color: #334155; font-size: 0.9rem; }
.logs-device-head {
    font-weight: 800;
    color: #16303d;
}
.logs-device-block .logs-device-head {
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.logs-device-time {
    margin: 0 0 14px;
    color: #236b8c;
    font-weight: 800;
    font-size: 0.88rem;
}
.logs-account-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.logs-account-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
    background: #eaf3f7;
    border-radius: 12px;
    padding: 10px 12px;
}
.logs-account-kind {
    background: #236b8c;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 800;
}
.logs-account-list strong { color: #064e3b; }
.logs-account-list span { color: #334155; font-weight: 700; font-size: 0.82rem; }
.logs-day-title {
    margin: 14px 0 8px;
    font-size: 0.92rem;
    color: #64748b;
}
.logs-event-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #f7f5f1;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.logs-event-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: #eaf3f7;
    color: #236b8c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logs-event-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.logs-event-body strong { color: #16303d; }
.logs-event-title { font-weight: 800; color: #236b8c; }
.logs-event-meta { color: #64748b; font-size: 0.8rem; font-weight: 700; }
.admin-student-card.is-search-focus {
    outline: 3px solid #5aa3c4;
    box-shadow: 0 0 0 6px rgba(46, 134, 173, 0.18);
}

.student-search-modal { max-width: 440px; width: min(92vw, 440px); }
.student-search-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(55vh, 420px);
    overflow: auto;
    margin-top: 4px;
    padding: 2px 2px 6px;
}
.student-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: right;
    background: #f7f5f1;
    border: 1px solid #e4e0d9;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 800;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
}
.student-search-item:hover {
    background: #eaf3f7;
    border-color: #8fc4da;
    color: #236b8c;
}
.student-search-empty {
    text-align: center;
    padding: 18px 8px;
    color: #64748b;
    font-weight: 700;
}

#adminNameInput {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d5d0c6;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

/* ─── أخبار المشرف ─── */
.news-admin-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f0f6f9 100%);
    border: 1px solid #b9d8e6;
    border-radius: 18px;
    padding: 0;
    margin-bottom: 25px;
    box-shadow: 0 8px 24px rgba(35, 107, 140, 0.1);
    overflow: hidden;
}

.news-admin-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--panel-dark), var(--panel-dark-2));
    color: #fff;
}

.news-admin-title-wrap { display: flex; align-items: center; gap: 14px; }
.news-admin-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.news-admin-header h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.news-admin-header p { margin: 4px 0 0; font-size: .78rem; opacity: .85; font-weight: 600; }

.news-toggle-btn {
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
    color: #fff; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
}

.news-admin-body { padding: 22px; }
.news-admin-body.collapsed { display: none; }

.news-form-grid { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }

.news-file-drop {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 22px; border: 2px dashed #8fc4da; border-radius: 14px;
    background: #eaf3f7; cursor: pointer; transition: .2s;
    text-align: center; color: var(--primary-dark); font-weight: 700;
}
.news-file-drop:hover { background: #d6e9f1; border-color: var(--accent-color); }
.news-file-drop small { font-size: .75rem; color: var(--text-muted); font-weight: 600; }

.news-file-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.news-preview-item {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 10px; padding: 8px 12px; font-size: .82rem; font-weight: 700;
}
.news-preview-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.news-preview-remove {
    background: #fee2e2; border: none; color: #ef4444;
    width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
}

.news-send-btn { margin-top: 8px; width: 100%; justify-content: center; }

.news-cancel-edit-btn {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
}

.news-edit-banner {
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: #eaf3f7;
    border: 1px solid #b9d8e6;
    color: #236b8c;
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-admin-history h4 {
    font-size: .95rem; color: var(--primary-dark); margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
    border-top: 2px solid #eaf3f7; padding-top: 18px;
}

.news-admin-list { display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow-y: auto; }

.news-admin-item {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 14px; padding: 14px 16px;
}

.news-admin-item-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px;
}
.news-admin-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.news-edit-btn {
    background: #eaf3f7;
    border: none;
    color: #26749a;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}
.news-edit-btn:hover { background: #d6e9f1; }

.news-delete-btn {
    background: #fee2e2; border: none; color: #ef4444;
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
}
.news-admin-item-head h5 { margin: 0; font-size: .95rem; color: var(--text-main); }
.news-admin-item-head time { font-size: .75rem; color: var(--text-muted); font-weight: 700; display: block; margin-top: 4px; }
.news-admin-body-text { font-size: .88rem; color: #475569; line-height: 1.6; margin-bottom: 10px; }

.news-preview-item--saved {
    background: #f0f6f9;
    border: 1px solid #bbf7d0;
}

.news-empty-state {
    text-align: center; padding: 24px; color: var(--text-muted);
    font-weight: 700; font-size: .9rem;
}
.news-empty-state i { display: block; font-size: 1.8rem; margin-bottom: 8px; opacity: .5; }

.news-attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.news-attachments.inline { margin-top: 12px; }

.news-attachment-image {
    margin: 0; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border-color); max-width: 100%;
}
.news-attachment-image img { display: block; max-width: 100%; max-height: 280px; object-fit: contain; }

.news-attachment-pdf, .news-attachment-file {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 10px;
    background: #fef2f2; color: #b91c1c; font-weight: 800; font-size: .85rem;
    text-decoration: none; border: 1px solid #fecaca;
}
.news-attachment-file { background: #f2efe9; color: #334155; border-color: var(--border-color); }

.admin-subpage-icon,
.panel-section-icon,
.student-news-page-icon {
    width: 48px; height: 48px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #eaf3f7, #d6e9f1);
    color: var(--primary-dark); font-size: 1.15rem;
    border: 1px solid #b9d8e6;
}

.student-push-banner {
    margin: 0 0 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #eff6ff, #eaf3f7);
    border: 1px solid #93c5fd;
    border-radius: 14px;
}
.student-push-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 800;
    font-size: 0.86rem;
    color: #1e3a5f;
}
.student-push-banner-inner i { color: #2563eb; font-size: 1.1rem; }
.student-push-banner-inner span { flex: 1; min-width: 180px; }
.student-push-enable-btn {
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
}
.student-push-enable-btn:hover { background: #1d4ed8; }
.login-choice-box--compact { padding-top: 32px; }
.login-choice-box--compact h2 { margin-top: 0; }

.student-quick-login-lead {
    color: var(--text-muted);
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.student-quick-login-btn {
    margin-bottom: 10px;
}

.student-quick-login-btn strong {
    font-weight: 800;
}

.student-other-code-btn {
    margin-top: 4px;
}

#studentQuickLoginBlock .btn-primary-custom,
#studentQuickLoginBlock .btn-secondary-custom {
    width: 100%;
}

#studentCodeEntryBlock[hidden] {
    display: none !important;
}

/* ─── أخبار الجواد ─── */
.btn-student-news-mini {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    background: #eaf3f7; color: var(--primary-dark);
    border: 1px solid #b9d8e6; padding: 8px 14px;
    border-radius: 10px; font-family: 'Tajawal', sans-serif;
    font-weight: 800; font-size: 0.82rem; cursor: pointer; transition: 0.2s;
}
.btn-student-news-mini:hover { background: #d6e9f1; border-color: var(--accent-color); transform: translateY(-1px); }
.student-news-badge {
    position: absolute; top: -6px; inset-inline-start: -6px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: #ef4444; color: #fff; border-radius: 999px;
    font-size: 0.65rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

.student-home-news {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e4e0d9;
    border-radius: 16px;
}
.student-home-news-head h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.student-home-news-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: right;
    border: 1px solid #e4e0d9;
    background: #f7f5f1;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-family: inherit;
}
.student-home-news-item strong {
    color: #1f6280;
    font-size: 0.95rem;
}
.student-home-news-item span {
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.45;
}
.student-home-news-item time {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
}
.student-home-news-item.unread {
    border-color: #8fc4da;
    background: linear-gradient(135deg, #fff 0%, #f0f6f9 100%);
}
.student-news-alert {
    width: 100%; margin: 0 0 18px; padding: 0;
    background: linear-gradient(135deg, #eaf3f7 0%, #fff 100%);
    border: 1px solid #8fc4da; border-inline-start: 4px solid var(--accent-color);
    border-radius: 14px; cursor: pointer; font-family: 'Tajawal', sans-serif;
    box-shadow: 0 4px 16px rgba(35, 107, 140, 0.1);
    animation: newsAlertIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: box-shadow 0.2s, transform 0.2s;
}
.student-news-alert:hover {
    box-shadow: 0 8px 24px rgba(35, 107, 140, 0.16);
    transform: translateY(-1px);
}
.student-news-alert-inner {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; text-align: right;
}
.student-news-alert-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--panel-dark), var(--accent-color));
    color: #fff; border-radius: 12px; font-size: 1.1rem;
}
.student-news-alert-body { flex: 1; min-width: 0; }
.student-news-alert-label {
    display: block; font-size: 0.72rem; font-weight: 800;
    color: var(--accent-color); text-transform: none; margin-bottom: 3px;
}
.student-news-alert-body strong {
    display: block; font-size: 0.95rem; font-weight: 800;
    color: var(--primary-dark); line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.student-news-alert-action {
    flex-shrink: 0; font-size: 0.78rem; font-weight: 800;
    color: var(--primary-dark); white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px;
}
@keyframes newsAlertIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.student-view { animation: adminViewIn 0.25s ease; }
.student-news-page-head {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid #eaf3f7;
}
.student-news-archive-list { display: flex; flex-direction: column; gap: 10px; }
.student-news-past-btn {
    width: 100%; margin-top: 18px; padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #fff; border: 1px solid #e4e0d9; border-radius: 14px;
    font-family: 'Tajawal', sans-serif; font-size: 0.95rem; font-weight: 800;
    color: var(--primary-dark); cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.student-news-past-btn:hover {
    border-color: #94a3b8; background: #f7f5f1;
}
.student-news-past-btn span { flex: 1; text-align: right; }
.student-news-section { display: flex; flex-direction: column; gap: 10px; }
.student-news-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 0;
}
.student-news-section-head h3 {
    margin: 0; font-size: 0.95rem; font-weight: 800; color: var(--primary-dark);
    display: flex; align-items: center; gap: 8px;
}
.student-news-section-count {
    background: #dcfce7; color: #166534; min-width: 22px; height: 22px;
    padding: 0 7px; border-radius: 999px; font-size: 0.72rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.student-news-section-past .student-news-section-count {
    background: #f2efe9; color: #475569;
}
.student-news-section-empty {
    margin: 0; padding: 12px 14px; border-radius: 12px;
    background: #f7f5f1; color: #64748b; font-size: 0.86rem; font-weight: 700;
}
.student-news-archive-item {
    width: 100%; text-align: right; background: #fff;
    border: 1px solid var(--border-color); border-radius: 14px;
    padding: 0; cursor: pointer; font-family: 'Tajawal', sans-serif;
    transition: 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    overflow: hidden;
}
.student-news-archive-item:hover {
    border-color: #8fc4da; box-shadow: 0 6px 18px rgba(35, 107, 140, 0.1); transform: translateY(-1px);
}
.student-news-archive-item.unread {
    border-color: #8fc4da;
    background: linear-gradient(135deg, #fff 0%, #f0f6f9 100%);
}
.student-news-archive-item-inner {
    display: flex; align-items: stretch; gap: 0;
}
.student-news-archive-accent {
    width: 4px; flex-shrink: 0; background: transparent;
}
.student-news-archive-item.unread .student-news-archive-accent {
    background: linear-gradient(180deg, var(--accent-color), var(--primary-dark));
}
.student-news-archive-main { flex: 1; padding: 16px 18px; min-width: 0; }
.student-news-archive-item-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 8px;
}
.student-news-archive-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
}
.student-news-archive-meta time { color: var(--text-muted); }
.student-news-unread-pill {
    background: #dcfce7; color: #166534; padding: 2px 8px;
    border-radius: 999px; font-size: 0.68rem; font-weight: 800;
}
.student-news-past-pill {
    background: #f2efe9; color: #475569; padding: 2px 8px;
    border-radius: 999px; font-size: 0.68rem; font-weight: 800;
}
.student-news-archive-text h4 {
    margin: 0; font-size: 1rem; color: var(--primary-dark);
    font-weight: 800; line-height: 1.45;
}
.student-news-archive-preview {
    margin: 0 0 10px; font-size: 0.86rem; color: #475569;
    line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.student-news-archive-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding-top: 8px; border-top: 1px solid #f2efe9;
}
.student-news-attach-hint {
    font-size: 0.72rem; font-weight: 700; color: #64748b;
    display: inline-flex; align-items: center; gap: 4px;
}
.student-news-archive-open {
    font-size: 0.78rem; font-weight: 800; color: var(--accent-color);
    display: inline-flex; align-items: center; gap: 4px;
}
.student-news-detail-card {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 18px; padding: 0; overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.student-news-detail-topbar {
    background: linear-gradient(135deg, var(--panel-dark), var(--accent-color));
    padding: 14px 20px; color: #fff;
}
.student-news-detail-from {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 800; opacity: 0.95;
}
.student-news-detail-head {
    padding: 22px 22px 0;
}
.student-news-detail-head h2 {
    margin: 10px 0 0; font-size: 1.35rem; color: var(--primary-dark);
    font-weight: 800; line-height: 1.45;
}
.student-news-detail-head time {
    display: block; margin-top: 8px; font-size: 0.78rem;
    color: var(--text-muted); font-weight: 700;
}
.student-news-detail-body-wrap { padding: 18px 22px 22px; }
.student-news-detail-body {
    font-size: 1rem; color: #334155; line-height: 1.85;
    margin-bottom: 0; white-space: pre-wrap;
}
.student-news-detail-attachments {
    margin-top: 20px; padding-top: 16px; border-top: 2px solid #f2efe9;
}
.student-news-detail-attachments h5 {
    margin: 0 0 12px; font-size: 0.85rem; color: var(--primary-dark);
    font-weight: 800; display: flex; align-items: center; gap: 6px;
}

/* ─── لوحة المشرف ─── */
.dashboard-grid-layout {
    display: grid; grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 20px; margin-bottom: 25px;
}
@media (max-width: 900px) { .dashboard-grid-layout { grid-template-columns: 1fr; } }

.unified-control-panel {
    background: linear-gradient(135deg, var(--panel-dark), var(--panel-dark-2));
    border-radius: 16px; padding: 16px 20px; margin-bottom: 25px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 15px; position: relative; overflow: hidden;
    box-shadow: 0 8px 20px rgba(35, 107, 140, 0.15);
    border: 1px solid rgba(255,255,255,0.1);
}
.unified-control-panel > * { position: relative; z-index: 1; }
.unified-selectors-group { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.control-item-wrap { display: flex; align-items: center; gap: 8px; }
.control-item-wrap label { color: #b9d8e6; font-weight: 800; font-size: .9rem; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.control-item-wrap select {
    background: #fff; border: 2px solid #8fc4da; padding: 7px 12px; border-radius: 8px;
    font-family: 'Tajawal', sans-serif; font-weight: 700; font-size: .85rem; min-width: 140px;
}
.admin-today-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #eaf3f7;
    font-size: 0.82rem;
    font-weight: 800;
}
.admin-today-chip i { color: #fde68a; }
.admin-today-chip strong { color: #fff; font-weight: 900; }
.unified-actions-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.admin-student-card {
    background: #fff; border: 1px solid var(--border-color); border-radius: 16px;
    padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); position: relative; overflow: hidden;
}
.card-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; border-bottom: 2px solid #f2efe9; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.card-title {
    margin: 0;
    font-size: 1.05rem;
    cursor: pointer;
}
.card-title.has-recorder { color: #16303d; }
.student-recorder-name {
    border: none;
    background: #eaf3f7;
    color: #236b8c;
    font: inherit;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
}
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.skill-field {
    background: #f7f5f1;
    border: 1px solid #e4e0d9;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.skill-field label {
    font-size: .8rem; font-weight: 800; color: #475569;
    display: flex; align-items: center; gap: 6px;
}
.skill-field label i { color: var(--primary-dark); font-size: 0.72rem; }
.admin-student-card .skill-input,
.skill-field input,
.skill-field select {
    width: 100%;
    border: 1px solid #d5d0c6;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    background: #fff;
    color: var(--text-main);
    box-sizing: border-box;
}
.admin-student-card .skill-input:focus,
.skill-field input:focus,
.skill-field select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(46, 134, 173, 0.15);
}
.admin-student-card .code-input {
    width: 54px;
    min-width: 54px;
    border: none;
    border-radius: 6px;
    background: transparent;
    padding: 4px 2px;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    color: #17506b;
}
.admin-student-card .code-input:disabled {
    color: #64748b;
    cursor: default;
}
.admin-student-card .code-input:not(:disabled) {
    background: #fff;
    border: 1px solid #8fc4da;
    padding: 4px 8px;
    box-shadow: 0 0 0 3px rgba(46, 134, 173, 0.12);
}

.student-code-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f7f5f1;
    border: 1px solid #e4e0d9;
    border-radius: 12px;
    padding: 4px 6px 4px 10px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.student-code-field.is-editing {
    background: #eaf3f7;
    border-color: #8fc4da;
    box-shadow: 0 0 0 3px rgba(46, 134, 173, 0.1);
}
.student-code-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.student-code-field.is-editing .student-code-label {
    color: #236b8c;
}
.code-edit-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.code-edit-btn:hover {
    background: #eaf3f7;
    color: #26749a;
}
.code-edit-btn.unlocked {
    background: #fef3c7;
    color: #7f6331;
}
.code-edit-btn.unlocked:hover {
    background: #fde68a;
}
.live-card-total-badge {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: #fff; padding: 4px 12px; border-radius: 8px; font-size: .85rem; font-weight: 800;
}
.btn-card-save {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: #fff; border: none; padding: 10px; border-radius: 10px; font-weight: 800;
    width: 100%; margin-top: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ─── بطاقة الجواد ─── */
.student-achievement-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f5f1 100%);
    border: 1px solid #d5d0c6;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(35, 107, 140, 0.08);
}
.student-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 14px; flex-wrap: wrap;
    padding: 20px 22px;
    background: linear-gradient(135deg, var(--panel-dark), var(--panel-dark-2));
    color: #fff;
}
.student-card-identity { display: flex; align-items: center; gap: 14px; }
.student-card-avatar {
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; color: #fde68a;
}
.student-card-name { margin: 0 0 4px; font-size: 1.2rem; font-weight: 800; color: #fff; }
.student-card-code { font-size: 0.78rem; font-weight: 700; color: #b9d8e6; }
.student-card-day-chip {
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 12px; border-radius: 12px; font-size: 0.78rem; font-weight: 800;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.student-card-score-panel {
    padding: 18px 22px;
    background: #eaf3f7;
    border-bottom: 1px solid #d6e9f1;
}
.student-card-score-main {
    display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px;
}
.student-card-score-main strong {
    font-size: 2rem; line-height: 1; color: var(--primary-dark); font-weight: 800;
}
.student-card-score-main span { font-size: 0.85rem; font-weight: 700; color: #64748b; }
.student-card-score-track {
    height: 10px; background: #d6e9f1; border-radius: 999px; overflow: hidden;
}
.student-card-score-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-dark));
    transition: width 0.25s ease;
}
.student-card-score-percent {
    display: block; margin-top: 8px; font-size: 0.75rem;
    font-weight: 800; color: var(--primary-dark);
}
.student-card-section {
    padding: 18px 22px;
    border-bottom: 1px solid #f2efe9;
}
.student-card-section:last-of-type { border-bottom: none; }
.student-card-section h4 {
    margin: 0 0 14px; font-size: 0.88rem; font-weight: 800;
    color: var(--primary-dark);
    display: flex; align-items: center; gap: 8px;
}
.student-card-section.admin-section h4 { color: #1f6280; }
.student-card-section.student-section h4 { color: #7f6331; }
.student-skills-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.student-skills-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.student-skill-field {
    background: #fff; border: 1px solid #e4e0d9; border-radius: 12px;
    padding: 10px 12px; transition: 0.2s;
}
.student-skill-field.admin-owned { background: #f7f5f1; }
.student-skill-field.student-owned.editable {
    border-color: #fcd34d; background: #fffbeb;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}
.student-skill-field label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.76rem; font-weight: 800; color: #475569; margin-bottom: 8px;
}
.student-skill-field label i { color: var(--primary-dark); font-size: 0.72rem; }
.student-skill-field .st-skill-input,
.student-skill-field .skill-input {
    width: 100%; border: 1px solid #d5d0c6; border-radius: 8px;
    padding: 8px 10px; font-family: 'Tajawal', sans-serif;
    font-weight: 700; font-size: 0.85rem; background: #fff;
}
.student-skill-field .st-skill-input:disabled {
    background: #f2efe9; color: #64748b; cursor: not-allowed;
}
.student-skill-field.student-owned.editable .st-skill-input:not(:disabled) {
    border-color: #f59e0b; background: #fff;
}
.btn-student-card-save {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% - 44px); margin: 0 22px 22px;
    padding: 12px 16px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-dark));
    color: #fff; font-family: 'Tajawal', sans-serif; font-weight: 800;
    font-size: 0.92rem; cursor: pointer;
    box-shadow: 0 4px 14px rgba(35, 107, 140, 0.25);
}
.btn-student-card-save:hover { transform: translateY(-1px); }

.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.grid-full-width { grid-column: 1 / -1; }

/* ─── فارس الأسبوع ─── */
.knight-showcase-box {
    position: relative; overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, #1a1208 0%, #0c0a09 45%, #050505 100%);
    border-radius: 20px; padding: 26px 22px; color: #fff;
    border: 2px solid rgba(251, 191, 36, 0.45);
    display: flex; flex-direction: column; justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 50px rgba(251,191,36,0.12);
}
.knight-showcase-box.compact { padding: 20px 18px; }
.knight-header-tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, rgba(251,191,36,0.22), rgba(180,83,9,0.15));
    color: #fde68a; padding: 7px 16px; border-radius: 24px; font-size: .85rem; font-weight: 800;
    border: 1px solid rgba(251,191,36,0.55); margin-bottom: 12px;
}
.knight-content-center { text-align: center; padding: 14px 0 10px; }
.knight-content-center.compact { padding: 8px 0 4px; }
.knight-avatar-icon { font-size: 3.4rem; color: #fbbf24; margin-bottom: 14px; filter: drop-shadow(0 0 10px rgba(251,191,36,0.9)); }
.knight-showcase-box.compact .knight-avatar-icon { font-size: 2.2rem; margin-bottom: 8px; }
.knight-name-display { font-size: 1.4rem; font-weight: 800; color: #fef9c3; margin-bottom: 10px; }
.knight-name-display.small { font-size: 1.1rem; }
.knight-score-badge {
    background: linear-gradient(135deg, #fcd34d, #f59e0b, #a8813f);
    color: #1c1102; padding: 7px 18px; border-radius: 14px; font-size: .95rem; font-weight: 800; display: inline-block;
}
.knight-score-badge.small { font-size: .85rem; padding: 5px 14px; }
.knight-footer-info { font-size: .72rem; color: rgba(251,191,36,0.55); text-align: center; margin-top: 14px; border-top: 1px solid rgba(251,191,36,0.18); padding-top: 12px; font-weight: 700; }

.chart-panel-box {
    position: relative;
    background: #fff; border: 1px solid var(--border-color); border-radius: 18px;
    padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.presentation-header-brand { position: relative; }

.chart-panel-box.compact { padding: 18px; }
.chart-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 15px; border-bottom: 2px solid #f2efe9; padding-bottom: 12px; }
.chart-header-content { display: flex; align-items: flex-start; gap: 12px; }
.chart-title-main { font-size: 1.05rem; color: var(--primary-dark); margin: 0; font-weight: 800; }
.chart-title-main.small { font-size: .95rem; }
.chart-title-sub { font-size: .72rem; color: var(--text-muted); font-weight: 700; }
.chart-day-badge { background: var(--accent-light); color: var(--primary-dark); padding: 6px 14px; border-radius: 10px; font-size: .85rem; font-weight: 800; border: 1px solid #b9d8e6; white-space: nowrap; }

.excellence-list-container { display: flex; flex-direction: column; gap: 10px; max-height: 210px; overflow-y: auto; }
.excellence-list-container.compact { max-height: 140px; }
.excellence-item { display: flex; justify-content: space-between; align-items: center; background: #f7f5f1; border: 1px solid var(--border-color); padding: 12px 16px; border-radius: 12px; font-weight: 800; }
.excellence-badge { background: var(--primary-color); color: #fff; padding: 5px 12px; border-radius: 8px; font-size: .85rem; }

.student-lock-notice { font-size: .85rem; font-weight: 700; padding: 6px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }

.site-footer-brand { text-align: center; padding: 22px 16px 6px; margin-top: 28px; border-top: 1px solid var(--border-color); }
.site-footer-brand p { margin: 0; font-size: .78rem; font-weight: 800; color: #64748b; }

.presentation-screen-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    z-index: 2147483000;
    display: none; flex-direction: column;
    background: linear-gradient(165deg, #eef4f7 0%, #e3ece8 45%, #dce6e1 100%);
    color: #22414f;
    overflow: hidden;
    isolation: isolate;
}

.presentation-screen-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('../logo.jpg') center 58% / min(55vw, 420px) no-repeat;
    opacity: 0.045;
    mix-blend-mode: multiply;
    pointer-events: none;
}

body.presentation-active {
    overflow: hidden;
}

body.presentation-active::before {
    display: none;
}

body.presentation-active #mainContainer,
body.presentation-active #studentPortalContainer,
body.presentation-active #studentModal,
body.presentation-active .login-choice-overlay {
    display: none !important;
}

.presentation-close-fab {
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    z-index: 5;
    background: rgba(255,255,255,0.85);
    color: #5c7381;
    border: 1px solid #c5d9d0;
    width: 44px; height: 44px;
    border-radius: 12px;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 10px rgba(34, 65, 79, 0.08);
}

.presentation-close-fab:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.presentation-hall {
    position: relative;
    z-index: 1;
    display: flex; flex-direction: column;
    width: 100%; height: 100%;
    padding: clamp(12px, 2.5vw, 28px);
    padding-top: clamp(12px, 2vh, 20px);
    box-sizing: border-box;
}

.presentation-brand {
    text-align: center;
    flex-shrink: 0;
    margin-bottom: clamp(8px, 1.5vh, 16px);
}

.presentation-screen-overlay .circle-logo--presentation {
    width: clamp(64px, 10vw, 88px);
    height: clamp(64px, 10vw, 88px);
    margin: 0 auto 8px;
    border-radius: 50%;
    border: 2px solid rgba(42, 109, 154, 0.22);
    background: #fff !important;
    box-shadow: 0 4px 18px rgba(34, 65, 79, 0.07) !important;
    overflow: hidden;
}

.presentation-screen-overlay .circle-logo--presentation .circle-logo__frame {
    width: 100%;
    height: 100%;
    padding: 0;
}

.presentation-screen-overlay .circle-logo--presentation .circle-logo__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

.presentation-brand-title {
    margin: 0;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 800;
    color: #22414f;
}

.presentation-brand-sub {
    display: block;
    margin-top: 2px;
    font-size: clamp(0.75rem, 1.5vw, 0.88rem);
    font-weight: 700;
    color: #5c7381;
}

.presentation-hall-main {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; min-height: 0; position: relative;
}

.presentation-hall-main-single {
    display: flex; flex-direction: column;
    justify-content: center;
    gap: clamp(20px, 4vh, 48px);
    padding: clamp(12px, 2vh, 28px) 0;
    flex: 1;
    min-height: 0;
}

.presentation-hall-main-single .presentation-total-grid {
    flex: 1; max-height: none;
}

.presentation-section-head-total { margin-bottom: 0; }

.presentation-total-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: clamp(10px, 1.6vw, 16px);
    overflow-y: auto; max-height: calc(100vh - 220px); padding-bottom: 8px;
}

.presentation-total-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.82);
    border: 1px solid #c5d9d0;
    border-radius: 16px; padding: clamp(12px, 2vw, 18px);
    box-shadow: 0 2px 8px rgba(34, 65, 79, 0.05);
}

.presentation-total-item.top-1 {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fcd34d;
}

.presentation-total-item.top-2 {
    background: linear-gradient(135deg, #f7f5f1, #f2efe9);
    border-color: #d5d0c6;
}

.presentation-total-item.top-3 {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border-color: #fdba74;
}

.presentation-total-rank {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.95rem;
    background: #e2ebe6; color: #22414f;
}

.presentation-total-item.top-1 .presentation-total-rank { background: linear-gradient(135deg, #fbbf24, #7f6331); color: #fff; }
.presentation-total-item.top-2 .presentation-total-rank { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.presentation-total-item.top-3 .presentation-total-rank { background: linear-gradient(135deg, #a8813f, #92400e); color: #fff; }

.presentation-total-name {
    flex: 1; font-weight: 800; font-size: clamp(0.92rem, 1.8vw, 1.15rem);
    line-height: 1.35; word-break: break-word;
    color: #22414f;
}

.presentation-total-score {
    font-weight: 800; color: #236b8c; white-space: nowrap;
    font-size: clamp(0.9rem, 1.7vw, 1.1rem);
}

.presentation-total-empty {
    grid-column: 1 / -1; text-align: center; padding: 40px 20px;
    color: #5c7381; font-weight: 750;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
}

.presentation-knight-stage {
    text-align: center; padding: clamp(20px, 4vh, 40px) clamp(16px, 4vw, 32px);
    background: linear-gradient(135deg, #fffbeb 0%, #fef9ef 100%);
    border: 1px solid #fde68a; border-radius: 24px;
    box-shadow: 0 8px 28px rgba(180, 83, 9, 0.08);
}

.presentation-knight-tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fef3c7; color: #92400e;
    padding: 8px 18px; border-radius: 999px; font-weight: 800;
    font-size: clamp(0.85rem, 1.8vw, 1.05rem); margin-bottom: 12px;
}

.presentation-knight-name {
    font-size: clamp(2rem, 7vw, 4.5rem); font-weight: 800;
    color: #22414f; line-height: 1.15; margin-bottom: 8px;
}

.presentation-knight-score {
    font-size: clamp(1.2rem, 3vw, 2rem); font-weight: 800;
    color: #7f6331;
}

.presentation-excellence-stage { flex-shrink: 0; }

.presentation-section-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-bottom: clamp(14px, 2.5vh, 24px); flex-wrap: wrap;
}

.presentation-section-head h2 {
    font-size: clamp(1.1rem, 2.5vw, 1.75rem); font-weight: 800;
    display: flex; align-items: center; gap: 10px; margin: 0;
    color: #22414f;
}

.presentation-day-badge {
    background: #fff; border: 1px solid #a7d4bc;
    padding: 8px 16px; border-radius: 12px; font-weight: 800;
    font-size: clamp(0.8rem, 1.6vw, 1rem); color: #236b8c;
}

.presentation-podium {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 2vw, 20px); align-items: end;
}

.presentation-podium-card {
    background: rgba(255,255,255,0.9); border: 1px solid #c5d9d0;
    border-radius: 20px; padding: clamp(14px, 2.5vw, 24px) clamp(12px, 2vw, 20px);
    text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(34, 65, 79, 0.06);
}

.presentation-podium-card.rank-1 {
    order: 2; min-height: clamp(140px, 22vh, 220px);
    background: linear-gradient(180deg, #fffbeb, #fff);
    border-color: #fcd34d;
    transform: scale(1.04);
}

.presentation-section-head h2 i {
    color: #26749a;
}

.presentation-podium-card.rank-2 {
    order: 1;
    min-height: clamp(110px, 18vh, 180px);
    background: linear-gradient(180deg, #f7f5f1, #fff);
    border-color: #d5d0c6;
}

.presentation-podium-card.rank-3 {
    order: 3;
    min-height: clamp(100px, 16vh, 160px);
    background: linear-gradient(180deg, #fff7ed, #fff);
    border-color: #fdba74;
}

.presentation-podium-rank {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem;
}

.presentation-podium-card.rank-1 .presentation-podium-rank { background: linear-gradient(135deg, #fbbf24, #7f6331); color: #fff; }
.presentation-podium-card.rank-2 .presentation-podium-rank { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.presentation-podium-card.rank-3 .presentation-podium-rank { background: linear-gradient(135deg, #a8813f, #92400e); color: #fff; }

.presentation-podium-name {
    font-weight: 800; font-size: clamp(0.95rem, 2vw, 1.35rem);
    line-height: 1.3; word-break: break-word;
    color: #22414f;
}

.presentation-podium-score {
    font-weight: 800; color: #236b8c; font-size: clamp(0.9rem, 1.8vw, 1.15rem);
}

.presentation-podium-empty {
    grid-column: 1 / -1; text-align: center; padding: 32px;
    color: #5c7381; font-weight: 750;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
}

/* Attendance sheet */
.attendance-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin-bottom: 16px;
}

.attendance-mode-tabs {
    display: flex; gap: 6px; background: #f2efe9; padding: 4px;
    border-radius: 12px; border: 1px solid var(--border-color);
}

.attendance-mode-btn {
    border: none; background: transparent; padding: 10px 18px;
    border-radius: 10px; font-weight: 800; cursor: pointer;
    color: #64748b; font-family: inherit; font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.attendance-mode-btn:hover { color: var(--primary-dark); }
.attendance-mode-btn.active {
    background: #fff; color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.attendance-period-select {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px;
}

.attendance-period-select label {
    font-weight: 800; color: #334155; font-size: 0.88rem; white-space: nowrap;
}

.attendance-period-select select {
    flex: 1; min-width: 160px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--border-color); font-weight: 700; font-family: inherit;
    background: #fff;
}

.attendance-table-wrap {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 16px; overflow-x: auto;
}

.attendance-table {
    width: 100%; min-width: 640px; border-collapse: collapse; text-align: center;
}

.attendance-table th {
    background: var(--primary-dark); color: #b9d8e6;
    padding: 14px 10px; font-weight: 800; font-size: 0.85rem;
}

.attendance-table td {
    padding: 12px 10px; border-bottom: 1px solid var(--border-color);
    font-weight: 700; vertical-align: middle;
}

.attendance-table td.att-name { text-align: right; font-weight: 800; }
.attendance-table tr:nth-child(even) td { background: #f7f5f1; }

.att-cell-present { color: #236b8c; }
.att-cell-absent { color: #dc2626; }
.att-cell-future { color: #d5d0c6; }
.att-cell-summary { font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.att-cell-missed { text-align: right; font-size: 0.82rem; color: #7f6331; font-weight: 700; line-height: 1.45; }

.attendance-summary-bar {
    display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}

.attendance-summary-pill {
    flex: 1; min-width: 140px; padding: 14px 18px; border-radius: 14px;
    font-weight: 800; text-align: center; border: 1px solid var(--border-color);
    background: #fff;
}

.attendance-summary-pill.present { color: #236b8c; background: #eaf3f7; border-color: #b9d8e6; }
.attendance-summary-pill.absent { color: #7f6331; background: #fffbeb; border-color: #fde68a; }
.attendance-summary-pill.total { color: #334155; background: #f7f5f1; }

.attendance-sheet-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.attendance-sheet-col {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 16px; padding: 16px; min-height: 200px;
}

.attendance-sheet-col h3 {
    font-size: 1rem; font-weight: 800; margin: 0 0 14px;
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 12px; border-bottom: 2px solid #f2efe9;
}

.attendance-sheet-col--present h3 { color: #236b8c; }
.attendance-sheet-col--absent h3 { color: #7f6331; }

.attendance-sheet-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
    max-height: 420px; overflow-y: auto;
}

.attendance-sheet-list li {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
    padding: 10px 12px; border-radius: 10px; font-weight: 700;
    background: #f7f5f1; border: 1px solid var(--border-color);
}

.attendance-sheet-list .att-item-main {
    display: flex; flex-direction: column; gap: 4px; text-align: right; flex: 1;
}

.attendance-sheet-list .att-absent-days {
    font-size: 0.78rem; color: #7f6331; font-weight: 700; line-height: 1.4;
}

.attendance-sheet-list .att-code {
    font-size: 0.8rem; color: #64748b; font-weight: 800;
}

.attendance-sheet-empty {
    text-align: center; color: #94a3b8; padding: 24px 12px; font-weight: 750;
}

.mahr-settings-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.mahr-settings-total {
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--primary-dark);
}
.mahr-settings-list { display: flex; flex-direction: column; gap: 10px; }
.mahr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #f7f5f1;
}
.mahr-row--skip { opacity: 0.75; }
.mahr-row-label {
    font-weight: 800;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mahr-row-label i { color: var(--primary-color); margin-inline-end: 6px; }
.mahr-row-label small { font-weight: 600; color: #64748b; }
.mahr-row-note { font-weight: 700; color: #94a3b8; font-size: 0.88rem; }
.mahr-input {
    width: 88px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-weight: 800;
    font-family: inherit;
    text-align: center;
    background: #fff;
}
.mahr-settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.mahr-settings-status { font-weight: 700; color: #64748b; }

.himmah-icon { background: linear-gradient(135deg, #1d4ed8, #1f6280) !important; }
.himmah-start-card {
    background: linear-gradient(135deg, #1f6280 0%, #1e3a5f 100%);
    color: #fff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 16px 40px rgba(15, 118, 110, 0.28);
}
.himmah-start-card label { display: block; font-weight: 800; margin-bottom: 10px; }
.himmah-start-row { display: flex; gap: 10px; flex-wrap: wrap; }
.himmah-start-row input {
    flex: 1; min-width: 200px; border: none; border-radius: 12px;
    padding: 12px 14px; font-weight: 700; font-family: inherit;
}
.himmah-admin-list { display: flex; flex-direction: column; gap: 12px; }
.himmah-event-card {
    background: #fff; border: 1px solid var(--border-color); border-radius: 18px;
    padding: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center;
    box-shadow: 0 8px 22px rgba(0,0,0,0.04);
}
.himmah-event-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.himmah-event-card p { margin: 0; color: #64748b; font-weight: 700; font-size: 0.86rem; }
.himmah-event-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.himmah-event-actions button {
    border: none; border-radius: 10px; padding: 10px 14px; font-weight: 800;
    font-family: inherit; cursor: pointer;
}
.himmah-btn-open { background: #eaf3f7; color: #236b8c; }
.himmah-btn-del { background: #fee2e2; color: #b91c1c; }
.himmah-editor-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; }
.himmah-editor-table th, .himmah-editor-table td {
    padding: 10px 8px; border-bottom: 1px solid #e4e0d9; text-align: right; font-size: 0.88rem;
}
.himmah-editor-table th { background: #1f6280; color: #fff; }
.himmah-editor-table input, .himmah-editor-table select {
    width: 100%; min-width: 90px; padding: 8px; border-radius: 8px; border: 1px solid var(--border-color);
    font-family: inherit; font-weight: 700;
}
.himmah-editor-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.himmah-student-home { margin: 8px 0 18px; display: flex; flex-direction: column; gap: 14px; }
.himmah-board {
    border-radius: 24px; overflow: hidden;
    background: linear-gradient(160deg, #0b3b4a 0%, #1f6280 55%, #7f6331 140%);
    color: #fff; padding: 20px 18px 18px;
    box-shadow: 0 20px 48px rgba(11, 59, 74, 0.28);
}
.himmah-board-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.14); border-radius: 999px;
    padding: 6px 12px; font-weight: 800; font-size: 0.78rem; margin-bottom: 10px;
}
.himmah-board h3 { margin: 0 0 14px; font-size: 1.35rem; letter-spacing: 0.02em; }
.himmah-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.himmah-col { background: rgba(255,255,255,0.1); border-radius: 16px; padding: 12px; min-height: 120px; }
.himmah-col h4 { margin: 0 0 10px; font-size: 0.95rem; display: flex; align-items: center; gap: 6px; }
.himmah-col--pass { box-shadow: inset 0 0 0 1px rgba(167, 243, 208, 0.35); }
.himmah-col--fail { box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.35); }
.himmah-name-chip {
    display: block; background: rgba(255,255,255,0.16); border-radius: 10px;
    padding: 8px 10px; margin-bottom: 6px; font-weight: 800; text-align: center;
}
.himmah-empty { opacity: 0.75; font-weight: 700; text-align: center; padding: 18px 8px; }
.himmah-archive-btn {
    width: 100%; border: none; border-radius: 18px; padding: 16px 18px;
    background: linear-gradient(135deg, #f7f5f1, #eaf3f7);
    border: 1px solid #b9d8e6; cursor: pointer; text-align: right;
    font-family: inherit; box-shadow: 0 8px 20px rgba(35,107,140,0.08);
}
.himmah-archive-btn strong { display: block; font-size: 1.05rem; color: #1f6280; }
.himmah-archive-btn span { color: #64748b; font-weight: 700; font-size: 0.85rem; }
.himmah-student-detail .himmah-board { margin-top: 8px; }

.tracking-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 16px; padding: 14px 16px;
    background: #fff; border: 1px solid var(--border-color); border-radius: 14px;
}
.tracking-toolbar label {
    font-weight: 800; color: var(--primary-dark); display: inline-flex; align-items: center; gap: 6px;
}
.tracking-toolbar select {
    flex: 1; min-width: 200px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--border-color); font-family: inherit; font-weight: 700;
    background: #f7f5f1;
}
.tracking-summary { margin-bottom: 14px; }
.tracking-summary-card {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 16px; border-radius: 14px;
    background: linear-gradient(135deg, #eaf3f7, #fff);
    border: 1px solid #b9d8e6;
}
.tracking-summary-card strong { color: var(--primary-dark); font-size: 1.05rem; }
.tracking-summary-card span { color: #475569; font-weight: 700; font-size: 0.9rem; }
.tracking-days-list { display: flex; flex-direction: column; gap: 8px; }
.tracking-week-title {
    margin: 12px 0 4px; font-size: 0.92rem; font-weight: 800; color: var(--primary-dark);
}
.tracking-day-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px 16px; background: #fff; border: 1px solid #e4e0d9;
    border-radius: 14px;
}
.tracking-day-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tracking-day-main { display: flex; flex-direction: column; gap: 3px; }
.tracking-day-main strong { color: var(--primary-dark); font-size: 0.95rem; }
.tracking-day-main span { color: #64748b; font-size: 0.8rem; font-weight: 700; }
.tracking-skill-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px;
}
.tracking-skill-list li {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 10px; background: #f7f5f1; border: 1px solid #e4e0d9; border-radius: 10px;
}
.tracking-skill-label { font-size: 0.72rem; font-weight: 800; color: #64748b; }
.tracking-day-card.is-zero {
    background: #f7f5f1; border-color: #e4e0d9;
}
.tracking-day-empty {
    margin: 0; color: #94a3b8; font-size: 0.82rem; font-weight: 700;
}

.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0));
    transform: translateX(-50%);
    z-index: 4000;
    max-width: min(90vw, 420px);
    padding: 12px 18px;
    border-radius: 14px;
    background: #16303d;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
    pointer-events: none;
}
.app-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 4100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
}
.app-confirm-overlay[hidden] { display: none !important; }
.app-confirm-box {
    width: min(100%, 360px);
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}
.app-confirm-box p {
    margin: 0 0 18px;
    font-weight: 800;
    color: #16303d;
    line-height: 1.6;
    text-align: center;
}
.app-confirm-actions {
    display: flex;
    gap: 10px;
}
.app-confirm-no,
.app-confirm-yes {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}
.app-confirm-no { background: #f2efe9; color: #334155; }
.app-confirm-yes { background: #dc2626; color: #fff; }

.hall-screen {
    background: #f7f5f0 !important;
}
.hall-screen::before { display: none; }
.hall-close {
    top: 10px;
    inset-inline-start: auto;
    right: auto;
    left: 12px;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.88);
    color: #143a4d;
}
.hall-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f7f5f0;
}
.hall-hero {
    position: relative;
    flex: 0 0 30%;
    min-height: 140px;
    max-height: 260px;
    overflow: hidden;
    background: #f7f5f0;
}
.hall-hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0%;
    display: block;
}
.hall-knight-card {
    position: relative;
    margin: -18px 5% 14px;
    z-index: 2;
    background:
        radial-gradient(circle at 12% 80%, rgba(20, 58, 77, 0.04), transparent 28%),
        repeating-linear-gradient(135deg, rgba(20,58,77,0.018) 0 10px, transparent 10px 20px),
        #fbfaf7;
    border-radius: 18px;
    padding: clamp(18px, 3.2vh, 30px) 64px clamp(16px, 2.6vh, 24px);
    text-align: center;
    box-shadow: 0 12px 32px rgba(20, 58, 77, 0.1);
    border: 1px solid #ead9b4;
    overflow: hidden;
}
.hall-knight-card::before,
.hall-knight-card::after {
    content: "";
    position: absolute;
    top: 10%;
    bottom: 10%;
    width: 42px;
    background:
        radial-gradient(circle at 30% 30%, rgba(189,148,80,0.35), transparent 42%),
        #143a4d;
    border: 2px solid #bd9450;
    box-shadow: inset 0 0 0 3px rgba(20, 58, 77, 0.35);
}
.hall-knight-card::before {
    right: -6px;
    border-radius: 80px 14px 14px 80px;
}
.hall-knight-card::after {
    left: -6px;
    border-radius: 14px 80px 80px 14px;
}
.hall-knight-card h2 {
    margin: 0;
    color: #143a4d;
    font-size: clamp(1.45rem, 3.2vw, 2.15rem);
    font-weight: 800;
}
.hall-ornament {
    width: 18px;
    height: 18px;
    margin: 10px auto 8px;
    background: #bd9450;
    transform: rotate(45deg);
    border-radius: 2px;
    box-shadow: 0 0 0 3px rgba(189,148,80,0.18);
}
.hall-knight-name {
    color: #143a4d;
    font-weight: 800;
    font-size: clamp(1.15rem, 2.6vw, 1.7rem);
    line-height: 1.4;
}
.hall-score-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.hall-diamond {
    width: 10px;
    height: 10px;
    background: #bd9450;
    transform: rotate(45deg);
    flex-shrink: 0;
}
.hall-knight-score {
    color: #bd9450;
    font-weight: 800;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    line-height: 1;
}
.hall-knight-leftover {
    color: #143a4d;
    font-weight: 800;
    font-size: clamp(0.85rem, 1.6vw, 1.05rem);
    white-space: nowrap;
}
.hall-mini-score-row {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hall-mini-leftover,
.hall-side-mehar {
    color: #143a4d;
    font-weight: 800;
    font-size: 0.85rem;
    white-space: nowrap;
}
.presentation-podium-score .hall-side-mehar,
.presentation-total-score .hall-side-mehar {
    margin-inline-start: 8px;
    font-size: 0.85em;
    color: #143a4d;
}
.hall-program {
    flex: 1;
    min-height: 0;
    padding: 0 5% 16px;
    display: flex;
    flex-direction: column;
}
.hall-program-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.hall-program-head h3 {
    margin: 0;
    color: #143a4d;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 800;
}
.hall-program-head h3::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 14px;
    margin-inline-end: 8px;
    vertical-align: -2px;
    background: #143a4d;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/></svg>") center / contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/></svg>") center / contain no-repeat;
}
.hall-view-all {
    border: none;
    background: none;
    color: #143a4d;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
}
.hall-view-all::after { content: " ›"; }
.hall-program-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 1.6vw, 16px);
    flex: 1;
    min-height: 0;
}
.hall-mini {
    position: relative;
    background: #fff;
    border: 1px solid #ead9b4;
    border-radius: 16px;
    padding: 30px 12px 18px;
    text-align: center;
    box-shadow: 0 8px 18px rgba(20,58,77,0.06);
    overflow: hidden;
}
.hall-mini::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 12px;
    pointer-events: none;
    box-shadow:
        8px 8px 0 -6px rgba(189,148,80,0.55),
        -8px -8px 0 -6px rgba(189,148,80,0.35);
}
.hall-mini::after {
    content: "";
    position: absolute;
    bottom: 6px;
    right: 10px;
    width: 72px;
    height: 48px;
    opacity: 0.1;
    background: #143a4d;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 40'><path fill='black' d='M32 2l6 8h8v6h6v22H12V16h6V10h8z'/></svg>") center / contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 40'><path fill='black' d='M32 2l6 8h8v6h6v22H12V16h6V10h8z'/></svg>") center / contain no-repeat;
}
.hall-ribbon {
    position: absolute;
    top: 8px;
    left: 12px;
    width: 28px;
    height: 36px;
    border-radius: 4px 4px 8px 8px;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
    font-size: 0.85rem;
    z-index: 1;
}
.hall-mini.rank-1 .hall-ribbon { background: linear-gradient(180deg, #e3c36a, #b8860b); }
.hall-mini.rank-2 .hall-ribbon { background: linear-gradient(180deg, #cfd6de, #7b8794); }
.hall-mini.rank-3 .hall-ribbon { background: linear-gradient(180deg, #d4a574, #8a5a2b); }
.hall-mini-name {
    color: #143a4d;
    font-weight: 800;
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    margin-top: 8px;
    position: relative;
    z-index: 1;
}
.hall-gold-rule {
    width: 42px;
    height: 2px;
    margin: 10px auto 0;
    background: #bd9450;
    position: relative;
    z-index: 1;
}
.hall-gold-rule::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    background: #bd9450;
    transform: translate(-50%, -50%) rotate(45deg);
}
.hall-mini-score {
    margin-top: 10px;
    color: #bd9450;
    font-weight: 800;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    position: relative;
    z-index: 1;
}
.hall-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    font-weight: 800;
    padding: 24px 8px;
}
@media (max-width: 768px) {
    .hall-program-grid { grid-template-columns: 1fr; }
    .hall-knight-card { padding-inline: 28px; }
    .hall-knight-card::before,
    .hall-knight-card::after { width: 22px; }
}

@media (max-width: 768px) {
    .presentation-podium { grid-template-columns: 1fr; }
    .presentation-podium-card.rank-1,
    .presentation-podium-card.rank-2,
    .presentation-podium-card.rank-3 { order: unset; min-height: auto; transform: none; }
    .attendance-sheet-grid { grid-template-columns: 1fr; }
    .himmah-cols { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .student-card-header { padding: 16px; }
    .student-card-score-panel, .student-card-section { padding: 14px 16px; }
    .student-skills-grid, .student-skills-grid-wide { grid-template-columns: 1fr; }
    .btn-student-card-save { width: calc(100% - 32px); margin: 0 16px 16px; }
    .news-admin-header { flex-wrap: wrap; gap: 12px; }
    .student-news-card-head { flex-direction: column; }
    .student-news-alert-inner { flex-wrap: wrap; gap: 10px; }
    .student-news-alert-action { width: 100%; justify-content: flex-end; }
    .unified-control-panel { padding: 14px; }
    .control-item-wrap { width: 100%; }
    .control-item-wrap select { flex: 1; width: 100%; }
}


/* === طيّ البطاقات · علامات الرصد · شريط التقدّم · تبويب الجياد === */

.record-progress {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 14px; padding: 10px 16px;
    background: #fff; border: 1px solid #e4e0d9; border-radius: 12px;
}
.record-progress-label { font-size: .85rem; font-weight: 800; color: #334155; white-space: nowrap; }
.record-progress-track { flex: 1; height: 7px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.record-progress-fill {
    display: block; height: 100%; width: 0%; border-radius: 99px;
    background: linear-gradient(90deg, #26749a, #2e86ad);
    transition: width .45s cubic-bezier(.4,0,.2,1);
}

.admin-student-card {
    overflow: hidden; padding: 0;
    align-self: start;   /* حتى لا تُمدّ البطاقة المطويّة لارتفاع أطول بطاقة في الصف */
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 14px 16px; background: transparent; border: 0;
    cursor: pointer; font-family: inherit; text-align: right;
}
.card-head:hover { background: #f7f5f1; }
.card-head-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.card-head-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.card-head .card-title {
    font-size: .98rem; font-weight: 800; color: #16303d; margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-chevron { color: #94a3b8; font-size: .8rem; transition: transform .3s ease; }
.admin-student-card:not(.collapsed) .card-chevron { transform: rotate(180deg); }

.card-tag {
    display: none; align-items: center; gap: 4px;
    font-size: .68rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; white-space: nowrap;
}
.admin-student-card.is-recorded .card-tag--done { display: inline-flex; background: #dcfce7; color: #15803d; }
.admin-student-card.is-dirty .card-tag--dirty { display: inline-flex; background: #fef3c7; color: #7f6331; }
.admin-student-card.is-dirty .card-tag--done { display: none; }
.admin-student-card.is-dirty { border-color: #fcd34d; box-shadow: 0 0 0 3px rgba(252,211,77,.18); }

.card-body-wrap {
    display: grid; grid-template-rows: 1fr; opacity: 1;
    transition: grid-template-rows .34s cubic-bezier(.4,0,.2,1), opacity .26s ease;
}
.admin-student-card.collapsed .card-body-wrap { grid-template-rows: 0fr; opacity: 0; }
.card-body {
    overflow: hidden; min-height: 0; padding: 0 16px 16px;
    transition: padding .34s cubic-bezier(.4,0,.2,1);
}
.admin-student-card.collapsed .card-body { padding-top: 0; padding-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
    .card-body-wrap, .card-body, .card-chevron, .record-progress-fill { transition: none; }
}

/* تبويب الجياد */
.manage-students-list { display: flex; flex-direction: column; gap: 8px; }
.manage-row {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid #e4e0d9; border-radius: 12px; padding: 10px 14px;
}
.manage-num {
    width: 26px; height: 26px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #f2efe9; color: #64748b; border-radius: 8px; font-size: .75rem; font-weight: 800;
}
.manage-name {
    flex: 1; min-width: 0; font-weight: 750; color: #16303d; font-size: .92rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.manage-code-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.manage-code-wrap .code-input {
    width: 74px; padding: 6px 8px; text-align: center;
    font-weight: 800; font-size: .85rem; letter-spacing: 1px;
    border: 1px solid #e4e0d9; border-radius: 8px; background: #f7f5f1; color: #334155;
}
.manage-code-wrap .code-input:not(:disabled) { background: #fff; border-color: #26749a; color: #16303d; }
.manage-code-wrap .lock-btn,
.manage-row .btn-delete {
    width: 30px; height: 30px; flex-shrink: 0; border: none; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .8rem;
}
.manage-code-wrap .lock-btn { background: #f2efe9; color: #64748b; }
.manage-code-wrap .lock-btn.unlocked { background: #d6e9f1; color: #236b8c; }
.manage-row .btn-delete { background: #fee2e2; color: #ef4444; }
.manage-empty { text-align: center; color: #94a3b8; padding: 30px; font-weight: 700; }

@media (max-width: 560px) {
    .manage-row { flex-wrap: wrap; gap: 8px; }
    .manage-name { flex-basis: calc(100% - 80px); }
}


/* === بطاقات مضغوطة: ارتفاع أقل خصوصاً على الجوال === */

@media (max-width: 640px) {
    /* عمودان دائماً بدل عمود واحد على الشاشات الضيقة */
    .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }


    /* رأس وجسم البطاقة */
    .card-head { padding: 10px 12px; }
    .card-head .card-title { font-size: .9rem; }
    .card-body { padding: 0 12px 12px; }
    .admin-student-card .btn-card-save { padding: 9px; font-size: .82rem; margin-top: 10px; }

    /* شبكة البطاقات: عمود واحد بفجوة أصغر */
    .grid-container { gap: 10px; }
}

/* شاشات صغيرة جداً */
@media (max-width: 360px) {
    .skills-grid { grid-template-columns: 1fr; }
}


/* === لمسات هوية جياد: نقش خفيف + صورة المصحف في الخلفية === */

/* نقش إسلامي باهت على كامل الصفحة */
body {
    background-color: #f7f5f1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23236b8c' stroke-width='1' opacity='.05'%3E%3Cpath d='M30 2 L44 16 L44 44 L30 58 L16 44 L16 16 Z'/%3E%3Cpath d='M30 12 L38 20 L38 40 L30 48 L22 40 L22 20 Z'/%3E%3Cpath d='M0 30 L16 30 M44 30 L60 30'/%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
}


/* شريط ذهبي رفيع أعلى البطاقات — من هوية الشعار */
.admin-student-card {
    border-top: 2px solid transparent;
    background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #236b8c, #bd9450);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}
.admin-student-card.is-recorded {
    background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #bd9450, #236b8c);
}

/* الترويسة: تدرّج الهوية */
.page-header {
    background: linear-gradient(135deg, #ffffff 0%, #f7f5f1 100%);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #236b8c, #bd9450) 1;
}

/* شريط التقدّم بلون الهوية */
.record-progress-fill { background: linear-gradient(90deg, #236b8c, #2e86ad); }
.record-progress {
    background: rgba(255,255,255,.9);
    border-color: #e4e0d9;
}


@media (prefers-reduced-motion: reduce) {
    body { background-attachment: scroll; }
}

/* زر الحفظ ذهبي فوق لوحة التحكم الزرقاء — تباين واضح ومن الهوية */
.unified-control-panel .btn-save-all,
.unified-control-panel .btn-primary-custom {
    background: linear-gradient(135deg, #bd9450, #a8813f) !important;
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.unified-control-panel .btn-save-all:hover,
.unified-control-panel .btn-primary-custom:hover {
    background: linear-gradient(135deg, #cba465, #b28a45) !important;
}
.unified-control-panel .btn-search-students {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
}


/* === شاشة الدخول: تدرّج الهوية + نقش، بلا صور === */
.login-choice-overlay {
    background-color: #12324a;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1' opacity='.12'%3E%3Cpath d='M30 2 L44 16 L44 44 L30 58 L16 44 L16 16 Z'/%3E%3Cpath d='M30 12 L38 20 L38 40 L30 48 L22 40 L22 20 Z'/%3E%3Cpath d='M0 30 L16 30 M44 30 L60 30'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(155deg, #1f5c7c 0%, #163f5c 48%, #0d2438 100%);
    background-size: 60px 60px, cover;
}

.login-choice-box {
    background: #fffdfa;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(10, 40, 55, .35);
    overflow: hidden;
}

/* شريط ذهبي علوي رفيع — من الشعار */
.login-choice-box::before {
    content: "";
    display: block;
    height: 4px;
    margin: -1px -1px 0;
    background: linear-gradient(90deg, #236b8c, #bd9450, #236b8c);
}

/* === الشعار: كلمة "جياد" وحدها، مقصوصة من الملف الأصلي === */
/* الإطار داخل logo.jpg: x208 y247 · 407×335 من 833×1024 */
.jyad-mark {
    width: min(230px, 62vw);
    aspect-ratio: 407 / 328;
    margin: 26px auto 12px;
    /* SVG شفاف: الأبيض مُزال بمرشّح لوني، والألوان الأصلية كما هي بلا تحوير */
    background: url("../img/jyad-mark.svg") center / contain no-repeat;
}

/* إخفاء الدائرة القديمة في شاشة الدخول */
.login-brand-block .circle-logo { display: none; }

.login-brand-tagline {
    margin: 0 0 2px;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
    color: #8a6a34;
    letter-spacing: .2px;
}

/* === شعار الترويسة: نفس القصّة، أصغر === */
.circle-logo--header-brand .circle-logo__frame,
.circle-logo--header-brand .circle-logo__ring { display: none; }
.circle-logo--header-brand {
    width: 62px;
    aspect-ratio: 407 / 328;
    height: auto;
    border-radius: 0;
    background: url("../img/jyad-mark.svg") center / contain no-repeat;
    box-shadow: none;
}

@media (max-width: 480px) {
    .jyad-mark { width: min(190px, 58vw); }
    .circle-logo--header-brand { width: 52px; }
}

/* شاشة الدخول: الشعار يغني عن تكرار الاسم نصّاً */
.login-choice-box .login-brand-subtitle { display: none; }
.login-choice-box > h2 { display: none; }
.login-choice-box > p {
    margin: 2px 0 16px;
    text-align: center;
    color: #64748b;
    font-size: .88rem;
    font-weight: 600;
}

/* علامة جياد في الترويسة */
.jyad-mark--header {
    width: 58px;
    margin: 0 0 0 10px;
    flex-shrink: 0;
}
@media (max-width: 480px) { .jyad-mark--header { width: 46px; margin-inline-end: 6px; } }

/* === اسم الرّاصد: شارة صغيرة في رأس البطاقة، بلا حيّز إضافي === */
.card-head-main .student-recorder-name {
    padding: 2px 8px;
    font-size: .66rem;
    font-weight: 700;
    background: transparent;
    color: #8a6a34;
    border: 1px solid #e4dccb;
    border-radius: 99px;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-head-main .student-recorder-name::before {
    content: "\f303";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: .58rem;
    margin-inline-end: 4px;
    opacity: .75;
}
.card-head-main .student-recorder-name:hover { background: #faf6ee; border-color: #d8caa8; }

/* === خانات الجوال: مقروءة، ثلاث في الصف للحقول القصيرة === */
@media (max-width: 640px) {
    .skills-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
    /* الحقول النصية والاختيارية تحتاج عرضاً أكبر */
    /* النصّ وحده يأخذ صفاً كاملاً — القوائم تبقى ضمن الأعمدة */
    .skills-grid .skill-field:has(input[data-type="text"]) { grid-column: span 3; }
    .skills-grid .skill-field label { font-size: .78rem; margin-bottom: 4px; }
    .admin-student-card .skills-grid .skill-input { padding: 8px 9px; font-size: .88rem; }
}
@media (max-width: 380px) {
    .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .skills-grid .skill-field:has(input[data-type="text"]) { grid-column: span 2; }
}

/* === أزرار اختيار الدخول === */
.login-buttons-row { gap: 10px; }
.login-choice-box .btn-primary-custom,
.login-choice-box .btn-secondary-custom {
    font-family: "Tajawal", sans-serif;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .2px;
    padding: 13px 18px;
    border-radius: 13px;
    transition: transform .15s ease, box-shadow .2s ease;
}
.login-choice-box .btn-primary-custom {
    background: linear-gradient(135deg, #2a7a9c, #1d5a78);
    box-shadow: 0 6px 16px rgba(23, 80, 107, .28);
}
.login-choice-box .btn-secondary-custom {
    background: #fff;
    color: #17506b;
    border: 1.5px solid #dfd8cc;
}
.login-choice-box .btn-primary-custom:active,
.login-choice-box .btn-secondary-custom:active { transform: scale(.97); }

@media (max-width: 520px) {
    .login-buttons-row { flex-direction: column; }
    .login-choice-box .btn-primary-custom,
    .login-choice-box .btn-secondary-custom { width: 100%; justify-content: center; font-size: 1rem; padding: 15px; }
}


/* === شاشتا الرمز: الشعار أولاً ثم الرمز مباشرة تحته === */
.login-choice-box--compact .jyad-mark {
    width: min(180px, 52vw);
    margin: 18px auto 6px;
}
/* لا حاجة لعنوان "دخول المشرف" / "تسجيل دخول جواد" — الشعار يكفي */
.login-choice-box--compact > h2,
#studentCodeEntryBlock > h2 { display: none; }
.login-choice-box--compact > p,
#studentCodeEntryBlock > p {
    margin: 0 0 14px;
    text-align: center;
    color: #6b7c85;
    font-size: .9rem;
    font-weight: 700;
}
.login-choice-box--compact .code-entry-row > label {
    text-align: center;
    display: block;
    font-size: .82rem;
    color: #8a94a0;
    margin-bottom: 8px;
}


/* === شعار جياد علامة مائية فوق الزخارف === */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    /* وسط الشاشة تماماً — والطبقة أعلى من الزخارف فلا تغطّيه */
    background: url("../img/jyad-mark.svg") center center / min(520px, 74vw) auto no-repeat;
    opacity: .10;
    pointer-events: none;
    z-index: 0;
}
/* المحتوى فوق العلامة، بلا المساس بتموضع الطبقات المثبّتة */
.main-container > *, .student-view > * { position: relative; z-index: 1; }

/* === شاشتا الرمز: بلا عنوان حقل، والسطر التمهيدي أنزل قليلاً === */
.login-choice-box--compact .code-entry-row > label { display: none; }
.login-choice-box--compact > p,
#studentCodeEntryBlock > p { margin: 26px 0 22px; }
.login-choice-box--compact .jyad-mark { margin-bottom: 0; }

/* كلمة "الجواد" بخطّ قريب من مخطوطة الشعار */
.jyad-word {
    font-family: "Aref Ruqaa", "Tajawal", serif;
    color: #17506b;
    font-weight: 700;
    font-size: 1.22em;
    line-height: 1;
}


/* ══════════ الشاشة الرئيسية — إعادة تصميم ══════════ */

/* ---- الشريط العلوي: أنحف وأهدأ ---- */
.admin-top-header {
    padding: 10px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #fbfaf7 100%);
    border: 1px solid #e8e3d9;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #236b8c, #bd9450) 1;
    box-shadow: 0 2px 10px rgba(20, 58, 77, .05);
    margin-bottom: 16px;
}
.admin-top-header h1 { font-size: 1.02rem; letter-spacing: -.2px; }
.admin-top-header .brand-text-group span { font-size: .68rem; opacity: .7; }
.admin-menu-btn {
    width: 36px; height: 36px; border-radius: 10px;
    background: #f4f1ea; border: 1px solid #e4e0d9; color: #17506b;
}
.admin-top-header .btn-logout {
    padding: 7px 12px; font-size: .78rem; border-radius: 10px;
}

/* ---- فارس الأسبوع: بطاقة أفقية أنيقة ---- */
.knight-showcase-box.admin-home-knight {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 18px;
    background:
        radial-gradient(120% 140% at 88% 0%, rgba(189,148,80,.22) 0%, transparent 55%),
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%);
    border: 1px solid rgba(189,148,80,.35);
    box-shadow: 0 10px 26px rgba(18, 50, 67, .28);
    overflow: hidden;
    position: relative;
}
/* وسام دائري بدل التاج المتصدّر */
.admin-home-knight .knight-avatar-icon {
    width: 54px; height: 54px; margin: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #d8b26c, #a8813f);
    color: #14323f; font-size: 1.5rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.45);
    flex-shrink: 0;
}
.admin-home-knight .knight-content-center {
    display: grid; grid-template-columns: auto 1fr; align-items: center;
    gap: 14px; text-align: right; grid-column: 1 / 3;
}
.admin-home-knight .knight-header-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 99px;
    background: rgba(189,148,80,.16);
    border: 1px solid rgba(189,148,80,.4);
    color: #e6c78a; font-size: .68rem; font-weight: 800;
}
.admin-home-knight .knight-name-display {
    font-size: 1.28rem; font-weight: 800; color: #fff;
    margin: 4px 0 0; text-shadow: 0 1px 8px rgba(0,0,0,.3);
}
.admin-home-knight .knight-score-badge {
    background: linear-gradient(135deg, #d8b26c, #a8813f);
    color: #12303d; font-weight: 800; font-size: .82rem;
    padding: 5px 14px; border-radius: 99px; justify-self: start;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.admin-home-knight .knight-footer-info {
    grid-column: 1 / -1;
    font-size: .66rem; color: rgba(255,255,255,.5);
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 9px; margin-top: 2px; text-align: center;
}

@media (max-width: 560px) {
    .knight-showcase-box.admin-home-knight { padding: 14px 16px; gap: 12px; }
    .admin-home-knight .knight-name-display { font-size: 1.1rem; }
    .admin-home-knight .knight-avatar-icon { width: 46px; height: 46px; font-size: 1.25rem; }
}

/* ---- شريط اليوم والأسبوع: أهدأ وأقل ازدحاماً ---- */
.unified-control-panel {
    background: linear-gradient(135deg, #1d5b78 0%, #17506b 100%);
    border-radius: 14px;
    padding: 12px 16px;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(23, 80, 107, .18);
}
.unified-control-panel label {
    font-size: .72rem; opacity: .85; font-weight: 700;
}
.unified-control-panel select {
    padding: 8px 10px; font-size: .82rem; border-radius: 9px;
    background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.3);
}
.unified-selectors-group { gap: 10px; }

/* ---- شريط التقدّم: ملتصق بلوحة التحكم ---- */
.record-progress {
    margin-top: -6px;
    border-radius: 0 0 14px 14px;
    border-top: none;
    background: #fffdfa;
}

/* ══════════ أوائل اليوم — منصّة تتويج ══════════ */
#adminViewExcellence .admin-subpage-head {
    background: linear-gradient(135deg, #143a4d, #1b5068);
    border-radius: 16px; padding: 14px 18px; color: #fff;
    border: 1px solid rgba(189,148,80,.3);
}
#adminViewExcellence .admin-subpage-title { color: #fff; }
#adminViewExcellence .admin-subpage-icon {
    background: linear-gradient(145deg, #d8b26c, #a8813f);
    color: #14323f;
}
#adminViewExcellence .chart-day-badge-lg {
    background: rgba(255,255,255,.14); color: #e6c78a;
    border: 1px solid rgba(189,148,80,.4);
}
#adminViewExcellence .chart-panel-box {
    background: #fffdfa; border: 1px solid #e8e3d9; border-radius: 16px;
    padding: 14px; margin-top: 12px;
}
/* المراكز الثلاثة الأولى بألوان الأوسمة */
.excellence-list-full > *:nth-child(1) {
    background: linear-gradient(90deg, rgba(216,178,108,.22), rgba(216,178,108,.05));
    border-inline-start: 3px solid #bd9450;
}
.excellence-list-full > *:nth-child(2) {
    background: linear-gradient(90deg, rgba(148,163,184,.2), rgba(148,163,184,.04));
    border-inline-start: 3px solid #94a3b8;
}
.excellence-list-full > *:nth-child(3) {
    background: linear-gradient(90deg, rgba(180,120,70,.18), rgba(180,120,70,.04));
    border-inline-start: 3px solid #b47846;
}
.excellence-list-full > * { border-radius: 11px; margin-bottom: 7px; }

/* ══════════ شاشة اسم المشرف: ترتيب وتبسيط ══════════ */
#adminNameOverlay .login-choice-box--compact > h2,
#adminNameEntryBlock > h2, #adminNameSavedBlock > h2 { display: none; }
#adminNameEntryBlock > p, #adminNameSavedBlock > p {
    margin: 24px 0 18px; text-align: center;
    color: #6b7c85; font-size: .9rem; font-weight: 700;
}
#adminNameEntryBlock .row { margin-bottom: 16px; }
#adminNameEntryBlock .row > label { display: none; }
#adminNameEntryBlock #adminNameInput {
    width: 100%; text-align: center;
    padding: 13px 14px; font-size: 1rem; font-weight: 700;
    border: 1.5px solid #dfd8cc; border-radius: 12px; background: #fff;
}
#adminNameEntryBlock #adminNameInput:focus {
    outline: none; border-color: #236b8c;
    box-shadow: 0 0 0 3px rgba(35,107,140,.14);
}
#adminNameOverlay .login-buttons-row { gap: 10px; margin-top: 4px; }
#adminNameSavedBlock .student-quick-login-btn { width: 100%; margin-bottom: 9px; }
#adminNameSavedBlock .btn-secondary-custom { width: 100%; margin-bottom: 8px; }

/* بطاقة الفارس: عرض كامل وتخطيط أفقي مضبوط */
.knight-showcase-box.admin-home-knight {
    max-width: 760px;
    margin: 0 auto 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "medal name tag"
        "medal score tag"
        "foot  foot  foot";
    align-items: center;
    gap: 4px 16px;
}
.admin-home-knight .knight-avatar-icon { grid-area: medal; align-self: center; }
.admin-home-knight > div:first-child { grid-area: tag; align-self: center; }
.admin-home-knight .knight-content-center {
    grid-area: name; display: contents;
}
.admin-home-knight .knight-name-display { grid-area: name; align-self: end; }
.admin-home-knight .knight-score-badge { grid-area: score; align-self: start; }
.admin-home-knight .knight-footer-info { grid-area: foot; }

/* ═════════ دفعة التحسينات ═════════ */

/* --- العلامة المائية: أنزل قليلاً وأوضح فوق الزخارف --- */
body::before {
    background-position: center 58% !important;
    opacity: .16 !important;
}

/* --- الرابط العام: مسافة بين الشعار والأزرار --- */
.login-choice-box .login-buttons-row { margin-top: 26px; }

/* --- شاشة الجواد: السطر أنزل، وكلمة الجواد أبرز --- */
#studentCodeEntryBlock > p { margin: 32px 0 22px; font-size: .95rem; }
.jyad-word {
    font-family: "Aref Ruqaa", "Tajawal", serif;
    color: #143a4d;
    font-weight: 700;
    font-size: 1.45em;
    line-height: 1;
    padding-inline: 3px;
    vertical-align: -2px;
}

/* --- شاشة اسم المشرف: زران في صف واحد --- */
#adminNameSavedBlock .student-quick-login-btn { width: 100%; margin-bottom: 12px; }
#adminNameSavedBlock .quick-actions-row {
    display: flex; gap: 10px;
}
#adminNameSavedBlock .quick-actions-row > .btn-secondary-custom {
    flex: 1; width: auto; margin: 0;
}
#adminSavedNameLabel { margin-inline-start: 2px; }

/* --- الشريط العلوي: على الهوية --- */
.admin-top-header {
    background: linear-gradient(135deg, #ffffff, #f9f7f2) !important;
    border: 1px solid #e6e0d4 !important;
    border-bottom: 3px solid transparent !important;
    border-image: linear-gradient(90deg, #236b8c 0%, #bd9450 50%, #236b8c 100%) 1 !important;
    box-shadow: 0 3px 14px rgba(20,58,77,.07) !important;
}
.admin-top-header h1 {
    font-size: 1.12rem; font-weight: 800; color: #143a4d; margin: 0;
}
.admin-menu-btn {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, #236b8c, #17506b) !important;
    border: none !important; color: #fff !important;
    box-shadow: 0 2px 8px rgba(23,80,107,.28);
}
.admin-top-header .btn-logout {
    background: #fdf6f6; color: #b04242; border: 1px solid #f0d5d5;
    padding: 8px 13px; font-size: .78rem; border-radius: 11px; font-weight: 700;
}

/* --- فارس الأسبوع: عنوان أعلى · اسم ذهبي متدرّج · مهور يسار --- */
.knight-showcase-box.admin-home-knight {
    grid-template-areas:
        "tag   tag   tag"
        "score name  medal" !important;
    grid-template-columns: auto 1fr auto !important;
    gap: 10px 14px !important;
    padding: 14px 18px 16px !important;
}
.admin-home-knight > div:first-child { grid-area: tag; justify-self: center; }
.admin-home-knight .knight-header-tag {
    background: rgba(214,178,110,.18);
    border-color: rgba(214,178,110,.5);
    color: #f0d9a8; font-size: .72rem;
}
.admin-home-knight .knight-avatar-icon {
    grid-area: medal;
    box-shadow: 0 3px 10px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.5) !important;
    background: linear-gradient(145deg, #f0d089, #c49a4e) !important;
    color: #12303d !important;
}
.admin-home-knight .knight-name-display {
    grid-area: name; justify-self: center; align-self: center !important;
    font-size: 1.42rem; font-weight: 800; margin: 0 !important;
    background: linear-gradient(100deg, #f6e2b0 0%, #e3c179 30%, #fff3d4 50%, #d4ac60 72%, #f2dcaa 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    text-shadow: none;
}
.admin-home-knight .knight-score-badge {
    grid-area: score; justify-self: start !important; align-self: center !important;
    background: linear-gradient(135deg, #e0bd77, #b18c47) !important;
}

/* --- شريط الأسبوع واليوم: حقول على الهوية --- */
.unified-control-panel {
    background: linear-gradient(135deg, #1f5f7d 0%, #17506b 100%) !important;
    border: 1px solid rgba(189,148,80,.28) !important;
    border-radius: 14px 14px 0 0 !important;
    margin-bottom: 0 !important;
    padding: 13px 16px !important;
}
.unified-control-panel .control-item-wrap {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.unified-control-panel label {
    color: #cfe4ee !important; font-size: .74rem; white-space: nowrap; margin: 0;
}
.unified-control-panel select {
    flex: 1; min-width: 0;
    background: rgba(255,255,255,.97) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23236b8c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left 12px center;
    -webkit-appearance: none; appearance: none;
    border: 1px solid rgba(255,255,255,.35) !important;
    border-radius: 10px !important;
    padding: 9px 12px 9px 30px !important;
    font-size: .82rem !important; font-weight: 700; color: #143a4d !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.unified-control-panel select:focus {
    outline: none; border-color: #bd9450 !important;
    box-shadow: 0 0 0 3px rgba(189,148,80,.28);
}

/* --- شريط التقدّم + الأزرار في سطر واحد --- */
.record-progress {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 0 0 18px !important;
    border-radius: 0 0 14px 14px !important;
    border: 1px solid #e6e0d4; border-top: none;
    background: #fffdfa; padding: 10px 16px;
}
.record-progress-track { flex: 1 1 120px; }
.record-actions { display: flex; gap: 8px; margin-inline-start: auto; }
.record-actions .btn-action,
.record-actions .btn-primary-custom {
    padding: 8px 14px !important; font-size: .8rem !important;
    border-radius: 10px !important; margin: 0 !important; white-space: nowrap;
}
.record-actions .btn-search-students {
    background: #f2efe9 !important; color: #17506b !important;
    border: 1px solid #e0dace !important;
}
.record-actions .btn-save-all {
    background: linear-gradient(135deg, #bd9450, #a8813f) !important;
    color: #fff !important; border: none !important;
}

/* --- بطاقات الجوال: أصغر وأنظف --- */
@media (max-width: 640px) {
    .admin-student-card { border-radius: 13px; }
    .card-head { padding: 9px 11px; }
    .card-head .card-title { font-size: .88rem; }
    .card-body { padding: 0 11px 11px; }
    .skills-grid { gap: 7px; }
    .skills-grid .skill-field { padding: 5px 7px; border-radius: 9px; }
    .skills-grid .skill-field label { font-size: .7rem; margin-bottom: 3px; }
    .admin-student-card .skills-grid .skill-input {
        padding: 6px 8px !important; font-size: .8rem !important; border-radius: 7px !important;
    }
    .admin-student-card .btn-card-save { padding: 8px !important; font-size: .78rem !important; }
    .record-progress { padding: 9px 12px; gap: 9px; }
    .record-actions { width: 100%; }
    .record-actions .btn-action, .record-actions .btn-primary-custom { flex: 1; justify-content: center; }
    .unified-control-panel { flex-direction: column; align-items: stretch; }
    .unified-selectors-group { flex-direction: column; gap: 9px; width: 100%; }
    .admin-home-knight .knight-name-display { font-size: 1.15rem; }
}

/* --- قائمة التبويبات: تظهر فوق كل شيء --- */
.admin-menu-wrap { position: relative; z-index: 500; }
.admin-menu-dropdown { z-index: 900 !important; }

/* ══════════ دفعة 6 ══════════ */

.native-hidden { display: none !important; }

/* --- قوائم منسدلة مدمجة بهوية جياد --- */
.jd-select { position: relative; flex: 1; min-width: 0; }
.jd-select__btn {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    gap: 8px; cursor: pointer; font-family: inherit;
    padding: 10px 13px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f4ee 100%);
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 11px;
    box-shadow: 0 2px 8px rgba(8,32,45,.18), inset 0 1px 0 #fff;
    color: #143a4d; font-weight: 800; font-size: .84rem;
    text-align: right;
}
.jd-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-select__caret { color: #bd9450; font-size: .72rem; transition: transform .22s ease; flex-shrink: 0; }
.jd-select.is-open .jd-select__caret { transform: rotate(180deg); }
.jd-select.is-open .jd-select__btn { border-color: #bd9450; box-shadow: 0 0 0 3px rgba(189,148,80,.3); }

.jd-select__menu {
    position: absolute; top: calc(100% + 6px); inset-inline: 0;
    background: #fffdfa; border: 1px solid #e4dccb; border-radius: 13px;
    box-shadow: 0 14px 34px rgba(12,38,52,.28);
    padding: 6px; z-index: 800;
    max-height: 52vh; overflow-y: auto;
    animation: jdDrop .18s ease;
}
@keyframes jdDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.jd-select__opt {
    display: block; width: 100%; text-align: right;
    padding: 11px 12px; border: none; background: transparent;
    font-family: inherit; font-size: .85rem; font-weight: 700; color: #244a5c;
    border-radius: 9px; cursor: pointer;
}
.jd-select__opt:hover { background: #f0f5f8; }
.jd-select__opt.is-active {
    background: linear-gradient(135deg, #236b8c, #17506b); color: #fff;
}

/* الحقلان في سطر واحد */
.unified-selectors-group { display: flex; gap: 10px; width: 100%; }
.unified-control-panel .control-item-wrap { flex: 1; min-width: 0; display: block; }
.unified-control-panel .control-item-wrap label {
    display: block; margin-bottom: 5px; font-size: .68rem;
    color: #b9d6e4 !important; font-weight: 700;
}

/* --- الشريط العلوي: كل شيء في سطر واحد --- */
.admin-top-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: nowrap !important;
    padding: 9px 13px !important;
}
.admin-header-start { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.brand-logo-header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-top-header h1 {
    font-size: 1rem !important; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.jyad-mark--header { width: 46px !important; margin: 0 !important; }
.admin-top-header .header-actions { flex-shrink: 0; }
/* تسجيل الخروج: أيقونة فقط، أحمر غامق */
.admin-top-header .btn-logout {
    width: 36px; height: 36px; padding: 0 !important;
    display: flex; align-items: center; justify-content: center;
    background: #8f2020 !important; color: #fff !important;
    border: none !important; border-radius: 10px !important;
    font-size: .92rem;
}
.admin-top-header .btn-logout span,
.admin-top-header .btn-logout { font-size: 0 !important; }
.admin-top-header .btn-logout i { font-size: 15px !important; }

/* --- فارس الأسبوع: تبديل التاج والمهور + توهج خفيف --- */
.knight-showcase-box.admin-home-knight {
    grid-template-areas:
        "tag   tag   tag"
        "medal name  score" !important;
    box-shadow: 0 8px 22px rgba(12,38,52,.3), 0 0 34px rgba(190,150,82,.10) !important;
}
.admin-home-knight .knight-avatar-icon {
    grid-area: medal !important;
    background: linear-gradient(145deg, #f6e2b0, #d4ac60 55%, #b5893f) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.55) !important;
}
.admin-home-knight .knight-score-badge {
    grid-area: score !important; justify-self: end !important;
    background: linear-gradient(145deg, #f6e2b0, #d4ac60 55%, #b5893f) !important;
    color: #123040 !important; font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.2) !important;
}
.admin-home-knight .knight-name-display {
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.45));
}

/* ══════════ الجوال أولاً ══════════ */
@media (max-width: 640px) {
    .admin-top-header { padding: 8px 11px !important; gap: 8px; }
    .admin-top-header h1 { font-size: .93rem !important; }
    .jyad-mark--header { width: 40px !important; }
    .admin-menu-btn { width: 34px; height: 34px; }
    .admin-top-header .btn-logout { width: 33px; height: 33px; }

    .unified-selectors-group { flex-direction: row !important; gap: 8px; }
    .jd-select__btn { padding: 9px 11px; font-size: .78rem; }
    .unified-control-panel .control-item-wrap label { font-size: .64rem; }
    .jd-select__opt { padding: 13px 12px; font-size: .86rem; }   /* هدف لمس مريح */

    .admin-home-knight .knight-avatar-icon { width: 42px !important; height: 42px !important; font-size: 1.1rem !important; }
    .admin-home-knight .knight-name-display { font-size: 1.12rem !important; }
    .admin-home-knight .knight-score-badge { font-size: .74rem !important; padding: 4px 11px !important; }
}


/* ══════════ دفعة 7 ══════════ */

/* ---- الشريط العلوي: عائم · زوايا علوية مشطوفة ---- */
.admin-top-header {
    position: sticky; top: 8px; z-index: 700;
    border-radius: 0 0 16px 16px !important;
    clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%, 0 18px);
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(249,247,242,.97)) !important;
    border: none !important;
    box-shadow: 0 4px 18px rgba(20,58,77,.13) !important;
}
/* شعار جياد في منتصف الشريط */
.admin-top-header { position: sticky; }
.jyad-mark--header {
    position: absolute; left: 50%; transform: translateX(-50%);
    width: 52px !important; margin: 0 !important; pointer-events: none;
}
/* العنوان يقترب من النقاط الثلاث ومتدرّج */
.admin-header-start { gap: 6px !important; }
.admin-top-header h1 {
    background: linear-gradient(100deg, #143a4d 0%, #236b8c 55%, #17506b 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    font-weight: 800 !important;
}
/* الخروج: رمز أحمر غامق بلا خلفية، مائل قليلاً */
.admin-top-header .btn-logout {
    background: transparent !important; border: none !important;
    box-shadow: none !important; width: auto !important; height: auto !important;
    padding: 4px !important;
}
.admin-top-header .btn-logout i {
    color: #7d1a1a !important; font-size: 19px !important;
    transform: rotate(-12deg); display: inline-block;
}

/* ---- القوائم المنسدلة: فوق كل شيء ---- */
.unified-control-panel { overflow: visible !important; z-index: 60; position: relative; }
.unified-selectors-group, .control-item-wrap { overflow: visible !important; }
.jd-select { position: relative; z-index: 80; }
.jd-select.is-open { z-index: 900; }
.jd-select__menu { z-index: 950 !important; }
.knight-showcase-box { z-index: 1; }
/* عناوين القائمتين للّيسار قليلاً */
.unified-control-panel .control-item-wrap label { padding-inline-start: 6px; }

/* ---- شريط الإجراءات: بحث أوسع · حفظ أضيق وأخضر غامق ---- */
.record-actions { gap: 8px; flex: 1 1 auto; }
.record-actions .btn-save-all {
    flex: 0 0 auto; min-width: 104px;
    background: linear-gradient(135deg, #15654a, #0e4a36) !important;
    font-family: "Tajawal", sans-serif !important; font-weight: 800 !important;
    letter-spacing: .2px;
}
.record-actions .btn-search-students {
    font-family: "Tajawal", sans-serif !important; font-weight: 800 !important;
}
/* البحث كقائمة منسدلة داخل الصفحة */
.student-search-inline { position: relative; flex: 1 1 150px; min-width: 0; }
.student-search-inline input {
    width: 100%; padding: 9px 34px 9px 12px;
    border: 1px solid #e0dace; border-radius: 10px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23236b8c' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 11px center;
    font-family: inherit; font-weight: 700; font-size: .82rem; color: #143a4d;
}
.student-search-inline input:focus {
    outline: none; border-color: #236b8c; box-shadow: 0 0 0 3px rgba(35,107,140,.15);
}
.student-search-results {
    position: absolute; top: calc(100% + 6px); inset-inline: 0;
    background: #fffdfa; border: 1px solid #e4dccb; border-radius: 12px;
    box-shadow: 0 14px 32px rgba(12,38,52,.26);
    padding: 5px; z-index: 960; max-height: 46vh; overflow-y: auto;
}
.student-search-results button {
    display: block; width: 100%; text-align: right; border: none; background: transparent;
    padding: 11px 12px; border-radius: 9px; font-family: inherit;
    font-weight: 700; font-size: .85rem; color: #244a5c; cursor: pointer;
}
.student-search-results button:hover { background: #f0f5f8; }
.student-search-empty { padding: 12px; text-align: center; color: #94a3b8; font-size: .82rem; }

/* ---- كبسولة (رُصد + الراصد) ---- */
.card-head-main { gap: 6px !important; }
.admin-student-card.is-recorded .card-tag--done {
    border-radius: 99px 0 0 99px; margin-inline-end: -1px;
    border: 1px solid #bfe3cb; border-inline-end: none;
}
.card-head-main .student-recorder-name {
    border-radius: 0 99px 99px 0 !important;
    border: 1px solid #e4dccb !important; border-inline-start: none !important;
    margin-inline-start: 0 !important;
}
.admin-student-card:not(.is-recorded) .card-head-main .student-recorder-name {
    border-radius: 99px !important; border-inline-start: 1px solid #e4dccb !important;
}

/* ---- الحضور ومقدار التسميع في صف واحد ---- */
.skills-grid .skill-field:has(input[data-type="text"]) { grid-column: auto !important; }

/* ---- فارس الأسبوع ---- */
.knight-showcase-box.admin-home-knight {
    border: 2px solid transparent !important;
    background-image:
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%),
        linear-gradient(120deg, #f6e2b0, #d4ac60 45%, #b5893f 70%, #f2dcaa) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    box-shadow: 0 8px 20px rgba(12,38,52,.26) !important;
    padding-top: 0 !important;
    overflow: hidden;
}
/* شارة العنوان من حد الرأس، شطف سفلي فقط */
.admin-home-knight > div:first-child {
    justify-self: stretch !important; width: 100%;
}
.admin-home-knight .knight-header-tag {
    display: flex !important; justify-content: center; width: 100%;
    margin: 0; padding: 7px 0 8px; border-radius: 0 !important;
    border: none !important;
    background: linear-gradient(90deg, rgba(214,178,110,.1), rgba(214,178,110,.26), rgba(214,178,110,.1)) !important;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 12px));
}
.admin-home-knight .knight-avatar-icon {
    align-self: start !important; margin-top: 2px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.5) !important;
}
.admin-home-knight .knight-name-display {
    font-size: clamp(1rem, 4.6vw, 1.62rem) !important;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%; padding-inline: 6px;
}

@media (max-width: 640px) {
    .jyad-mark--header { width: 44px !important; }
    .record-actions { flex-wrap: nowrap; }
    .record-actions .btn-save-all { min-width: 92px; }
}

/* إبراز البطاقة عند الوصول إليها من البحث */
.admin-student-card.is-highlight {
    box-shadow: 0 0 0 3px rgba(189,148,80,.55), 0 8px 22px rgba(12,38,52,.18) !important;
    transition: box-shadow .3s ease;
}

/* توازن شريط الإجراءات: البحث يتمدّد · الحفظ ثابت أضيق */
.record-actions { display: flex; align-items: center; gap: 8px; width: 100%; }
.record-actions .student-search-inline { flex: 1 1 auto !important; min-width: 0; }
.record-actions .btn-save-all,
.record-actions .btn-primary-custom {
    flex: 0 0 auto !important; width: auto !important;
    min-width: 0 !important; max-width: 132px;
    padding: 9px 14px !important;
}
@media (max-width: 640px) {
    .record-actions .btn-save-all { max-width: 118px; font-size: .78rem !important; }
    .record-actions .student-search-inline input { font-size: .8rem; }
}


/* ══════════ دفعة 8 ══════════ */

/* --- الشريط: إطار متدرّج · لا ميلان للرمز · لا يلتصق بالحواف في التطبيق --- */
.admin-top-header {
    margin: max(10px, env(safe-area-inset-top)) 10px 16px !important;
    top: max(8px, env(safe-area-inset-top)) !important;
    border: 1.5px solid transparent !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,.97), rgba(249,247,242,.97)) padding-box,
        linear-gradient(135deg, #17506b, #2a7a9c 45%, #143a4d) border-box !important;
}
.admin-top-header .btn-logout i { transform: none !important; }
.admin-top-header .btn-logout.is-armed i { color: #d92626 !important; animation: pulseOut .5s ease infinite alternate; }
@keyframes pulseOut { to { transform: scale(1.18); } }

/* --- قائمة النقاط الثلاث فوق كل شيء --- */
.admin-menu-wrap { position: relative; z-index: 1200 !important; }
.admin-menu-dropdown { z-index: 1300 !important; }
.admin-top-header { overflow: visible !important; }

/* --- قوائم الأسبوع/اليوم: سطر واحد لكل خيار --- */
.jd-select__menu { min-width: max(100%, 250px); }
.jd-select__opt {
    white-space: nowrap; font-size: .8rem; padding: 11px 12px;
    overflow: hidden; text-overflow: ellipsis;
}

/* --- فارس الأسبوع --- */
.admin-home-knight .knight-name-display {
    font-size: clamp(1.05rem, 5.4vw, 1.85rem) !important;
    background-size: 220% 100%;
    animation: goldFlow 5s ease-in-out infinite;
}
@keyframes goldFlow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* شارة العنوان أضيق مع شطف سفلي */
.admin-home-knight > div:first-child { justify-self: center !important; width: auto !important; }
.admin-home-knight .knight-header-tag {
    width: auto !important; padding: 7px 26px 8px !important;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), calc(100% - 13px) 100%, 13px 100%, 0 calc(100% - 11px)) !important;
}
/* توهج التاج مخفّف جداً */
.admin-home-knight .knight-avatar-icon {
    box-shadow: 0 1px 4px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.45) !important;
}
/* إطار ذهبي متحرك */
.knight-showcase-box.admin-home-knight {
    background-size: 100% 100%, 260% 100% !important;
    animation: borderFlow 6s linear infinite;
}
@keyframes borderFlow {
    0% { background-position: 0 0, 0% 50%; }
    100% { background-position: 0 0, 260% 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .knight-showcase-box.admin-home-knight, .admin-home-knight .knight-name-display { animation: none; }
}

/* --- كبسولة رُصد + الراصد: الترتيب الصحيح في RTL --- */
.admin-student-card.is-recorded .card-tag--done {
    border-radius: 0 99px 99px 0 !important;
    border: 1px solid rgba(21,101,74,.35) !important;
    border-inline-start: none !important;
    background: rgba(21,101,74,.30) !important;
    color: #0d3d2c !important;
}
.card-head-main .student-recorder-name {
    border-radius: 99px 0 0 99px !important;
    border: 1px solid #e4dccb !important; border-inline-end: none !important;
}
.admin-student-card:not(.is-recorded) .card-head-main .student-recorder-name {
    border-radius: 99px !important; border-inline-end: 1px solid #e4dccb !important;
}

/* --- زر حفظ درجات الجواد = نفس أخضر حفظ الكل --- */
.admin-student-card .btn-card-save {
    background: linear-gradient(135deg, #15654a, #0e4a36) !important;
    color: #fff !important; border: none !important;
    font-family: "Tajawal", sans-serif !important;
    font-weight: 800 !important; letter-spacing: .2px;
}

/* --- لوحة الراصد: ترتيب --- */
.recorder-detail-box { border-radius: 16px; overflow: hidden; }
.recorder-detail-box h3 {
    background: linear-gradient(135deg, #17506b, #236b8c); color: #fff;
    margin: 0; padding: 13px 16px; font-size: .95rem;
}
.recorder-detail-section { padding: 12px 16px; }
.recorder-detail-who {
    display: flex; align-items: center; gap: 8px;
    background: #f7f4ee; border: 1px solid #e6e0d4; border-radius: 11px;
    padding: 10px 12px; margin-bottom: 10px; font-weight: 800; color: #143a4d;
}
.recorder-detail-entry {
    border-inline-start: 3px solid #bd9450; background: #fffdfa;
    border-radius: 0 10px 10px 0; padding: 9px 12px; margin-bottom: 8px;
}
.recorder-detail-entry p { margin: 0; font-size: .84rem; color: #33505f; line-height: 1.6; }
.recorder-detail-time { display: block; margin-top: 4px; font-size: .7rem; color: #94a3b8; }


/* ══════════ دفعة 9 ══════════ */

/* ---- لا تمرير أفقي إطلاقاً ---- */
html, body { overflow-x: hidden !important; max-width: 100%; }
.main-container, .admin-view, .student-view { max-width: 100%; }

/* ---- الشريط العلوي: بلا clip-path (كان يقصّ القائمة والإطار) ---- */
.admin-top-header {
    position: sticky;
    clip-path: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    box-sizing: border-box;
    width: auto !important;
    margin: max(10px, env(safe-area-inset-top)) 10px 16px !important;
    padding: 10px 14px !important;
    backdrop-filter: none !important;
    isolation: isolate;
    z-index: 1000;
}
/* الإطار المشطوف = طبقة خلفية، فلا يقصّ المحتوى */
.admin-top-header::before,
.admin-top-header::after {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
}
.admin-top-header::before {
    inset: 0;
    background: linear-gradient(135deg, #17506b, #2a7a9c 45%, #143a4d);
    clip-path: polygon(17px 0, calc(100% - 17px) 0, 100% 17px, 100% 100%, 0 100%, 0 17px);
    filter: drop-shadow(0 4px 14px rgba(20,58,77,.16));
}
.admin-top-header::after {
    inset: 1.6px;
    background: linear-gradient(135deg, #ffffff, #f9f7f2);
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%, 0 16px);
}

/* ---- القوائم: لا تتجاوز الشاشة ولا تُقصّ ---- */
.jd-select__menu {
    inset-inline-start: 0; inset-inline-end: auto;
    width: max(100%, 232px);
    max-width: calc(100vw - 46px);
    min-width: 0 !important;
}
.admin-menu-dropdown {
    max-width: calc(100vw - 40px);
    z-index: 1400 !important;
}
.admin-menu-wrap { z-index: 1400 !important; }

/* ---- انسيابية عامة ---- */
.card-body-wrap { transition: grid-template-rows .42s cubic-bezier(.33,1,.68,1), opacity .3s ease !important; }
.card-body { transition: padding .42s cubic-bezier(.33,1,.68,1) !important; }
.card-chevron { transition: transform .35s cubic-bezier(.33,1,.68,1) !important; }
.jd-select__caret { transition: transform .3s cubic-bezier(.33,1,.68,1) !important; }
.admin-menu-dropdown, .jd-select__menu, .student-search-results {
    animation: softDrop .26s cubic-bezier(.33,1,.68,1);
}
@keyframes softDrop { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
.btn-card-save, .btn-save-all, .card-tag, .student-recorder-name,
.admin-student-card { transition: all .3s cubic-bezier(.33,1,.68,1); }

/* ---- شاشة الجواد: العبارة أنزل وأقرب للمربعات ---- */
#studentCodeEntryBlock > p { margin: 34px 0 14px !important; }
#studentCodeEntryBlock .jyad-word {
    font-family: "Aref Ruqaa", "Tajawal", serif !important;
    font-size: 1.5em !important; color: #143a4d !important;
    font-weight: 700; vertical-align: -3px; padding-inline: 4px;
}

/* ---- كبسولة رُصد: مفرّغة · ملتحمة · أصغر ---- */
.admin-student-card.is-recorded .card-tag--done {
    background: transparent !important;
    border: 1px solid rgba(21,101,74,.5) !important;
    border-inline-start: none !important;
    color: #15654a !important;
    font-size: .6rem !important; padding: 2px 7px !important;
    border-radius: 0 99px 99px 0 !important;
    margin: 0 !important;
}
.card-head-main .student-recorder-name {
    background: transparent !important;
    border: 1px solid rgba(21,101,74,.5) !important;
    border-inline-end: none !important;
    color: #8a6a34 !important;
    font-size: .6rem !important; padding: 2px 7px !important;
    border-radius: 99px 0 0 99px !important;
    margin: 0 !important; max-width: 80px;
}
.admin-student-card.is-recorded .card-head-main .student-recorder-name { border-inline-end: none !important; }
.admin-student-card:not(.is-recorded) .card-head-main .student-recorder-name {
    border-radius: 99px !important; border-inline-end: 1px solid #e4dccb !important;
}

/* ---- فارس الأسبوع ---- */
/* شطف ناعم مثل البطاقة + نص متوسّط */
.admin-home-knight .knight-header-tag {
    clip-path: none !important;
    border-radius: 0 0 14px 14px !important;
    padding: 9px 26px 10px !important;
    line-height: 1.1;
}
/* لمعة واضحة تمرّ على الإطار */
.knight-showcase-box.admin-home-knight {
    background-image:
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%),
        linear-gradient(100deg, #a8813f 0%, #d4ac60 34%, #fff6dd 46%, #ffffff 50%, #fff6dd 54%, #d4ac60 66%, #a8813f 100%) !important;
    background-size: 100% 100%, 300% 100% !important;
    animation: borderShine 3.6s linear infinite !important;
}
@keyframes borderShine {
    0%   { background-position: 0 0, 100% 50%; }
    100% { background-position: 0 0, -200% 50%; }
}
/* لمعة الاسم أوضح */
.admin-home-knight .knight-name-display {
    background: linear-gradient(100deg, #d9b56d 0%, #e8cd93 30%, #fffaf0 46%, #ffffff 50%, #fffaf0 54%, #e8cd93 70%, #d9b56d 100%) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-size: 260% 100% !important;
    animation: nameShine 3.6s linear infinite !important;
}
@keyframes nameShine {
    0%   { background-position: 130% 50%; }
    100% { background-position: -130% 50%; }
}
/* التاج: توهّج أقل + لمعة خفيفة */
.admin-home-knight .knight-avatar-icon {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4) !important;
    background: linear-gradient(100deg, #c8a057 0%, #eccf8e 34%, #fff6dd 48%, #eccf8e 62%, #b5893f 100%) !important;
    background-size: 260% 100% !important;
    animation: nameShine 3.6s linear infinite !important;
}
@media (prefers-reduced-motion: reduce) {
    .knight-showcase-box.admin-home-knight,
    .admin-home-knight .knight-name-display,
    .admin-home-knight .knight-avatar-icon { animation: none !important; }
}

/* ══════════ دفعة 10 ══════════ */

/* overflow-x:hidden على html/body يُعطّل position:sticky.
   البديل clip يمنع التمرير الأفقي ويُبقي التثبيت يعمل. */
html, body { overflow-x: clip !important; }
.main-container, .admin-view, .student-view { overflow: visible !important; }

.admin-top-header {
    position: sticky !important;
    top: max(8px, env(safe-area-inset-top)) !important;
    z-index: 1000 !important;
}

/* شطف ناعم للزوايا الأربع */
.admin-top-header::before {
    clip-path: polygon(
        15px 0, calc(100% - 15px) 0, 100% 15px,
        100% calc(100% - 15px), calc(100% - 15px) 100%,
        15px 100%, 0 calc(100% - 15px), 0 15px) !important;
}
.admin-top-header::after {
    clip-path: polygon(
        14px 0, calc(100% - 14px) 0, 100% 14px,
        100% calc(100% - 14px), calc(100% - 14px) 100%,
        14px 100%, 0 calc(100% - 14px), 0 14px) !important;
}

/* --- إعادة اللمعان الذهبي: إطار حقيقي بطبقتين --- */
.knight-showcase-box.admin-home-knight {
    border: 2px solid transparent !important;
    background-image:
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%),
        linear-gradient(100deg,
            #a8813f 0%, #c99e52 22%, #f3dfae 40%,
            #ffffff 50%, #f3dfae 60%, #c99e52 78%, #a8813f 100%) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    background-repeat: no-repeat, no-repeat !important;
    background-size: 100% 100%, 300% 100% !important;
    animation: goldSweep 3.2s linear infinite !important;
}
@keyframes goldSweep {
    from { background-position: 0 0, 150% 50%; }
    to   { background-position: 0 0, -150% 50%; }
}

/* لمعة اسم الفارس */
.admin-home-knight .knight-name-display {
    background-image: linear-gradient(100deg,
        #c9a052 0%, #e3c68d 24%, #fff8e8 44%, #ffffff 50%,
        #fff8e8 56%, #e3c68d 76%, #c9a052 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-size: 280% 100% !important;
    animation: goldSweepText 3.2s linear infinite !important;
}
@keyframes goldSweepText {
    from { background-position: 140% 50%; }
    to   { background-position: -140% 50%; }
}

/* حركة الطيّ بالارتفاع الصريح بدل وحدة fr */
.card-body-wrap {
    display: block !important;
    grid-template-rows: none !important;
    transition: none !important;   /* الحركة تُدار برمجياً */
    overflow: hidden;
}
.admin-student-card.collapsed .card-body-wrap { opacity: 0; }
.admin-student-card:not(.collapsed) .card-body-wrap { opacity: 1; }

/* ══════════ دفعة 11 ══════════ */

/* كبسولة واحدة خضراء: رصد من فلان */
.admin-student-card .card-tag--done { display: none !important; }
.card-head-main .student-recorder-name {
    display: inline-flex !important; align-items: center;
    background: rgba(21,101,74,.12) !important;
    border: 1px solid rgba(21,101,74,.45) !important;
    color: #15654a !important;
    border-radius: 99px !important;
    font-size: .62rem !important; font-weight: 800 !important;
    padding: 3px 10px !important; margin: 0 !important;
    max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-head-main .student-recorder-name::before { content: none !important; }

/* العلامة المائية أنزل */
body::before { background-position: center 74% !important; }

/* قائمة الأيام بعرض الحقل فقط */
.jd-select__menu { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }

/* زر القائمة: ثلاثة خطوط عريضة بلا خلفية */
.admin-menu-btn {
    background: transparent !important; border: none !important;
    box-shadow: none !important; width: 34px !important; height: 34px !important;
    display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 6px !important;
}
.admin-menu-btn i { display: none !important; }
.admin-menu-btn::before, .admin-menu-btn::after,
.admin-menu-btn > span.bar {
    content: ""; display: block; height: 2.6px; width: 22px;
    background: #17506b; border-radius: 2px;
    transition: transform .3s ease, opacity .2s ease;
}

/* قائمة جانبية منزلقة */
.admin-menu-dropdown {
    position: fixed !important;
    top: 0 !important; bottom: 0 !important;
    inset-inline-start: 0 !important; inset-inline-end: auto !important;
    width: min(268px, 82vw) !important; max-width: none !important;
    border-radius: 0 18px 18px 0 !important;
    padding: 66px 12px 20px !important;
    background: linear-gradient(160deg, #ffffff, #f8f5ef) !important;
    box-shadow: 12px 0 40px rgba(12,38,52,.28) !important;
    animation: drawerIn .3s cubic-bezier(.33,1,.68,1) !important;
    overflow-y: auto;
}
@keyframes drawerIn { from { transform: translateX(-102%); } to { transform: none; } }
[dir="rtl"] .admin-menu-dropdown { animation-name: drawerInRtl !important; }
@keyframes drawerInRtl { from { transform: translateX(102%); } to { transform: none; } }
.admin-menu-item {
    display: flex !important; align-items: center; gap: 10px;
    padding: 13px 14px !important; border-radius: 12px !important;
    font-size: .92rem !important; font-weight: 800 !important;
    color: #17506b !important; margin-bottom: 4px;
}
.admin-menu-item:hover, .admin-menu-item:active { background: #eaf3f7 !important; }

/* ══════════ دفعة 12 ══════════ */

/* البطاقة المطوية تُطوى فعلاً (الحركة البرمجية تتجاوز هذا مؤقتاً) */
/* بلا !important حتى تتمكن الحركة البرمجية (تكتب style مباشرة) من تجاوزها */
.admin-student-card.collapsed .card-body-wrap {
    height: 0;
    opacity: 0;
    overflow: hidden;
}
.admin-student-card:not(.collapsed) .card-body-wrap {
    height: auto;
    opacity: 1;
}

/* كبسولة أصغر */
.card-head-main .student-recorder-name {
    font-size: .56rem !important;
    padding: 2px 8px !important;
    max-width: 108px;
}

/* --- اللمعة الذهبية: بلا أبيض صارخ --- */
.knight-showcase-box.admin-home-knight {
    background-image:
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%),
        linear-gradient(100deg,
            #9c7739 0%, #b8913f 26%, #dcb96f 44%,
            #f0dcae 50%, #dcb96f 56%, #b8913f 74%, #9c7739 100%) !important;
    background-size: 100% 100%, 300% 100% !important;
    animation: goldSweep 4s linear infinite !important;
}

/* لمعة الاسم — أعيدت */
.admin-home-knight .knight-name-display {
    background-image: linear-gradient(100deg,
        #c39c50 0%, #dcb96f 28%, #f4e3ba 46%,
        #ffeec4 50%, #f4e3ba 54%, #dcb96f 72%, #c39c50 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    background-size: 280% 100% !important;
    animation: goldSweepText 4s linear infinite !important;
}

/* لمعة التاج — أعيدت */
.admin-home-knight .knight-avatar-icon {
    background-image: linear-gradient(100deg,
        #b8913f 0%, #dcb96f 30%, #f4e3ba 48%,
        #dcb96f 66%, #a8813f 100%) !important;
    background-size: 280% 100% !important;
    animation: goldSweepText 4s linear infinite !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4) !important;
}

/* العلامة المائية: أنزل وأكثر لليمين */
body::before { background-position: 68% 88% !important; }

@media (prefers-reduced-motion: reduce) {
    .knight-showcase-box.admin-home-knight,
    .admin-home-knight .knight-name-display,
    .admin-home-knight .knight-avatar-icon { animation: none !important; }
}

/* ══════════ دفعة 13: ومضة ذهبية واضحة بلا أبيض صارخ ══════════ */
/* أساس أغمق + ذروة ذهبية ساطعة في شريط ضيق = بريق يُرى بوضوح */

.knight-showcase-box.admin-home-knight {
    background-image:
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%),
        linear-gradient(105deg,
            #7d5f2c 0%, #8a6a34 34%,
            #d9b76b 45%, #ffe9b0 50%, #d9b76b 55%,
            #8a6a34 66%, #7d5f2c 100%) !important;
    background-size: 100% 100%, 420% 100% !important;
    animation: goldGlint 2.8s linear infinite !important;
}
@keyframes goldGlint {
    from { background-position: 0 0, 210% 50%; }
    to   { background-position: 0 0, -210% 50%; }
}

.admin-home-knight .knight-name-display {
    background-image: linear-gradient(105deg,
        #a9822f 0%, #c69b45 32%,
        #f2dda4 45%, #fff3cf 50%, #f2dda4 55%,
        #c69b45 68%, #a9822f 100%) !important;
    background-size: 380% 100% !important;
    animation: goldGlintText 2.8s linear infinite !important;
}
.admin-home-knight .knight-avatar-icon {
    background-image: linear-gradient(105deg,
        #9d7830 0%, #c69b45 30%,
        #f2dda4 46%, #fff3cf 50%, #f2dda4 54%,
        #c69b45 70%, #9d7830 100%) !important;
    background-size: 380% 100% !important;
    animation: goldGlintText 2.8s linear infinite !important;
}
@keyframes goldGlintText {
    from { background-position: 190% 50%; }
    to   { background-position: -190% 50%; }
}

/* العلامة المائية: أنزل وأيمن أكثر */
body::before { background-position: 84% 97% !important; }

@media (prefers-reduced-motion: reduce) {
    .knight-showcase-box.admin-home-knight,
    .admin-home-knight .knight-name-display,
    .admin-home-knight .knight-avatar-icon { animation: none !important; }
}

/* ══════════ صفحة الجواد ══════════ */

/* --- الترويسة: على هوية الشريط الإداري --- */
#studentPortalContainer .page-header {
    position: sticky; top: max(8px, env(safe-area-inset-top));
    z-index: 900;
    margin: max(10px, env(safe-area-inset-top)) 10px 16px !important;
    padding: 10px 14px !important;
    background: transparent !important;
    border: none !important; box-shadow: none !important;
    overflow: visible !important; isolation: isolate;
}
#studentPortalContainer .page-header::before,
#studentPortalContainer .page-header::after {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
}
#studentPortalContainer .page-header::before {
    inset: 0;
    background: linear-gradient(135deg, #17506b, #2a7a9c 45%, #143a4d);
    clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 15px,
        100% calc(100% - 15px), calc(100% - 15px) 100%, 15px 100%, 0 calc(100% - 15px), 0 15px);
    filter: drop-shadow(0 4px 14px rgba(20,58,77,.16));
}
#studentPortalContainer .page-header::after {
    inset: 1.6px;
    background: linear-gradient(135deg, #ffffff, #f9f7f2);
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px,
        100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}
#studentPortalTitle {
    font-size: 1rem !important; font-weight: 800 !important;
    background: linear-gradient(100deg, #143a4d, #236b8c 55%, #17506b);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
#studentPortalContainer .brand-text-group span { display: none; }
#studentPortalContainer .btn-logout {
    background: transparent !important; border: none !important;
    box-shadow: none !important; padding: 4px !important;
    width: auto !important; height: auto !important; font-size: 0 !important;
}
#studentPortalContainer .btn-logout i { color: #7d1a1a !important; font-size: 18px !important; }

/* --- بطاقة الفارس المصغّرة: نفس فخامة الرئيسية --- */
#studentViewHome .knight-showcase-box {
    border: 2px solid transparent;
    background-image:
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%),
        linear-gradient(105deg, #7d5f2c 0%, #8a6a34 34%, #d9b76b 45%,
            #ffe9b0 50%, #d9b76b 55%, #8a6a34 66%, #7d5f2c 100%);
    background-origin: border-box; background-clip: padding-box, border-box;
    background-size: 100% 100%, 420% 100%;
    animation: goldGlint 2.8s linear infinite;
    border-radius: 18px;
}
#studentKnightName {
    background-image: linear-gradient(105deg, #a9822f, #c69b45 32%, #f2dda4 45%,
        #fff3cf 50%, #f2dda4 55%, #c69b45 68%, #a9822f);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 380% 100%;
    animation: goldGlintText 2.8s linear infinite;
    font-weight: 800;
}

/* --- بطاقة الرصد: أوضح وأهدأ --- */
#studentCardFormContainer .student-achievement-card,
#studentCardFormContainer > div {
    border-radius: 16px;
}
#studentCardLockNotice {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff8e6; border: 1px solid #f0dcae; color: #8a6a34;
    padding: 7px 12px; border-radius: 99px;
    font-size: .74rem; font-weight: 800;
}

/* الحقول التي يملكها الجواد تتميّز بصرياً */
#studentCardFormContainer .student-editable {
    border-color: #236b8c !important;
    background: #fbfdfe !important;
}
#studentCardFormContainer .student-skill-field.admin-owned .st-skill-input:disabled {
    background: #f4f2ed !important; color: #6b7c85 !important;
}

/* --- سجل الأيام: بطاقات بدل صفوف باهتة --- */
.day-history-item {
    background: #fffdfa; border: 1px solid #e8e3d9;
    border-inline-start: 3px solid #bd9450;
    border-radius: 0 12px 12px 0;
    padding: 11px 13px; margin-bottom: 8px;
    transition: transform .22s cubic-bezier(.33,1,.68,1), box-shadow .22s ease;
}
.day-history-item:hover { transform: translateX(-3px); box-shadow: 0 4px 14px rgba(12,38,52,.09); }
.day-score-badge {
    background: linear-gradient(135deg, #236b8c, #17506b); color: #fff;
    padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: .76rem;
}

/* --- الأخبار في لوحة الجواد --- */
.student-news-alert {
    border-radius: 14px; border: 1px solid #cfe0ea;
    background: linear-gradient(135deg, #eaf3f7, #f7fbfd);
    animation: newsPulse 2.4s ease-in-out infinite;
}
@keyframes newsPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(35,107,140,.22); }
    50%     { box-shadow: 0 0 0 7px rgba(35,107,140,0); }
}

/* --- الجوال --- */
@media (max-width: 640px) {
    #studentPortalContainer .page-header { padding: 8px 11px !important; }
    #studentPortalTitle { font-size: .92rem !important; }
    #studentViewHome .dashboard-grid-layout { gap: 10px; }
    .day-history-item { padding: 10px 11px; }
}
@media (prefers-reduced-motion: reduce) {
    #studentViewHome .knight-showcase-box, #studentKnightName,
    .student-news-alert, .day-history-item { animation: none !important; transition: none !important; }
}

/* ══════════ دفعة 14: إلغاء كل اللمعات · تدرّج ثابت ══════════ */

/* لا حركة على أي عنصر ذهبي */
.knight-showcase-box.admin-home-knight,
.admin-home-knight .knight-name-display,
.admin-home-knight .knight-avatar-icon,
#studentViewHome .knight-showcase-box,
#studentKnightName {
    animation: none !important;
}

/* إطار البطاقة: التدرّج الذهبي الثابت */
.knight-showcase-box.admin-home-knight,
#studentViewHome .knight-showcase-box {
    border: 2px solid transparent !important;
    background-image:
        linear-gradient(135deg, #143a4d 0%, #1b5068 55%, #123243 100%),
        linear-gradient(120deg, #f6e2b0 0%, #d4ac60 45%, #b5893f 70%, #f2dcaa 100%) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    background-size: 100% 100%, 100% 100% !important;
    background-position: 0 0, 0 0 !important;
}

/* اسم الفارس: نفس التدرّج الذهبي الثابت */
.admin-home-knight .knight-name-display,
#studentKnightName {
    background-image: linear-gradient(100deg,
        #f6e2b0 0%, #e3c179 30%, #fff3d4 50%, #d4ac60 72%, #f2dcaa 100%) !important;
    background-size: 100% 100% !important;
    background-position: 0 0 !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* التاج: تدرّج ثابت */
.admin-home-knight .knight-avatar-icon {
    background-image: linear-gradient(145deg, #f0d089, #c49a4e) !important;
    background-size: 100% 100% !important;
    background-position: 0 0 !important;
    color: #12303d !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45) !important;
}

/* العلامة المائية أعلى الصفحة */
body::before { background-position: 84% -25% !important; }


/* ══════════ دفعة 15: التاج + كبسولات نعم/لا ══════════ */

/* ── التاج ── */
/* التوهج الأصلي كان في .knight-avatar-icon أعلى الملف:
   drop-shadow(0 0 10px rgba(251,191,36,.9)) — هالة عنبرية واسعة.
   المطلوب: مدى 5 وشدة .35 من كل الجهات، بلون ذهبي الهوية. */
.knight-avatar-icon,
.admin-home-knight .knight-avatar-icon,
#studentViewHome .knight-avatar-icon {
    filter: drop-shadow(0 0 5px rgba(233,197,124,.35)) !important;
}

/* خلفية التاج = نفس تدرّج الأسماء بالضبط */
.admin-home-knight .knight-avatar-icon,
#studentViewHome .knight-avatar-icon {
    background-image: linear-gradient(100deg,
        #f6e2b0 0%, #e3c179 30%, #fff3d4 50%, #d4ac60 72%, #f2dcaa 100%) !important;
    background-size: 100% 100% !important;
    background-position: 0 0 !important;
    color: #12303d !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55) !important;
}

/* تاج صفحة الجواد كان <div> بعرض السطر — نجعله قرصاً مثل الشاشة الرئيسية */
#studentViewHome .knight-avatar-icon {
    width: 62px !important; height: 62px !important;
    margin: 0 auto 12px !important;
    display: flex !important; align-items: center; justify-content: center;
    border-radius: 50% !important;
    font-size: 1.7rem !important;
}

/* ── كبسولات نعم/لا ── */
.skill-toggles {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed rgba(35,107,140,.22);
}
.skill-toggle {
    flex: 1 1 calc(50% - 4px);
    display: flex; align-items: center; gap: 9px;
    min-height: 44px; padding: 8px 12px;
    font: inherit; font-size: .92rem; font-weight: 600;
    color: #3d4a56; text-align: right;
    background: #fbfaf7;
    border: 1.5px solid rgba(35,107,140,.20);
    border-radius: 12px;
    cursor: pointer; user-select: none;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.skill-toggle:disabled { opacity: .55; cursor: default; }
.skill-toggle-box {
    flex-shrink: 0;
    width: 21px; height: 21px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    border: 1.5px solid rgba(35,107,140,.32);
    color: transparent; font-size: .72rem;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.skill-toggle-text { flex: 1; display: flex; align-items: center; gap: 6px; }
.skill-toggle-text i { color: #7d8a95; font-size: .85rem; transition: color .16s ease; }
.skill-toggle-pts {
    flex-shrink: 0; font-size: .78rem; font-weight: 700;
    color: #9aa5af; font-variant-numeric: tabular-nums;
    transition: color .16s ease;
}

.skill-toggle.on {
    background: #eaf5ef;
    border-color: #2f9e6a;
    color: #17603f;
}
.skill-toggle.on .skill-toggle-box {
    background: #2f9e6a; border-color: #2f9e6a; color: #fff;
}
.skill-toggle.on .skill-toggle-text i { color: #2f9e6a; }
.skill-toggle.on .skill-toggle-pts { color: #2f9e6a; }

@media (hover: hover) {
    .skill-toggle:not(:disabled):hover { border-color: rgba(35,107,140,.42); }
    .skill-toggle.on:not(:disabled):hover { border-color: #26895c; }
}
.skill-toggle:not(:disabled):active { transform: scale(.985); }

/* كبسولة الجواد داخل بوابته: صف كامل بلا عنوان فوقها */
.student-skill-field.is-toggle { padding: 0; border: 0; background: none; }
.student-skill-field.is-toggle .skill-toggle { width: 100%; }

/* العلامة المائية أعلى الصفحة */
body::before { background-position: 84% -25% !important; }

/* حقل نصي بعرض الصف كاملاً (مقدار التسميع) */
.skills-grid .skill-field--wide { grid-column: 1 / -1; }
/* "+2" يجب أن تُقرأ هكذا داخل سياق عربي */
.skill-toggle-pts { direction: ltr; unicode-bidi: isolate; }

/* قاعدة قديمة ثبّتت حقل النص على خانة واحدة؛ بعد اختصار الحقول لثلاثة
   صار الأنسب أن يأخذ الصف كاملاً تحت المنسدلتين */
.skills-grid .skill-field:has(input[data-type="text"]),
.skills-grid .skill-field--wide { grid-column: 1 / -1 !important; }

/* ══════════ دفعة 16 ══════════ */

/* ── 1) النقاط الذهبية بنفس تدرّج الاسم والتاج ── */
.admin-home-knight .knight-score-badge,
#studentViewHome .knight-score-badge,
#studentKnightScore {
    background-image: linear-gradient(100deg,
        #f6e2b0 0%, #e3c179 30%, #fff3d4 50%, #d4ac60 72%, #f2dcaa 100%) !important;
    background-size: 100% 100% !important;
    background-position: 0 0 !important;
    color: #12303d !important;
    border: 0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.55) !important;
}

/* ── 2) شبكة الحقول: الحضور والحفظ عريضان، ثم المقدار ── */
.skills-grid { align-items: start; }
/* صندوق الخانة يبقى كما كان (خلفية وإطار) — أُلغي بالخطأ في دفعة 16 */
.skills-grid .skill-field > label {
    display: flex; align-items: center; gap: 6px;
    margin: 0; font-size: .8rem; font-weight: 700; color: #5a6873;
}
/* المقدار أقل أهمية: أهدأ وأغمق */
.skills-grid .skill-field--muted { background: #ecebe6 !important; border-color: #dedad1 !important; }
.skills-grid .skill-field--muted > label { color: #8b96a0; font-weight: 600; }
.skills-grid .skill-field--muted input[type="text"] {
    background: #eceae5 !important;
    border-color: rgba(35,107,140,.14) !important;
    color: #4a5560 !important;
}
.skills-grid .skill-field--muted input[type="text"]::placeholder { color: #9aa4ad; }

/* ── 3) زر الاختيار المدمج بدل قائمة النظام ── */
.skill-choice {
    width: 100%; min-height: 46px;
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    font: inherit; font-size: .95rem; font-weight: 700;
    text-align: right; cursor: pointer;
    border: 1.5px solid transparent; border-radius: 12px;
    background: #f0eeea; color: #55606b;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.skill-choice:disabled { cursor: default; opacity: .75; }
.skill-choice-label { flex: 1; }
.skill-choice-pts {
    font-size: .8rem; font-weight: 800; opacity: .85;
    direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums;
}
.skill-choice-caret { font-size: .7rem; opacity: .6; transition: transform .2s ease; }
.skill-choice.is-open .skill-choice-caret { transform: rotate(180deg); }

/* ألوان أهدأ: خلفية شفيفة وإطار مخفَّف بدل اللون المصمت */
.skill-choice.lvl-empty { background: #f4f2ee; color: #7d8892; }
.skill-choice.lvl-best  { background: rgba(47,158,106,.09);  color: #1a6b46; border-color: rgba(47,158,106,.34); }
.skill-choice.lvl-good  { background: rgba(63,136,173,.09);  color: #1d5f7f; border-color: rgba(63,136,173,.32); }
.skill-choice.lvl-mid   { background: rgba(215,154,43,.10);  color: #8a6018; border-color: rgba(215,154,43,.34); }
.skill-choice.lvl-worst { background: rgba(201,82,79,.09);   color: #93342f; border-color: rgba(201,82,79,.30); }

/* ── 4) لوحة الخيارات — fixed على body فلا يقصّها أي overflow ── */
.choice-pop {
    position: fixed; z-index: 4000;
    padding: 6px; border-radius: 14px;
    background: #fffdf9;
    border: 1px solid rgba(35,107,140,.16);
    box-shadow: 0 14px 34px rgba(16,44,60,.22);
    opacity: 0; transform: translateY(-6px) scale(.98);
    transform-origin: top center;
    transition: opacity .16s ease, transform .18s cubic-bezier(.33,1,.68,1);
}
.choice-pop.open { opacity: 1; transform: translateY(0) scale(1); }
.choice-pop-item {
    width: 100%; display: flex; align-items: center; gap: 9px;
    padding: 10px 11px; margin: 0;
    font: inherit; font-size: .92rem; font-weight: 700;
    text-align: right; cursor: pointer;
    background: none; border: 0; border-radius: 10px;
    color: #46525d;
    transition: background .14s ease;
}
.choice-pop-item + .choice-pop-item { margin-top: 2px; }
.choice-pop-label { flex: 1; }
.choice-pop-pts {
    font-size: .78rem; font-weight: 800; opacity: .7;
    direction: ltr; unicode-bidi: isolate;
}
.choice-pop-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #c3cbd2; }
.choice-pop-item.lvl-best  .choice-pop-dot { background: #2f9e6a; }
.choice-pop-item.lvl-good  .choice-pop-dot { background: #3f88ad; }
.choice-pop-item.lvl-mid   .choice-pop-dot { background: #d79a2b; }
.choice-pop-item.lvl-worst .choice-pop-dot { background: #c9524f; }
.choice-pop-item.selected { background: rgba(35,107,140,.055); }
@media (hover: hover) { .choice-pop-item:hover { background: rgba(35,107,140,.07); } }

/* ── 5) الكبسولات: ثلاث ثم اثنتان، بلا إطار، والنقاط تتبدّل بانسيابية ── */
.skill-toggles {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed rgba(35,107,140,.18);
}
.skill-toggles .skill-toggle:nth-child(-n+3) { grid-column: span 2; }
.skill-toggles .skill-toggle:nth-child(n+4)  { grid-column: span 3; }

.skill-toggle {
    border: 0 !important;
    background: #f0eeea;
    padding: 9px 11px;
    transition: background .2s ease, color .2s ease;
}
.skill-toggle-box { border-width: 1px !important; border-color: rgba(35,107,140,.22) !important; }
.skill-toggle.on { background: #e6f4ec; color: #16663f; }
.skill-toggle.on .skill-toggle-box { border-color: #2f9e6a !important; }
.skill-toggle-pts { transition: color .2s ease; }
.skill-toggle-pts.bump { animation: ptsBump .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes ptsBump {
    0%   { transform: translateY(3px) scale(.8); opacity: 0; }
    100% { transform: none; opacity: 1; }
}


/* أيقونة الشماغ المرسومة */
.skill-svg-icon {
    width: 1.02em; height: 1.02em;
    fill: currentColor; vertical-align: -.16em;
    flex-shrink: 0;
}

/* ── 6) الشعار في الشريط يعود للرئيسية ── */
.jyad-mark--home {
    border: 0; padding: 0; cursor: pointer;
    background-color: transparent;
    transition: transform .18s ease, filter .18s ease;
}
.jyad-mark--home { transition: transform .12s ease !important; }
.jyad-mark--home:active { transform: scale(.975); }
/* اسم الشاشة بجانب الشعار يعود للرئيسية أيضاً — هدف أوسع للإصبع */
.brand-text-group[data-admin-nav], .brand-text-group[data-student-nav] {
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: opacity .15s ease;
}
.brand-text-group[data-admin-nav]:active,
.brand-text-group[data-student-nav]:active { opacity: .65; }
/* بلا تأثير إضاءة عند المرور — كان يبدو باهتاً */

/* ── 7) الدرج الجانبي: انزلاق حقيقي والزر يبقى فوقه ── */
/* الدرج fixed داخل سياق تكديس الشريط العلوي (isolation: isolate)،
   فيكفي رفع الزر فوق 1400 ليبقى ظاهراً وقابلاً للطيّ. */
.admin-menu-wrap { position: relative; z-index: 60; }
.admin-menu-btn { position: relative; z-index: 1500; }
/* ثلاثة خطوط تتحوّل إلى ✕: الأعلى والأسفل يدوران، والأوسط يتلاشى */
.admin-menu-btn::before,
.admin-menu-btn > span.bar,
.admin-menu-btn::after {
    transition: transform .34s cubic-bezier(.68,-.4,.27,1.4),
                opacity .18s ease,
                background-color .28s ease,
                width .28s ease !important;
    transform-origin: center;
}
.admin-menu-btn.is-open::before { transform: translateY(6.6px) rotate(45deg); }
.admin-menu-btn.is-open > span.bar { opacity: 0; transform: scaleX(.2); }
.admin-menu-btn.is-open::after  { transform: translateY(-6.6px) rotate(-45deg); }
.admin-menu-btn.is-open::before,
.admin-menu-btn.is-open::after { background: #c9a24f; width: 24px; }

/* نبضة ذهبية خفيفة حول الزر لحظة الفتح */
.admin-menu-btn::marker { content: ""; }
.admin-menu-btn.is-open { animation: burgerPulse .5s ease-out; }
@keyframes burgerPulse {
    0%   { box-shadow: 0 0 0 0 rgba(201,162,79,.42) !important; }
    100% { box-shadow: 0 0 0 14px rgba(201,162,79,0) !important; }
}

/* عتمة خلف الدرج — الضغط عليها يطويه */
.admin-menu-wrap::after {
    content: ""; position: fixed; inset: 0;
    background: rgba(12,38,52,.34);
    opacity: 0; pointer-events: none;
    z-index: 1390;
    transition: opacity .28s ease;
}
.admin-menu-wrap.menu-open::after { opacity: 1; pointer-events: auto; }

/* الحركة كانت animation تُشغَّل عند الإدراج فقط، فلا تعمل عند إعادة الفتح */
.admin-menu-dropdown {
    display: block !important;
    animation: none !important;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .3s cubic-bezier(.33,1,.68,1), visibility 0s linear .3s;
}
.admin-menu-dropdown.open {
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: transform .3s cubic-bezier(.33,1,.68,1), visibility 0s;
}
.admin-menu-dropdown .admin-menu-item {
    opacity: 0; transform: translateX(10px);
    transition: opacity .22s ease, transform .26s cubic-bezier(.33,1,.68,1), background .15s ease;
}
.admin-menu-dropdown.open .admin-menu-item { opacity: 1; transform: none; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(1)  { transition-delay: .06s; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(2)  { transition-delay: .09s; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(3)  { transition-delay: .12s; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(4)  { transition-delay: .15s; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(5)  { transition-delay: .18s; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(6)  { transition-delay: .20s; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(7)  { transition-delay: .22s; }
.admin-menu-dropdown.open .admin-menu-item:nth-child(n+8) { transition-delay: .24s; }

/* التبويب المفتوح حالياً */
.admin-menu-dropdown .admin-menu-item.is-active {
    background: rgba(35,107,140,.10);
    color: #1c5b78;
    font-weight: 800;
}
.admin-menu-dropdown .admin-menu-item.is-active i { color: #c9a24f; }

@media (prefers-reduced-motion: reduce) {
    .admin-menu-dropdown, .admin-menu-dropdown .admin-menu-item,
    .choice-pop, .skill-toggle-pts { transition: none !important; animation: none !important; }
}

/* ══════════ دفعة 16ب: تصحيحات بعد المعاينة ══════════ */

/* الكبسولات: ثلاث ثم اثنتان حتى على الجوال — نضغط الحشو والخط بدل كسر الصف */
/* الكبسولة لا يجوز أن تفيض: النص يتقلّص والدرجة ثابتة العرض */
.skill-toggle { overflow: hidden; }
.skill-toggle-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-toggle-pts { flex-shrink: 0; }

/* عرض البطاقة هو ما يضغط الكبسولة، لا عرض الشاشة — فالبطاقات ضيقة
   حتى على سطح المكتب. لذلك القياس المضغوط ثابت وليس داخل media query. */
.skill-toggles { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.skill-toggles .skill-toggle:nth-child(-n+3) { grid-column: span 2; }
.skill-toggles .skill-toggle:nth-child(n+4)  { grid-column: span 3; }
.skill-toggles .skill-toggle:nth-child(-n+3) {
    padding: 8px 6px; gap: 4px; font-size: .76rem;
}
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
    width: 16px; height: 16px; border-radius: 5px; font-size: .58rem;
}
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts { font-size: .68rem; }
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text i,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text .skill-svg-icon { display: none; }
.skill-toggles .skill-toggle:nth-child(n+4) { padding: 9px 10px; font-size: .82rem; }

/* خلفية واضحة للكبسولة غير المحدّدة حتى تُقرأ كصندوق */
.skill-toggle {
    background: #f2f0ea !important;
    box-shadow: inset 0 0 0 1px rgba(35,107,140,.10);
}
.skill-toggle.on {
    background: rgba(47,158,106,.11) !important;
    box-shadow: inset 0 0 0 1px rgba(47,158,106,.30);
    color: #1a6b46;
}

/* رأس البطاقة: سطر واحد — الاسم يُقصّ والكبسولة تنكمش */
.admin-student-card .card-head { flex-wrap: nowrap !important; }
.admin-student-card .card-head-main {
    flex-wrap: nowrap !important;
    min-width: 0; overflow: hidden;
}
.admin-student-card .card-head-main .card-title { flex: 0 1 auto; min-width: 0; }
.admin-student-card .card-head-main .student-recorder-name {
    flex: 0 1 auto; min-width: 0;
    max-width: 42%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-student-card .card-head-side { flex-shrink: 0; }

/* قاعدة display:flex كانت تتغلّب على السمة hidden فيظهر تبويب لوجات
   رغم أنه مخفي في الشيفرة */
.admin-menu-dropdown .admin-menu-item[hidden] { display: none !important; }

/* الشعار كان زخرفة بـ pointer-events:none، فلا تصل إليه اللمسة رغم أنه زر الآن */
.jyad-mark--header.jyad-mark--home {
    pointer-events: auto !important;
    width: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
    /* لا نلمس position: الأصل absolute مع translateX للتوسيط */
}
/* هدف اللمس يتّسع بطبقة شفافة، فلا يكبر الشعار ولا يلامس حدّ الشريط */
.jyad-mark--home::before {
    content: ""; position: absolute; inset: -10px -14px;
}

/* الزر flex ذو gap:10px، فكل عقدة نصية تصير عنصراً وبينها فجوة كاملة
   إضافة إلى margin على الاسم — مجموعها ~16px. نصفها يكفي. */
#adminUseSavedNameBtn, #studentQuickLoginBtn { gap: 3px !important; }
#adminSavedNameLabel, #studentQuickLoginName { margin-inline-start: 0 !important; }

/* ══════════ دفعة 19 ══════════ */

/* ── الشعار: النقر كان يزيحه يميناً ── */
/* السبب: transform:scale في :active يستبدل translateX(-50%) الذي يوسّطه.
   الحل: لا نلمس transform إطلاقاً، والضغط يظهر بالعتامة فقط. */
/* transform يستبدل القيمة كلها، فلا بد من إبقاء translateX(-50%) داخل كل حالة
   وإلا فقد الشعار توسيطه وقفز يميناً لحظة الضغط. */
.jyad-mark--home,
.jyad-mark--home:hover,
.jyad-mark--home:focus {
    transform: translateX(-50%) scale(1) !important;
    filter: none !important;
    animation: none !important;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.jyad-mark--home {
    transition: transform .2s cubic-bezier(.34,1.5,.64,1) !important;
}
/* ينضغط قليلاً ثم يرجع بارتداد خفيف */
.jyad-mark--home:active {
    transform: translateX(-50%) scale(.92) !important;
    transition: transform .09s ease-out !important;
}

/* ── الشريط العلوي: اسم فارس الأسبوع يساراً قليلاً ── */
.admin-home-knight .knight-name-display { transform: translateX(-8px); }

/* ── الدرج: الـ ✕ كان يغطي أول تبويب على الكمبيوتر ── */
.admin-menu-btn.is-open::before,
.admin-menu-btn.is-open::after { background: #8a6420 !important; }
@media (min-width: 700px) {
    .admin-menu-dropdown { padding-top: 96px !important; }
}

/* ── خانات الحضور والحفظ: تملأ السطر وأقصر ── */
.skills-grid { gap: 8px; }
.skills-grid .skill-field { padding: 7px 8px !important; }
.skill-choice {
    min-height: 40px !important;
    padding: 6px 10px !important;
    font-size: .9rem;
}
.skills-grid .skill-field > label { font-size: .76rem; }

/* ── مقدار التسميع: العنوان والحقل في سطر واحد ── */
.skills-grid .skill-field--muted {
    flex-direction: row !important;
    align-items: center;
    gap: 9px;
    padding: 6px 8px !important;
}
.skills-grid .skill-field--muted > label {
    flex-shrink: 0;
    margin: 0;
    color: #4d5a65 !important;      /* أغمق كما طُلب */
    font-weight: 700 !important;
}
.skills-grid .skill-field--muted input[type="text"] {
    background: #fffdfa !important;  /* أفتح كما طُلب */
    border-color: #ded9d0 !important;
    color: #3d4954 !important;
    padding: 6px 9px !important;
    min-width: 0;
}

/* ── الكبسولات الخمس ── */
.skill-toggles {
    border-top: 0 !important;       /* الخط فوقها بلا داعٍ */
    padding-top: 0 !important;
    margin-top: 9px !important;
}
.skill-toggle.on {
    background: rgba(47,158,106,.075) !important;
    color: #14603c;
}
/* أخضر أغمق لعلامة الصح */
.skill-toggle.on .skill-toggle-box {
    background: #1d7a4b !important;
    border-color: #1d7a4b !important;
}
.skill-toggle.on .skill-toggle-text i,
.skill-toggle.on .skill-toggle-text .skill-svg-icon,
.skill-toggle.on .skill-toggle-pts { color: #1d7a4b; }

/* ── خلفيات الخيارات: 6% ── */
.skill-choice.lvl-best  { background: rgba(47,158,106,.06) !important; }
.skill-choice.lvl-good  { background: rgba(63,136,173,.06) !important; }
.skill-choice.lvl-mid   { background: rgba(215,154,43,.06) !important; }
.skill-choice.lvl-worst { background: rgba(201,82,79,.06) !important; }

/* ── الجوال ── */
@media (max-width: 640px) {
    /* قائمة الأسابيع نصّها أطول من قائمة الأيام، فتأخذ حصة أكبر */
    /* حشو أضيق للزر يمنح النص 8px إضافية فتظهر القائمتان كاملتين */
    .unified-selectors-group .jd-select__btn { padding-inline: 8px !important; gap: 5px !important; }
    .unified-selectors-group .control-item-wrap:first-child { flex: 1.22 1 0; min-width: 0; }
    .unified-selectors-group .control-item-wrap:last-child  { flex: 1 1 0; min-width: 0; }
    .unified-selectors-group .jd-select__value { font-size: .8rem; }

    .skill-toggles .skill-toggle { padding-block: 6px !important; min-height: 36px; }
    /* رقم الدرجة يبتعد عن الحافة اليسرى قليلاً */
    .skill-toggles .skill-toggle-pts { margin-inline-end: 4px; }
}

/* ══════════ دفعة 20 ══════════ */

/* ── 1) القائمة المنسدلة كانت مقيّدة بعرض الزر فيُقصّ نصّ الأسابيع ── */
.unified-selectors-group .jd-select__menu {
    width: max-content !important;
    min-width: 100% !important;
    max-width: calc(100vw - 30px) !important;
}
.unified-selectors-group .jd-select__opt {
    white-space: nowrap;
    overflow: visible !important;
    text-overflow: clip !important;
}
/* كل قائمة تتمدّد نحو داخل الشاشة لا خارجها */
.unified-selectors-group .control-item-wrap:first-child .jd-select__menu {
    inset-inline-start: 0 !important; inset-inline-end: auto !important;
}
.unified-selectors-group .control-item-wrap:last-child .jd-select__menu {
    inset-inline-start: auto !important; inset-inline-end: 0 !important;
}

/* ── 2) اسم فارس الأسبوع: 2px لليمين ── */
.admin-home-knight .knight-name-display { transform: translateX(-6px); }

/* ── 3) نصّ "المقدار" داخل الحقل ── */
.skills-grid .skill-field--muted input[type="text"]::placeholder {
    font-size: .76rem;
    color: #a9b2ba;
    opacity: 1;
}

/* ── 4) ترتيب خانات الرصد على الجوال ──
   كل سطر بنفس البنية: عنوان ثابت العرض يميناً، والحقل يملأ الباقي.
   فتتساوى الارتفاعات وتصطفّ الحقول على خط واحد. */
@media (max-width: 640px) {
    .skills-grid {
        grid-template-columns: 1fr !important;
        gap: 7px !important;
    }
    .skills-grid .skill-field,
    .skills-grid .skill-field--wide,
    .skills-grid .skill-field--muted {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 0 9px !important;
        min-height: 46px;
        grid-column: 1 / -1 !important;
    }
    .skills-grid .skill-field > label {
        flex: 0 0 100px !important;
        margin: 0 !important;
        font-size: .78rem !important;
        gap: 5px !important;
        white-space: nowrap;
    }
    .skills-grid .skill-field .skill-choice {
        flex: 1 1 auto;
        min-height: 34px !important;
        padding: 5px 10px !important;
    }
    .skills-grid .skill-field--muted input[type="text"] {
        flex: 1 1 auto;
        min-height: 34px;
        padding: 5px 10px !important;
    }

    /* الكبسولات: ارتفاع موحّد وأيقونة ظاهرة في الخمس */
    .skill-toggles { gap: 7px !important; margin-top: 7px !important; }
    .skill-toggles .skill-toggle {
        min-height: 42px !important;
        padding: 0 8px !important;
        font-size: .78rem !important;
        gap: 5px !important;
    }
    .skill-toggles .skill-toggle:nth-child(-n+3) {
        padding: 0 5px !important;
        font-size: .71rem !important;
        gap: 3px !important;
    }
    /* فسحة بين الاسم والدرجة في الكبسولات الضيقة */
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text { margin-inline-end: 3px; }
    /* الأيقونة تعود في الكبسولات الضيقة: ضغطنا الحشو والفراغات لتتّسع */
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text i,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text .skill-svg-icon {
        display: inline-block;
        font-size: .62rem;
    }
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text { gap: 3px; }
    .skill-toggles .skill-toggle-box { width: 17px; height: 17px; font-size: .6rem; }
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box { width: 15px; height: 15px; }
}

/* ══════════ دفعة 21 ══════════ */

/* كبسولة "رصده: فلان" كانت تفقد أحد أضلاع إطارها على البطاقات المرصودة.
   السبب قاعدة قديمة أعلى الملف:
     .admin-student-card.is-recorded .card-head-main .student-recorder-name
       { border-inline-end: none !important; }
   خصوصيتها (0,4,0) أعلى من قاعدة الإطار الكامل (0,2,0)، فتغلبها رغم
   أنّ الأخيرة تأتي بعدها. نعيد الإطار بخصوصية مساوية وموضع لاحق. */
.admin-student-card .card-head-main .student-recorder-name,
.admin-student-card.is-recorded .card-head-main .student-recorder-name,
.admin-student-card:not(.is-recorded) .card-head-main .student-recorder-name {
    border: 1px solid rgba(21,101,74,.45) !important;
    border-radius: 99px !important;
    border-inline-start: 1px solid rgba(21,101,74,.45) !important;
    border-inline-end: 1px solid rgba(21,101,74,.45) !important;
}

/* والكبسولة لا تنضغط: الاسم هو ما يتقلّص، فلا يُقصّ نصّها ولا حشوها */
.admin-student-card .card-head-main .card-title { flex: 0 1 auto; min-width: 0; }
.admin-student-card .card-head-main .student-recorder-name {
    flex: 0 0 auto;
    max-width: 118px !important;
}

/* ══════════ دفعة 22 ══════════ */

/* الأيقونات عادت في الكبسولات الضيقة على الجوال؛ وبطاقات سطح المكتب
   بعرض قريب منها، فنعيدها هناك أيضاً بنفس الضغط. */
.skill-toggles .skill-toggle:nth-child(-n+3) {
    padding: 8px 3px;
    font-size: .69rem;
    gap: 2px;
}
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts { font-size: .63rem; }
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
    gap: 3px;
    margin-inline-end: 3px;
}
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text i,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text .skill-svg-icon {
    display: inline-block;
    font-size: .62rem;
}
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
    width: 15px; height: 15px; border-radius: 5px; font-size: .55rem;
}

/* السماع أطول الثلاثة بمقدار بكسل واحد — تضييق التتبّع يكفي */
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text { letter-spacing: -.25px; }

/* ══════════ دفعة 23 ══════════ */

/* ── 1) توقيع التذييل: المخطوطة بدل الكلمة ── */
.site-footer-brand { padding-bottom: 16px; }
.site-footer-brand .jyad-mark--footer {
    width: 72px;
    margin: 14px auto 0;
    opacity: .5;
}

/* ── 2) حلقة التركيز كانت تلتصق بعد اللمس ──
   قاعدة :focus تبقى فاعلة حتى ينتقل التركيز، ولا شيء ينقله على الجوال.
   :focus-visible يقتصر على تنقّل لوحة المفاتيح، ويبقى ارتداد اللمس لحظياً. */
.admin-student-card .skill-input:focus:not(:focus-visible),
.skill-field input:focus:not(:focus-visible),
.skill-field select:focus:not(:focus-visible) {
    box-shadow: none;
    border-color: transparent;
}
.skill-toggle:focus:not(:focus-visible) { box-shadow: inset 0 0 0 1px rgba(35,107,140,.10) !important; }
.skill-toggle.on:focus:not(:focus-visible) { box-shadow: inset 0 0 0 1px rgba(47,158,106,.30) !important; }
.skill-choice:focus:not(:focus-visible) { border-color: inherit; }

/* ارتداد لحظي عند الضغط يعوّض اختفاء الحلقة */
.skill-toggle, .skill-choice {
    transition: background .2s ease, color .2s ease, border-color .18s ease,
                box-shadow .18s ease, transform .11s ease;
}
.skill-toggle:active, .skill-choice:active { transform: scale(.98); }

/* ── 3) ارتفاعات أقصر لكل خانات الرصد ── */
.skill-choice { min-height: 38px; padding: 6px 11px; }
.skill-toggle { min-height: 38px; }
.skills-grid .skill-field--muted input[type="text"] { min-height: 34px; }

/* ── 4) الجوال: الحضور والحفظ جنب بعض في سطر واحد ── */
@media (max-width: 640px) {
    .skills-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 7px !important;
    }

    /* المنسدلتان: العنوان فوق الحقل داخل عمودين */
    .skills-grid .skill-field:not(.skill-field--wide) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 3px !important;
        padding: 4px 7px !important;
        min-height: 0 !important;
        grid-column: auto !important;
    }
    .skills-grid .skill-field:not(.skill-field--wide) > label {
        flex: 0 0 auto !important;
        font-size: .69rem !important;
        line-height: 1.15 !important;
        margin: 0 !important;
        gap: 4px !important;
        white-space: nowrap;
    }

    /* المقدار بعرض الصف كاملاً وعنوانه بجانبه */
    .skills-grid .skill-field--wide {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 9px !important;
        padding: 0 8px !important;
        min-height: 40px !important;
        grid-column: 1 / -1 !important;
    }
    .skills-grid .skill-field--wide > label {
        flex: 0 0 auto !important;
        font-size: .73rem !important;
        margin: 0 !important;
        white-space: nowrap;
    }
    .skills-grid .skill-field--wide input[type="text"] {
        flex: 1 1 auto;
        min-height: 30px !important;
        padding: 4px 9px !important;
    }

    .skills-grid .skill-choice {
        min-height: 31px !important;
        padding: 3px 8px !important;
        font-size: .82rem !important;
        gap: 5px !important;
    }
    .skills-grid .skill-choice-pts { font-size: .72rem; }

    .skill-toggles { margin-top: 7px !important; padding-top: 8px !important; }
    .skill-toggles .skill-toggle { min-height: 37px !important; }
}

/* ══════════ دفعة 24 ══════════ */

/* ── 1) توقيع التذييل: أصغر · أعلى · أوضح ── */
.site-footer-brand .jyad-mark--footer {
    width: 58px;
    margin: 6px auto 0;
    opacity: .8;
}
.site-footer-brand { padding-bottom: 10px; }
@media (min-width: 641px) {
    .site-footer-brand { padding-bottom: 5px; margin-top: 20px; }
}

/* ── 2) شعار الشريط: تكّة للأعلى ── */
.jyad-mark--header.jyad-mark--home { margin-top: -4px !important; }

/* ── 3) خانة المقدار: ألوان معكوسة لتتميّز عن بقية الخانات ── */
.skills-grid .skill-field--muted {
    background: linear-gradient(135deg, #1d5972, #17506b) !important;
    border-color: #17506b !important;
}
.skills-grid .skill-field--muted > label {
    color: #cfe3ee !important;
    font-weight: 700 !important;
}
.skills-grid .skill-field--muted > label i,
.skills-grid .skill-field--muted > label .skill-svg-icon {
    color: #d6b26e !important;
    fill: #d6b26e !important;
}
.skills-grid .skill-field--muted input[type="text"] {
    background: rgba(255,255,255,.12) !important;
    border-color: rgba(255,255,255,.20) !important;
    color: #f4f8fa !important;
    /* نصّ العنصر النائب أصغر وأنزل تكّة */
    padding-top: 4px !important;
    padding-bottom: 2px !important;
}
.skills-grid .skill-field--muted input[type="text"]::placeholder {
    color: rgba(255,255,255,.42) !important;
    font-size: .68rem !important;
    opacity: 1;
}
.skills-grid .skill-field--muted input[type="text"]:focus {
    background: rgba(255,255,255,.18) !important;
    border-color: rgba(214,178,110,.55) !important;
}

/* ── 4) الكبسولات الخمس بقياس واحد ──
   الثلاث العلوية أضيق خانةً، فالقياس الموحّد هو ما تتّسع له هي،
   وتكبر الخمس معاً حين يتّسع العرض. */
.skill-toggles .skill-toggle,
.skill-toggles .skill-toggle:nth-child(-n+3),
.skill-toggles .skill-toggle:nth-child(n+4) {
    padding: 8px 6px;
    font-size: .74rem;
    gap: 4px;
}
.skill-toggles .skill-toggle .skill-toggle-text,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
    gap: 4px;
    margin-inline-end: 4px;
    letter-spacing: -.2px;
}
.skill-toggles .skill-toggle .skill-toggle-text i,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text i {
    display: inline-block;
    font-size: .74rem;
}
.skill-toggles .skill-toggle .skill-toggle-box,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
    width: 16px; height: 16px; border-radius: 5px; font-size: .58rem;
}
/* رقم الدرجة: تكّة نحو الداخل بدل التصاقه بالحافة */
.skill-toggles .skill-toggle .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts {
    font-size: .7rem;
    margin-inline-end: 3px;
}

/* متّسع أكبر: الخمس تكبر معاً */
@media (min-width: 430px) {
    .skill-toggles .skill-toggle,
    .skill-toggles .skill-toggle:nth-child(-n+3),
    .skill-toggles .skill-toggle:nth-child(n+4) {
        padding: 8px 9px;
        font-size: .8rem;
        gap: 6px;
    }
    .skill-toggles .skill-toggle .skill-toggle-text,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text { letter-spacing: normal; }
    .skill-toggles .skill-toggle .skill-toggle-text i,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text i { font-size: .82rem; }
    .skill-toggles .skill-toggle .skill-toggle-box,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box { width: 18px; height: 18px; font-size: .64rem; }
}

/* ══════════ دفعة 25: قياس الكبسولات بعرض البطاقة لا بعرض الشاشة ══════════ */

/* عرض الشاشة إشارة خاطئة هنا: البطاقة تبقى ~۳۵۰px حتى على شاشة ۱۶۰۰px،
   لأن الشبكة تصفّ عدّة بطاقات جنب بعض. استعلام الحاوية يقيس البطاقة نفسها. */
.admin-student-card .card-body {
    container-type: inline-size;
    container-name: jcard;
}

/* الأساس: أصغر قياس تتّسع له أضيق كبسولة — والخمس متساوية فيه */
.skill-toggles .skill-toggle,
.skill-toggles .skill-toggle:nth-child(-n+3),
.skill-toggles .skill-toggle:nth-child(n+4) {
    padding: 8px 5px !important;
    font-size: .7rem !important;
    gap: 3px !important;
}
.skill-toggles .skill-toggle .skill-toggle-text,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
    gap: 3px !important;
    margin-inline-end: 3px !important;
    letter-spacing: -.2px !important;
}
.skill-toggles .skill-toggle .skill-toggle-text i,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text i {
    display: inline-block !important;
    font-size: .7rem !important;
}
.skill-toggles .skill-toggle .skill-toggle-box,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
    width: 15px !important; height: 15px !important;
    border-radius: 5px !important; font-size: .55rem !important;
}
.skill-toggles .skill-toggle .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts {
    font-size: .66rem !important;
    margin-inline-end: 3px !important;
}

/* بطاقة أوسع: الخمس تكبر معاً */
@container jcard (min-width: 380px) {
    .skill-toggles .skill-toggle,
    .skill-toggles .skill-toggle:nth-child(-n+3),
    .skill-toggles .skill-toggle:nth-child(n+4) {
        padding: 9px 9px !important;
        font-size: .8rem !important;
        gap: 6px !important;
    }
    .skill-toggles .skill-toggle .skill-toggle-text,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
        gap: 5px !important;
        letter-spacing: normal !important;
    }
    .skill-toggles .skill-toggle .skill-toggle-text i,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text i { font-size: .82rem !important; }
    .skill-toggles .skill-toggle .skill-toggle-box,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
        width: 18px !important; height: 18px !important; font-size: .64rem !important;
    }
    .skill-toggles .skill-toggle .skill-toggle-pts,
    .skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts { font-size: .74rem !important; }
}

/* ══════════ دفعة 26: صفحة الجواد ══════════ */

/* ── 1) الشريط العلوي: توازن على الجوال ──
   كان يحمل عنوانين وزرّين وشعاراً مركزياً في ٣٧٥px، فتزاحم كلّه. */
.student-brand-group { min-width: 0; }
#studentPortalTitle {
    margin: 0;
    font-size: .95rem;
    font-weight: 800;
    color: #17506b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
#studentPortalTitle .jyad-word {
    font-family: "Aref Ruqaa", "Tajawal", serif;
    font-size: 1.32em;
    color: #143a4d;
    font-weight: 700;
    line-height: 1;
    padding-inline-end: 2px;
    vertical-align: -2px;
}
#studentPortalContainer .page-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
#studentPortalContainer .header-actions { flex-shrink: 0; gap: 6px; }

@media (max-width: 480px) {
    #studentPortalTitle { font-size: .84rem; max-width: 40vw; }
    #studentPortalContainer .btn-student-news-mini span:not(.student-news-badge) { display: none; }
    #studentPortalContainer .btn-student-news-mini { padding: 7px 9px; }
    #studentPortalContainer .btn-logout span,
    #studentPortalContainer .btn-logout { font-size: .74rem; }
}

/* ── 2) بطاقة الفارس صارت بنفس صنف بطاقة المشرف ──
   نلغي التخصيصات القديمة التي كانت تعالجها كبطاقة مختلفة. */
#studentViewHome .knight-avatar-icon {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 50% !important;
}
#studentViewHome .knight-showcase-box.admin-home-knight .knight-avatar-icon {
    width: 54px !important;
    height: 54px !important;
}
@media (max-width: 640px) {
    #studentViewHome .knight-showcase-box.admin-home-knight .knight-avatar-icon {
        width: 46px !important; height: 46px !important;
    }
}
/* الشبكة أُلغيت: البطاقة تأخذ الصف كاملاً كما في صفحة المشرف */
#studentViewHome .dashboard-grid-layout {
    display: block;
}
#studentViewHome .dashboard-grid-layout > .chart-panel-box { margin-top: 12px; }

/* ── 3) شريط الإشعارات: شريط أنيق بألوان الهوية بدل الصندوق الأزرق ── */
.student-push-banner { margin: 12px 0 0; }
.student-push-banner-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font: inherit;
    text-align: right;
    cursor: pointer;
    border: 1px solid rgba(189,148,80,.38);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(214,178,110,.13), rgba(214,178,110,.06));
    transition: background .18s ease, border-color .18s ease, transform .11s ease;
}
.student-push-banner-inner:active { transform: scale(.99); }
.student-push-ico {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0d089, #c49a4e);
    color: #12303d;
    font-size: .78rem;
}
.student-push-text {
    flex: 1; min-width: 0;
    font-size: .76rem; font-weight: 700; color: #6b5a35;
    line-height: 1.4;
}
.student-push-cta {
    flex-shrink: 0;
    padding: 5px 13px;
    border-radius: 99px;
    background: #17506b;
    color: #fff;
    font-size: .74rem; font-weight: 800;
}
@media (hover: hover) {
    .student-push-banner-inner:hover { border-color: rgba(189,148,80,.6); }
}

/* ── 4) أوائل اليوم: مختصرة، والرصد يليها مباشرة ── */
#studentViewHome .chart-panel-box.compact { margin-bottom: 12px; }
#studentViewHome .excellence-list-container.compact { padding-bottom: 4px; }
#studentViewHome .himmah-student-home:empty { display: none; }

/* ══════════ دفعة 27: تصحيحات صفحة الجواد ══════════ */

/* قاعدة قديمة تخفي كل span في مجموعة العنوان — كانت تخفي السطر الفرعي
   القديم، وصارت تخفي كلمة "الجواد" بخط الرقعة. */
#studentPortalContainer .brand-text-group #studentPortalTitle .jyad-word {
    display: inline !important;
}

/* والقاعدة القديمة .student-push-banner-inner span { flex: 1 } كانت تمطّط
   الأيقونة وزرّ التفعيل على عرض الشريط. */
.student-push-banner .student-push-banner-inner .student-push-ico,
.student-push-banner .student-push-banner-inner .student-push-cta {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}
.student-push-banner .student-push-banner-inner .student-push-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
.student-push-banner .student-push-banner-inner {
    flex-wrap: nowrap !important;
    background: linear-gradient(135deg, rgba(214,178,110,.13), rgba(214,178,110,.06)) !important;
    padding: 9px 12px !important;
    margin: 0 !important;
}
.student-push-banner {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 12px 0 0 !important;
}
.student-push-banner .student-push-ico i { color: #12303d !important; font-size: .78rem !important; }

/* ══════════ دفعة 28 ══════════ */

/* ارتفاع الكبسولات الخمس ٣٣px، ورقم الدرجة أبعد عن الحافة */
.skill-toggles .skill-toggle,
.skill-toggles .skill-toggle:nth-child(-n+3),
.skill-toggles .skill-toggle:nth-child(n+4) {
    min-height: 33px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}
.skill-toggles .skill-toggle .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts {
    margin-inline-end: 6px !important;
}

/* الفسحة الجديدة حول الرقم أخذت من عرض النص، فنعوّضها من الحشو الجانبي */
.skill-toggles .skill-toggle,
.skill-toggles .skill-toggle:nth-child(-n+3),
.skill-toggles .skill-toggle:nth-child(n+4) {
    padding-inline: 3px !important;
}
.skill-toggles .skill-toggle .skill-toggle-text,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
    margin-inline-end: 1px !important;
}

/* ══════════ دفعة 29 ══════════ */

/* الرقم عليه direction: ltr، فـ margin-inline-end عنده = الجهة اليمنى،
   ولذلك دفعته يساراً بدل يمين. نستعمل خصائص فيزيائية بلا لبس:
   الرقم ملتصق بالحافة اليسرى، فهامش يساري يزيحه يميناً. */
.skill-toggles .skill-toggle .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(n+4) .skill-toggle-pts {
    margin-inline-end: 0 !important;
    margin-inline-start: 0 !important;
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* ارتفاع ٣٣ ثابت مهما كان عرض الشاشة */
.skill-toggles .skill-toggle,
.skill-toggles .skill-toggle:nth-child(-n+3),
.skill-toggles .skill-toggle:nth-child(n+4) {
    min-height: 33px !important;
    height: 33px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* تقليص الفراغ بين حقل المقدار وصفّ الكبسولات */
.skill-toggles { margin-top: 4px !important; }
@media (max-width: 640px) {
    .skill-toggles { margin-top: 4px !important; padding-top: 0 !important; }
}

/* ══════════ دفعة 30 ══════════ */

/* خانتا الحضور والحفظ: الحقل بلا إطار، والعنوان أنزل، والخانة كلها قابلة للضغط */
.skills-grid .skill-choice {
    border-color: transparent !important;
    box-shadow: none !important;
}
.skills-grid .skill-field:not(.skill-field--wide) > label {
    margin-top: 3px !important;
}
.skill-field--clickable { cursor: pointer; }

/* مسافة أوسع قليلاً بين المقدار وصفّ الكبسولات */
.skill-toggles { margin-top: 7px !important; }
@media (max-width: 640px) { .skill-toggles { margin-top: 7px !important; } }

/* ضبط دقيق داخل الكبسولات الخمس — خصائص فيزيائية لا منطقية:
   المربّع على اليمين، والنص وسطاً، والرقم على اليسار. */
.skill-toggles .skill-toggle .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(n+4) .skill-toggle-pts {
    margin-left: 5px !important;
}
.skill-toggles .skill-toggle .skill-toggle-box,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
    margin-right: 2px !important;
    margin-left: 0 !important;
}
.skill-toggles .skill-toggle .skill-toggle-text,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
    margin-right: 4px !important;
}

/* الإزاحات الجديدة أخذت 6px من عرض النص، نعوّضها من الحشو الجانبي */
.skill-toggles .skill-toggle,
.skill-toggles .skill-toggle:nth-child(-n+3),
.skill-toggles .skill-toggle:nth-child(n+4) { padding-inline: 0 !important; }

/* ══════════ دفعة 32 ══════════ */

/* خط Tajawal يرفع النص داخل الصناديق قليلاً عن مركزها البصري */
.skill-choice-label,
.skill-choice-pts,
.skill-toggle-text,
.skill-toggle-pts,
.skills-grid .skill-field > label,
.jd-select__value {
    position: relative;
    top: 1px;
}
.skills-grid .skill-field--muted input[type="text"],
.skills-grid .skill-field input[type="text"] {
    padding-top: 5px !important;
    padding-bottom: 1px !important;
}

/* إزاحات دقيقة داخل الكبسولات */
.skill-toggles .skill-toggle .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-pts,
.skill-toggles .skill-toggle:nth-child(n+4) .skill-toggle-pts {
    margin-left: 6px !important;
}
.skill-toggles .skill-toggle .skill-toggle-box,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
    margin-right: 4px !important;
}
.skill-toggles .skill-toggle .skill-toggle-text,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
    margin-right: 5px !important;
    letter-spacing: -.32px !important;
}

/* حقل المقدار: المسافة اليسرى مثل العلوية والسفلية */
.skills-grid .skill-field--wide {
    padding-left: 5px !important;
}

/* ══════════ دفعة 33: تبويب الجياد ══════════ */

/* قائمة عمودية بسيطة → شبكة بطاقات بطابع الشاشة الرئيسية */
.manage-students-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 10px !important;
    align-items: start;
}

.manage-students-list .manage-row {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "num  name name"
        "code code del";
    align-items: center;
    gap: 8px 7px;
    padding: 10px 11px 11px !important;
    background: #fff !important;
    border: 1px solid rgba(35,107,140,.13) !important;
    border-top: 2px solid rgba(189,148,80,.55) !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 10px rgba(20,58,77,.06) !important;
    transition: box-shadow .2s ease, border-color .2s ease, transform .12s ease;
}
@media (hover: hover) {
    .manage-students-list .manage-row:hover {
        box-shadow: 0 6px 18px rgba(20,58,77,.12) !important;
        border-color: rgba(35,107,140,.24) !important;
    }
}

.manage-students-list .manage-num {
    grid-area: num;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0d089, #c49a4e);
    color: #12303d;
    font-size: .68rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
    flex: none;
}

.manage-students-list .manage-name {
    grid-area: name;
    min-width: 0;
    font-size: .86rem; font-weight: 800; color: #16303d;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-align: right;
}

.manage-students-list .manage-code-wrap {
    grid-area: code;
    display: flex; align-items: center; gap: 5px;
    min-width: 0;
}
.manage-students-list .code-input {
    flex: 1 1 auto; min-width: 0; width: auto !important;
    height: 30px;
    padding: 0 8px !important;
    border: 1px solid rgba(35,107,140,.18) !important;
    border-radius: 9px !important;
    background: #f6f4ef !important;
    color: #17506b !important;
    font-size: .82rem !important; font-weight: 800 !important;
    letter-spacing: 1px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.manage-students-list .code-input:disabled { opacity: 1; cursor: default; }
.manage-students-list .code-input:not(:disabled) {
    background: #fff !important;
    border-color: rgba(189,148,80,.65) !important;
}

.manage-students-list .lock-btn,
.manage-students-list .btn-delete {
    flex: none;
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: .76rem;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.manage-students-list .lock-btn {
    background: rgba(35,107,140,.08) !important;
    color: #17506b !important;
}
.manage-students-list .lock-btn.unlocked {
    background: rgba(189,148,80,.18) !important;
    color: #8a6a34 !important;
    border-color: rgba(189,148,80,.45);
}
.manage-students-list .btn-delete {
    grid-area: del;
    background: rgba(201,82,79,.08) !important;
    color: #a8413d !important;
}
@media (hover: hover) {
    .manage-students-list .btn-delete:hover { background: rgba(201,82,79,.16) !important; }
    .manage-students-list .lock-btn:hover { background: rgba(35,107,140,.15) !important; }
}
.manage-students-list .lock-btn:active,
.manage-students-list .btn-delete:active { transform: scale(.94); }

/* رأس الصفحة على طابع الرئيسية */
#adminViewJiyad .admin-subpage-head {
    align-items: center;
    gap: 11px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px dashed rgba(35,107,140,.18);
}
#adminViewJiyad .admin-subpage-icon {
    background: linear-gradient(145deg, #f0d089, #c49a4e) !important;
    color: #12303d !important;
}
#adminViewJiyad .admin-subpage-title { font-weight: 800; color: #16303d; }

.manage-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 16px;
    color: #8a949c;
    font-weight: 700;
}

/* ══════════ دفعة 34: صفحة الجواد ══════════ */

/* الشريط العلوي: الشعار في مكانه ضمن الصف لا مركزاً بموضع مطلق يتراكب مع العنوان */
#studentPortalContainer .jyad-mark--header.jyad-mark--home {
    position: static !important;
    transform: none !important;
    inset: auto !important;
    width: 40px !important;
    margin: 0 !important;
    flex: none;
}
#studentPortalContainer .jyad-mark--home:active { transform: scale(.94) !important; }
#studentPortalContainer .page-header {
    display: flex !important;
    align-items: center;
    gap: 9px;
    flex-wrap: nowrap;
}
#studentPortalContainer .student-brand-group { flex: 1 1 auto; min-width: 0; }
#studentPortalContainer .header-actions { flex: none; }

/* أوائل اليوم أصغر من بطاقة الفارس: هي معلومة ثانوية */
#studentViewHome .chart-panel-box.compact { padding: 10px 12px 8px !important; }
#studentViewHome .chart-header-row.compact { margin-bottom: 6px !important; }
#studentViewHome .chart-title-main.small { font-size: .82rem !important; }
#studentViewHome .panel-section-icon { width: 28px !important; height: 28px !important; font-size: .75rem !important; }
#studentViewHome .excellence-list-container.compact { gap: 5px !important; }
#studentViewHome .excellence-list-container.compact > * { padding-top: 6px !important; padding-bottom: 6px !important; }

/* نافذة الخبر المنبثقة */
.news-pop-overlay {
    position: fixed; inset: 0; z-index: 5000;
    display: flex; align-items: center; justify-content: center;
    padding: 22px;
    background: rgba(12,38,52,.5);
    animation: newsPopFade .2s ease;
}
@keyframes newsPopFade { from { opacity: 0 } to { opacity: 1 } }
.news-pop {
    width: min(360px, 100%);
    padding: 22px 20px 18px;
    border-radius: 20px;
    background: linear-gradient(160deg, #ffffff, #f8f5ef);
    border: 1px solid rgba(189,148,80,.4);
    box-shadow: 0 22px 50px rgba(12,38,52,.34);
    text-align: center;
    animation: newsPopIn .28s cubic-bezier(.34,1.4,.64,1);
}
@keyframes newsPopIn { from { opacity: 0; transform: translateY(14px) scale(.96) } to { opacity: 1; transform: none } }
.news-pop-ico {
    width: 50px; height: 50px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0d089, #c49a4e);
    color: #12303d; font-size: 1.15rem;
}
.news-pop-label { font-size: .72rem; font-weight: 800; color: #a08343; letter-spacing: .3px; }
.news-pop-title { margin: 6px 0 8px; font-size: 1.05rem; font-weight: 800; color: #16303d; line-height: 1.5; }
.news-pop-body { margin: 0 0 16px; font-size: .84rem; color: #5c6871; line-height: 1.75; }
.news-pop-actions { display: flex; gap: 9px; }
.news-pop-read, .news-pop-close {
    flex: 1; padding: 11px 10px; border: 0; border-radius: 12px;
    font: inherit; font-size: .86rem; font-weight: 800; cursor: pointer;
    transition: transform .11s ease, background .16s ease;
}
.news-pop-read { background: linear-gradient(135deg, #236b8c, #17506b); color: #fff; }
.news-pop-close { background: rgba(35,107,140,.09); color: #4a5560; }
.news-pop-read:active, .news-pop-close:active { transform: scale(.97); }

/* ══════════ دفعة 35 ══════════ */

/* ── 1) خط Tajawal يرفع النص داخل الصناديق ──
   الحشو متساوٍ في كل هذه العناصر، فننقل بكسلين من الأسفل إلى الأعلى:
   يهبط النص بصرياً والارتفاع الكلّي لا يتغيّر. */
.student-recorder-name   { padding-top: 4px !important;  padding-bottom: 0 !important; }
.card-tag                { padding-top: 5px !important;  padding-bottom: 1px !important; }
.btn-card-save           { padding-top: 10px !important; padding-bottom: 6px !important; }
.btn-save-all            { padding-top: 11px !important; padding-bottom: 7px !important; }
.live-card-total-badge   { padding-top: 6px !important;  padding-bottom: 2px !important; }
.knight-score-badge      { padding-top: 6px !important;  padding-bottom: 2px !important; }
#studentSearchInput      { padding-top: 11px !important; padding-bottom: 7px !important; }
.manage-students-list .code-input { padding-top: 2px !important; padding-bottom: 0 !important; }

/* عناصر نصّها مباشر بلا إطار: إزاحة بصرية لا تمسّ التخطيط */
.card-title,
.manage-name,
.chart-title-main,
.knight-name-display,
.admin-subpage-title,
.record-progress-label,
.choice-pop-label,
.jd-select__opt,
.admin-menu-item,
.news-pop-title,
.excellence-name,
.excellence-score {
    position: relative;
    top: 1px;
}

/* ── 2) مربّع الاختيار: بكسل آخر لليسار ── */
.skill-toggles .skill-toggle .skill-toggle-box,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-box {
    margin-right: 5px !important;
}
.skill-toggles .skill-toggle .skill-toggle-text,
.skill-toggles .skill-toggle:nth-child(-n+3) .skill-toggle-text {
    letter-spacing: -.36px !important;
}

/* ── 3) تبويب الجياد: بلا قفل، والحذف أيقونة حمراء بلا خلفية ── */
.manage-students-list .manage-row {
    grid-template-areas:
        "num  name name"
        "code code del";
}
.manage-students-list .code-input {
    cursor: text;
    transition: border-color .16s ease, background .16s ease;
}
.manage-students-list .code-input:focus {
    background: #fff !important;
    border-color: rgba(189,148,80,.7) !important;
    outline: none;
}
.manage-students-list .manage-row.is-saving .code-input { opacity: .6; }

.manage-students-list .btn-delete {
    grid-area: del;
    width: 26px !important; height: 26px !important;
    background: none !important;
    border: 0 !important;
    color: #8e2420 !important;
    font-size: .82rem !important;
    justify-self: end;
    transition: color .16s ease, transform .11s ease;
}
@media (hover: hover) {
    .manage-students-list .btn-delete:hover { background: none !important; color: #b3302b !important; }
}
.manage-students-list .btn-delete:active { transform: scale(.9); }

/* قواعد أعلى خصوصية سبقتها فلم تنطبق الإزاحة — نطابق خصوصيتها */
.admin-student-card .card-head-main .student-recorder-name {
    padding-top: 4px !important; padding-bottom: 0 !important;
}
.admin-student-card .card-head-main .card-tag {
    padding-top: 5px !important; padding-bottom: 1px !important;
}
.record-progress .record-actions .btn-save-all,
.record-actions .btn-save-all {
    padding-top: 11px !important; padding-bottom: 7px !important;
}
.admin-home-knight .knight-score-badge,
#studentKnightScore,
#knightScore {
    padding-top: 6px !important; padding-bottom: 2px !important;
}
.admin-student-card .btn-card-save {
    padding-top: 10px !important; padding-bottom: 6px !important;
}

/* قواعد سابقة بالاختصار padding !important تغلّبت على الطولية.
   :not(#_) يرفع الخصوصية بمقدار مُعرّف دون تغيير ما يُطابَق. */
.student-recorder-name:not(#_) { padding: 4px 8px 0 !important; }
.btn-save-all:not(#_)         { padding: 11px 14px 7px !important; }
.btn-card-save:not(#_)        { padding: 10px 12px 6px !important; }
.card-tag:not(#_)             { padding: 5px 8px 1px !important; }
.jd-select__btn:not(#_)       { padding-top: 10px !important; padding-bottom: 8px !important; }
.btn-primary-custom:not(#_),
.btn-secondary-custom:not(#_) { padding-top: 14px !important; padding-bottom: 12px !important; }

/* btn-save-all هو أيضاً btn-primary-custom، والقاعدة العامة بعده فتغلب */
.record-actions .btn-save-all:not(#_) { padding: 11px 14px 7px !important; }

/* ══════════ دفعة 36: قائمة بمجموعات ══════════ */

.admin-menu-group { display: block; }

/* رأس المجموعة */
.admin-menu-dropdown .admin-menu-head { width: 100%; }
.admin-menu-dropdown .admin-menu-head .admin-menu-caret {
    margin-inline-start: auto;
    font-size: .66rem;
    opacity: .55;
    transition: transform .26s cubic-bezier(.33,1,.68,1);
}
.admin-menu-group.open .admin-menu-head .admin-menu-caret { transform: rotate(180deg); }
.admin-menu-group.open .admin-menu-head { color: #1c5b78; }
.admin-menu-group.open .admin-menu-head > i:first-child { color: #c9a24f; }

/* الأبناء: مطويّون افتراضياً وينفتحون بانسيابية */
.admin-menu-dropdown .admin-menu-sub {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .28s cubic-bezier(.33,1,.68,1);
}
.admin-menu-group.open .admin-menu-sub { grid-template-rows: 1fr; }
.admin-menu-dropdown .admin-menu-sub > * { min-height: 0; }
.admin-menu-dropdown .admin-menu-sub {
    overflow: hidden;
}

/* عنصر فرعي: أصغر ومزاح للداخل مع خط يربطه بالمجموعة */
.admin-menu-dropdown .admin-menu-child {
    font-size: .82rem !important;
    padding-inline-start: 26px !important;
    opacity: 1;
}
.admin-menu-dropdown .admin-menu-sub {
    border-inline-start: 2px solid rgba(189,148,80,.28);
    margin-inline-start: 15px;
    padding-inline-start: 2px;
}
.admin-menu-dropdown .admin-menu-child > i:first-child {
    font-size: .78rem;
    opacity: .8;
}

/* حركة الظهور المتدرّج تُطبَّق على العناصر العليا فقط */
.admin-menu-dropdown .admin-menu-sub .admin-menu-item {
    opacity: 1 !important;
    transform: none !important;
    transition-delay: 0s !important;
}

/* grid-template-rows: 0fr يطوي الصف الأول فقط، والأزرار الستة تولّد صفوفاً
   ضمنية بارتفاع تلقائي — فلم ينطبق الطيّ. نستعمل max-height مع overflow. */
.admin-menu-dropdown .admin-menu-sub {
    display: block !important;
    grid-template-rows: none !important;
    max-height: 0;
    overflow: hidden;
    opacity: .35;
    transition: max-height .3s cubic-bezier(.33,1,.68,1), opacity .22s ease;
}
.admin-menu-group.open .admin-menu-sub {
    max-height: 420px;
    opacity: 1;
}

/* ══════════ دفعة 37: الشاشات الثلاث الجديدة ══════════ */

/* ── بطاقات الإعدادات ── */
.mahr-settings-card, .unlock-card, .hall-preview-card {
    background: #fff;
    border: 1px solid rgba(35,107,140,.13);
    border-top: 2px solid rgba(189,148,80,.55);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(20,58,77,.06);
    padding: 14px 15px;
    margin-bottom: 12px;
}
.unlock-card-title {
    margin: 0 0 4px; font-size: .95rem; font-weight: 800; color: #16303d;
    display: flex; align-items: center; gap: 8px;
}
.unlock-card-title i { color: #c9a24f; font-size: .85rem; }
.unlock-card-desc { margin: 0 0 12px; font-size: .78rem; color: #7d8892; line-height: 1.7; }

.unlock-row {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    margin-bottom: 9px;
}
.unlock-row > label {
    flex: 0 0 auto; min-width: 42px;
    font-size: .8rem; font-weight: 700; color: #5a6873;
}
.unlock-select {
    flex: 1 1 120px; min-width: 0;
    min-height: 38px; padding: 6px 11px;
    font: inherit; font-size: .86rem; font-weight: 700; color: #17506b;
    background: #f6f4ef;
    border: 1px solid rgba(35,107,140,.18);
    border-radius: 11px;
}
.unlock-select:focus { outline: none; border-color: rgba(189,148,80,.65); background: #fff; }
.unlock-hint {
    margin: 6px 0 0; font-size: .76rem; font-weight: 700;
    color: #8a6a34; line-height: 1.7;
}

.unlock-actions {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    margin-top: 4px;
}
.unlock-actions .btn-primary-custom, .unlock-actions .btn-secondary-custom {
    flex: 0 0 auto; width: auto; margin: 0;
}
.unlock-status, .mahr-settings-status {
    flex: 1 1 auto; font-size: .78rem; font-weight: 700; color: #8a949c;
}

/* ── درجات الخانات ── */
.mahr-settings-list { display: flex; flex-direction: column; gap: 7px; }
.mahr-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px;
    background: #f8f6f1;
    border: 1px solid rgba(35,107,140,.10);
    border-radius: 12px;
}
.mahr-row--skip { background: #f2f0ec; opacity: .85; }
.mahr-row-label {
    flex: 1 1 auto; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
    font-size: .86rem; font-weight: 800; color: #16303d;
}
.mahr-row-label i { color: #c9a24f; margin-inline-end: 5px; }
.mahr-row-label small { font-size: .7rem; font-weight: 600; color: #8a949c; }
.mahr-row-note { flex: 0 0 auto; font-size: .74rem; font-weight: 700; color: #8a949c; }
.mahr-input {
    flex: 0 0 66px; width: 66px;
    min-height: 36px; padding: 4px 8px;
    text-align: center;
    font: inherit; font-size: .92rem; font-weight: 800; color: #17506b;
    background: #fff;
    border: 1px solid rgba(35,107,140,.2);
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}
.mahr-input:focus { outline: none; border-color: rgba(189,148,80,.7); }
.mahr-settings-foot {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 13px; padding-top: 12px;
    border-top: 1px dashed rgba(35,107,140,.18);
}
.mahr-total-wrap { font-size: .84rem; font-weight: 700; color: #5a6873; }
.mahr-total-wrap strong { font-size: 1.1rem; color: #17506b; font-variant-numeric: tabular-nums; }
.mahr-settings-foot .btn-primary-custom { flex: 0 0 auto; width: auto; margin: 0; }

/* ── ضبط شاشة العرض ── */
.hall-preview-label { display: block; font-size: .76rem; font-weight: 800; color: #8a949c; margin-bottom: 9px; }
.hall-preview-frame {
    width: 100%; aspect-ratio: 16 / 9;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #143a4d, #17506b);
    border-radius: 12px;
    overflow: hidden;
}
.hall-preview-box {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #f0d089, #c49a4e);
    color: #12303d; font-size: .8rem; font-weight: 800;
    border-radius: 8px;
    transform: scale(var(--preview-scale, 1));
    transition: width .16s ease, height .16s ease, transform .16s ease;
}
.hall-slider-row {
    display: flex; align-items: center; gap: 11px;
    margin-bottom: 13px;
}
.hall-slider-row > label {
    flex: 0 0 86px; font-size: .82rem; font-weight: 700; color: #5a6873;
}
.hall-slider-row input[type=range] { flex: 1 1 auto; min-width: 0; accent-color: #c9a24f; }
.hall-slider-row output {
    flex: 0 0 46px; text-align: center;
    font-size: .82rem; font-weight: 800; color: #17506b;
    font-variant-numeric: tabular-nums;
}

/* أبعاد شاشة العرض تُطبَّق من الإعدادات المشتركة */
.presentation-screen-overlay .presentation-inner,
.presentation-screen-overlay > div:first-child {
    max-width: var(--hall-w, 100%);
    max-height: var(--hall-h, 100%);
}
.presentation-screen-overlay.hall-screen .presentation-inner,
.presentation-screen-overlay.hall-screen > div:first-child {
    transform: scale(var(--hall-scale, 1));
    transform-origin: center;
}
