/* =========================================================
   نظام التصميم الموحد — Modern & Bright
   كل الألوان والمسافات والزوايا والظلال معرّفة هنا فقط.
   لتغيير شكل البرنامج كله عدّل القيم في :root.
   ========================================================= */

:root {
    /* الخط */
    --ui-font: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;

    /* الألوان الأساسية */
    --ui-primary: #3b5bfd;
    --ui-primary-strong: #2340e0;
    --ui-primary-soft: #eef1ff;
    --ui-accent: #f5a524;
    --ui-accent-soft: #fff5e1;
    --ui-success: #12b981;
    --ui-success-soft: #e6f8f1;
    --ui-warning: #f59e0b;
    --ui-warning-soft: #fff4de;
    --ui-danger: #ef4461;
    --ui-danger-soft: #fdecef;
    --ui-violet: #8b5cf6;
    --ui-violet-soft: #f2edff;
    --ui-slate: #64748b;
    --ui-slate-soft: #eef2f6;

    /* الخلفيات والنصوص */
    --ui-bg: #f4f6fb;
    --ui-surface: #ffffff;
    --ui-border: #e6eaf2;
    --ui-text: #172036;
    --ui-text-muted: #6b7690;

    /* التدرجات */
    --ui-gradient-primary: linear-gradient(135deg, #3b5bfd 0%, #6c5cff 55%, #9b6bff 100%);
    --ui-gradient-accent: linear-gradient(135deg, #ffb547 0%, #ff8a4c 100%);

    /* الزوايا والظلال والمسافات */
    --ui-radius-sm: 10px;
    --ui-radius: 16px;
    --ui-radius-lg: 24px;
    --ui-shadow-sm: 0 1px 2px rgba(23, 32, 54, .06), 0 1px 3px rgba(23, 32, 54, .05);
    --ui-shadow: 0 6px 20px rgba(38, 56, 120, .08);
    --ui-shadow-lg: 0 18px 40px rgba(59, 91, 253, .18);
    --ui-gap: 1.25rem;
    --ui-transition: 180ms cubic-bezier(.2, .7, .3, 1);
}

/* ---------- الأساس ---------- */

body {
    font-family: var(--ui-font);
    color: var(--ui-text);
    background-color: var(--ui-bg);
}

.ui-page {
    display: grid;
    gap: var(--ui-gap);
    padding-block: 1.25rem 2rem;
    color: var(--ui-text);
}

/* ---------- عنوان القسم ---------- */

.ui-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 .9rem;
}

.ui-section-title h2 {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.ui-section-title h2 i {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
    border-radius: var(--ui-radius-sm);
    font-size: 1rem;
}

/* ---------- البطاقة ---------- */

.ui-card {
    padding: 1.25rem;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-sm);
}

/* ---------- الشارة ---------- */

.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    color: var(--ui-primary-strong);
    background: var(--ui-primary-soft);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.ui-badge--accent { color: #a4610a; background: var(--ui-accent-soft); }
.ui-badge--success { color: #0a7a55; background: var(--ui-success-soft); }
.ui-badge--danger { color: #b3203d; background: var(--ui-danger-soft); }

/* ---------- بطاقة الإحصائية ---------- */

.ui-stat {
    --stat-color: var(--ui-primary);
    --stat-soft: var(--ui-primary-soft);
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    color: inherit;
    text-decoration: none;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
    transition: transform var(--ui-transition), box-shadow var(--ui-transition);
}

.ui-stat::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--stat-color);
}

a.ui-stat:hover {
    color: inherit;
    transform: translateY(-3px);
    box-shadow: var(--ui-shadow);
}

.ui-stat__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 3rem;
    height: 3rem;
    color: var(--stat-color);
    background: var(--stat-soft);
    border-radius: 14px;
    font-size: 1.35rem;
}

.ui-stat__body {
    display: grid;
    min-width: 0;
}

.ui-stat__label {
    color: var(--ui-text-muted);
    font-size: .85rem;
    font-weight: 600;
}

.ui-stat__value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.ui-stat__meta {
    color: var(--ui-text-muted);
    font-size: .75rem;
}

.ui-stat--success { --stat-color: var(--ui-success); --stat-soft: var(--ui-success-soft); }
.ui-stat--warning { --stat-color: var(--ui-warning); --stat-soft: var(--ui-warning-soft); }
.ui-stat--danger { --stat-color: var(--ui-danger); --stat-soft: var(--ui-danger-soft); }
.ui-stat--violet { --stat-color: var(--ui-violet); --stat-soft: var(--ui-violet-soft); }
.ui-stat--slate { --stat-color: var(--ui-slate); --stat-soft: var(--ui-slate-soft); }
.ui-stat--accent { --stat-color: var(--ui-accent); --stat-soft: var(--ui-accent-soft); }

/* ---------- الأزرار ---------- */

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .6rem 1.1rem;
    color: #fff;
    text-decoration: none;
    background: var(--ui-gradient-primary);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(59, 91, 253, .28);
    font-weight: 700;
    transition: transform var(--ui-transition), box-shadow var(--ui-transition);
}

.ui-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--ui-shadow-lg);
}

.ui-btn--ghost {
    color: var(--ui-primary-strong);
    background: var(--ui-primary-soft);
    box-shadow: none;
}

.ui-btn--ghost:hover {
    color: var(--ui-primary-strong);
    box-shadow: var(--ui-shadow-sm);
}

/* تصدير Excel: أخضر بجوار زر PDF */
.ui-btn--excel {
    background: linear-gradient(135deg, #1d8a57, #107c41);
    box-shadow: 0 6px 16px rgba(16, 124, 65, .25);
}

.ui-icon-btn.fp-excel {
    color: #107c41;
}

/* ---------- الحالة الفارغة ---------- */

.ui-empty {
    display: grid;
    justify-items: center;
    gap: .4rem;
    padding: 1.75rem 1rem;
    color: var(--ui-text-muted);
    text-align: center;
}

.ui-empty i {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
    border-radius: 50%;
    font-size: 1.4rem;
}

.ui-empty strong {
    color: var(--ui-text);
}

/* ---------- رأس الصفحة ---------- */

.ui-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ui-page-header__title {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.ui-page-header__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 3rem;
    height: 3rem;
    color: #fff;
    background: var(--ui-gradient-primary);
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(59, 91, 253, .3);
    font-size: 1.35rem;
}

.ui-page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.ui-page-header p {
    margin: 0;
    color: var(--ui-text-muted);
    font-size: .9rem;
}

.ui-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

/* ---------- شبكة الإحصائيات ---------- */

.ui-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
    gap: 1rem;
}

.ui-stats .ui-stat {
    padding: .9rem 1rem;
}

.ui-stats .ui-stat__icon {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.15rem;
}

.ui-stats .ui-stat__value {
    font-size: 1.45rem;
}

/* ---------- إحصائيات مصغّرة متدرجة ---------- */

.ui-chip-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-chip-stat {
    --chip-gradient: linear-gradient(135deg, #3b5bfd, #6c5cff);
    --chip-shadow: rgba(59, 91, 253, .28);
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    column-gap: .5rem;
    align-items: center;
    min-width: 5.75rem;
    padding: .45rem .8rem;
    color: #fff;
    background: var(--chip-gradient);
    border-radius: 14px;
    box-shadow: 0 6px 14px var(--chip-shadow);
}

.ui-chip-stat i {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    background: rgba(255, 255, 255, .2);
    border-radius: 10px;
    font-size: .95rem;
}

.ui-chip-stat strong {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.ui-chip-stat span {
    font-size: .72rem;
    font-weight: 600;
    opacity: .9;
    line-height: 1.2;
}

.ui-chip-stat--violet { --chip-gradient: linear-gradient(135deg, #7c4dff, #b06bff); --chip-shadow: rgba(124, 77, 255, .28); }
.ui-chip-stat--pink { --chip-gradient: linear-gradient(135deg, #ff4f8b, #ff85a8); --chip-shadow: rgba(255, 79, 139, .28); }
.ui-chip-stat--green { --chip-gradient: linear-gradient(135deg, #0fb87a, #3ddc97); --chip-shadow: rgba(15, 184, 122, .28); }
.ui-chip-stat--orange { --chip-gradient: linear-gradient(135deg, #ff7a3d, #ffa94d); --chip-shadow: rgba(255, 122, 61, .28); }
.ui-chip-stat--red { --chip-gradient: linear-gradient(135deg, #d7263d, #ff5a6e); --chip-shadow: rgba(215, 38, 61, .28); }
.ui-chip-stat--gold { --chip-gradient: linear-gradient(135deg, #e6a200, #ffc93c); --chip-shadow: rgba(230, 162, 0, .28); }

/* ---------- التبويبات ---------- */

.ui-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .6rem .75rem 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--ui-border);
    scrollbar-width: thin;
}

.ui-tabs__item {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .45rem;
    padding: .6rem .85rem;
    color: var(--ui-text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    border-radius: 10px 10px 0 0;
    font-size: .88rem;
    font-weight: 700;
    transition: color var(--ui-transition), background var(--ui-transition), border-color var(--ui-transition);
}

.ui-tabs__item:hover {
    color: var(--ui-text);
    background: var(--ui-bg);
}

.ui-tabs__item b {
    min-width: 1.5rem;
    padding: .05rem .45rem;
    color: var(--ui-text-muted);
    background: var(--ui-slate-soft);
    border-radius: 999px;
    font-size: .72rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.ui-tabs__item.is-active {
    color: var(--ui-primary-strong);
    border-bottom-color: var(--ui-primary);
}

.ui-tabs__item.is-active b {
    color: #fff;
    background: var(--ui-primary);
}

/* ---------- بطاقة أعياد الميلاد (اليوم / الأسبوع / الشهر) ---------- */

.ui-birthdays {
    display: inline-flex;
    flex: none;
    align-items: center;
    align-self: center;
    gap: .3rem;
    margin-inline-start: auto;
    margin-bottom: .45rem;
    padding: .25rem .3rem .25rem .6rem;
    background: linear-gradient(135deg, #fff1f6, #fff6e8);
    border: 1px solid #ffd6e4;
    border-radius: 14px;
}

.ui-birthdays__title {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding-inline: .35rem;
    color: #c2185b;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.ui-birthdays__item {
    display: grid;
    justify-items: center;
    min-width: 3.4rem;
    padding: .2rem .5rem;
    color: var(--ui-text-muted);
    text-decoration: none;
    background: var(--ui-surface);
    border: 1px solid transparent;
    border-radius: 10px;
    line-height: 1.15;
    transition: transform var(--ui-transition), box-shadow var(--ui-transition), border-color var(--ui-transition);
}

.ui-birthdays__item b {
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.ui-birthdays__item span {
    font-size: .68rem;
    font-weight: 700;
}

.ui-birthdays__item.has-items {
    color: #fff;
    background: linear-gradient(135deg, #ff4f8b, #ff9a5a);
    box-shadow: 0 4px 10px rgba(255, 79, 139, .28);
}

.ui-birthdays__item:hover {
    color: inherit;
    border-color: #ff85a8;
    transform: translateY(-2px);
}

.ui-birthdays__item.has-items:hover {
    color: #fff;
}

/* ---------- علامات صغيرة بجانب الاسم ---------- */

.ui-flag {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    font-size: .7rem;
    cursor: help;
}

.ui-flag--danger { color: var(--ui-danger); background: var(--ui-danger-soft); }
.ui-flag--primary { color: var(--ui-primary); background: var(--ui-primary-soft); }
.ui-flag--violet { color: var(--ui-violet); background: var(--ui-violet-soft); }
.ui-flag--slate { color: var(--ui-slate); background: var(--ui-slate-soft); }
.ui-flag--accent { color: #c77c00; background: var(--ui-accent-soft); }

/* ---------- أيقونة الكأس (التناول): بلون النص المحيط ---------- */

.icon-chalice {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -.125em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M4 2h16c0 5.2-3.1 8.8-7 9.6V19h4v2H7v-2h4v-7.4C7.1 10.8 4 7.2 4 2zm7 2v2H9v2h2v2.3h2V8h2V6h-2V4z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M4 2h16c0 5.2-3.1 8.8-7 9.6V19h4v2H7v-2h4v-7.4C7.1 10.8 4 7.2 4 2zm7 2v2H9v2h2v2.3h2V8h2V6h-2V4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- حقول الإدخال ---------- */

.ui-field {
    display: grid;
    gap: .35rem;
    min-width: 0;
}

.ui-field > label {
    color: var(--ui-text-muted);
    font-size: .8rem;
    font-weight: 700;
}

.ui-field .form-control,
.ui-field .form-select {
    min-height: 2.75rem;
    color: var(--ui-text);
    background-color: var(--ui-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .92rem;
    transition: border-color var(--ui-transition), background-color var(--ui-transition), box-shadow var(--ui-transition);
}

.ui-field .form-control:focus,
.ui-field .form-select:focus {
    background-color: var(--ui-surface);
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px rgba(59, 91, 253, .14);
}

.ui-input-icon {
    position: relative;
}

.ui-input-icon > i {
    position: absolute;
    inset-block: 0;
    inset-inline-start: .95rem;
    display: grid;
    place-items: center;
    color: var(--ui-text-muted);
    pointer-events: none;
}

.ui-input-icon > .form-control {
    padding-inline-start: 2.6rem;
}

/* ---------- شريط الفلاتر ---------- */

/* شريط مضغوط بلون خفيف: العناوين مخفية بصريًا (تبقى لقارئات الشاشة) والنص الإرشادي داخل الحقول */
.ui-filter {
    display: grid;
    grid-template-columns: minmax(12rem, 2fr) repeat(4, minmax(7rem, 1fr)) auto;
    align-items: center;
    gap: .6rem;
    padding: .6rem .75rem;
    background: linear-gradient(135deg, #eef1ff 0%, #f5efff 100%);
    border-color: #d9dffb;
}

.ui-filter .ui-field > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.ui-filter .ui-field .form-control,
.ui-filter .ui-field .form-select {
    min-height: 2.35rem;
    padding-block: .3rem;
    background-color: var(--ui-surface);
    border-color: #dfe4f7;
    font-size: .88rem;
}

.ui-filter__actions {
    display: flex;
    gap: .4rem;
}

.ui-filter__actions .ui-btn {
    min-height: 2.35rem;
    padding: .35rem .95rem;
}

@media (max-width: 1199.98px) {
    .ui-filter {
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    }

    .ui-filter > .ui-field:first-of-type {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .ui-filter {
        grid-template-columns: 1fr 1fr;
    }

    .ui-filter__actions {
        grid-column: 1 / -1;
    }

    .ui-filter__actions .ui-btn {
        flex: 1;
    }
}

/* ---------- الجدول ---------- */

.ui-table-card {
    padding: 0;
    overflow: hidden;
}

.ui-table-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ui-border);
}

.ui-table-card__header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.ui-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* صف العناوين بنفسجي موحد، والعناوين في المنتصف */
.ui-table thead tr {
    background: #6d3fd8;
}

.ui-table th {
    padding: .7rem 1rem;
    color: #fff;
    background: transparent;
    border-bottom: 0;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
}

.ui-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--ui-border);
    font-size: .9rem;
    vertical-align: middle;
    text-align: center;
}

/* العمود الأول (الاسم) يبقى بمحاذاة البداية ليسهل قراءته، إلا لو كان رقمًا مسلسلًا */
.ui-table td:first-child {
    text-align: start;
}

.ui-table td.ui-muted:first-child {
    text-align: center;
}

.ui-table tbody tr:last-child td {
    border-bottom: 0;
}

.ui-table tbody tr {
    transition: background var(--ui-transition);
}

/* شفاف حتى تظهر ألوان الأعمدة المميزة تحته */
.ui-table tbody tr:hover {
    background: rgba(59, 91, 253, .05);
}

.ui-table .ui-table__actions {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.ui-table .ui-muted {
    color: var(--ui-text-muted);
}

.ui-table__code {
    padding: .15rem .5rem;
    color: var(--ui-text-muted);
    background: var(--ui-bg);
    border-radius: 6px;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- الصورة الرمزية ---------- */

.ui-person {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
}

.ui-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    color: var(--ui-primary-strong);
    background: var(--ui-primary-soft);
    border-radius: 50%;
    font-size: .95rem;
    font-weight: 800;
}

.ui-avatar--female {
    color: #b3206b;
    background: #fdebf4;
}

.ui-person__text {
    display: grid;
    min-width: 0;
}

.ui-person__text a,
.ui-person__text strong {
    overflow: hidden;
    color: var(--ui-text);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.ui-person__text a:hover {
    color: var(--ui-primary);
}

.ui-person__text small {
    color: var(--ui-text-muted);
    font-size: .76rem;
}

/* ---------- شارة الحالة ---------- */

.ui-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .7rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.ui-status::before {
    content: "";
    width: .45rem;
    height: .45rem;
    background: currentColor;
    border-radius: 50%;
}

.ui-status--success { color: #0a7a55; background: var(--ui-success-soft); }
.ui-status--warning { color: #a4610a; background: var(--ui-warning-soft); }
.ui-status--danger { color: #b3203d; background: var(--ui-danger-soft); }
.ui-status--slate { color: #475569; background: var(--ui-slate-soft); }
.ui-status--violet { color: #6d3fd8; background: var(--ui-violet-soft); }
.ui-status--primary { color: var(--ui-primary-strong); background: var(--ui-primary-soft); }

/* ---------- أزرار الأيقونات ---------- */

.ui-icon-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.ui-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    color: var(--ui-text-muted);
    background: transparent;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    text-decoration: none;
    transition: color var(--ui-transition), background var(--ui-transition), border-color var(--ui-transition);
}

.ui-icon-btn:hover,
.ui-icon-btn[aria-expanded="true"] {
    color: var(--ui-primary-strong);
    background: var(--ui-primary-soft);
    border-color: transparent;
}

/* ---------- القائمة المنسدلة ---------- */

.ui-menu.dropdown-menu {
    min-width: 12rem;
    padding: .4rem;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    box-shadow: var(--ui-shadow);
}

.ui-menu form {
    margin: 0;
}

.ui-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .7rem;
    border-radius: 9px;
    font-size: .88rem;
    font-weight: 600;
}

.ui-menu .dropdown-item:hover {
    background: var(--ui-bg);
}

.ui-menu .dropdown-item--danger {
    color: var(--ui-danger);
}

@media (prefers-reduced-motion: reduce) {
    .ui-stat,
    .ui-btn,
    .ui-icon-btn,
    .ui-table tbody tr,
    .ui-field .form-control,
    .ui-field .form-select {
        transition: none;
    }
}

/* =========================================================
   صفحات النماذج (إضافة / تعديل)
   ui-form يلف النموذج كله ويعيد تنسيق حقول Bootstrap داخله،
   وui-section بطاقة لكل مجموعة حقول بأيقونة ملونة صغيرة.
   ========================================================= */

.ui-form-page {
    width: min(100%, 1120px);
    margin-inline: auto;
}

.ui-form-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
}

.ui-form-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
}

.ui-form-header p {
    margin: 0;
    color: var(--ui-text-muted);
    font-size: .88rem;
}

/* زر «رجوع»: بطاقة ملوّنة واضحة في كل صفحات البرنامج */
.ui-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-strong));
    border: 0;
    border-radius: .8rem;
    font-size: .95rem;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
}

.ui-back:hover {
    color: #fff;
    filter: brightness(1.1);
}

/* في صفحات اختيار الشهر والسنة: «رجوع» بجوار الاختيار، ويختفي المكرر في رأس الصفحة */
.ui-back--period { margin-inline-end: .2rem; }
.ui-page:has(.ui-back--period) header .ui-backbar { display: none; }
.ui-page:has(.bro-church .ui-back) .ui-back--period { display: none; }

.ui-form {
    display: grid;
    gap: var(--ui-gap);
}

.ui-form .form-label,
.ui-form label.control-label {
    margin-bottom: .3rem;
    color: var(--ui-text-muted);
    font-size: .8rem;
    font-weight: 700;
}

.ui-form .form-control,
.ui-form .form-select {
    min-height: 2.6rem;
    color: var(--ui-text);
    background-color: var(--ui-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .92rem;
    transition: border-color var(--ui-transition), background-color var(--ui-transition), box-shadow var(--ui-transition);
}

.ui-form textarea.form-control {
    min-height: 5.5rem;
}

.ui-form .form-control:focus,
.ui-form .form-select:focus {
    background-color: var(--ui-surface);
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px rgba(59, 91, 253, .14);
}

.ui-form .form-control[readonly] {
    color: var(--ui-text-muted);
    background-color: var(--ui-slate-soft);
}

.ui-form .form-check-input:checked {
    background-color: var(--ui-primary);
    border-color: var(--ui-primary);
}

.ui-form .text-danger,
.ui-form .field-validation-error {
    font-size: .78rem;
}

.ui-form .validation-summary-errors {
    padding: .6rem .9rem;
    color: #b3203d;
    background: var(--ui-danger-soft);
    border-radius: var(--ui-radius-sm);
}

.ui-form .validation-summary-valid {
    display: none;
}

.ui-form .validation-summary-errors ul {
    margin: 0;
    padding-inline-start: 1.1rem;
}

/* ---------- بطاقة مجموعة حقول ---------- */

.ui-section {
    --section-color: var(--ui-primary);
    --section-soft: var(--ui-primary-soft);
    padding: 1.1rem 1.25rem 1.25rem;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-top: 3px solid var(--section-color);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-sm);
}

.ui-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
    margin-bottom: 1rem;
}

.ui-section__head h2 {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.ui-section__head h2 i {
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    color: var(--section-color);
    background: var(--section-soft);
    border-radius: 9px;
    font-size: .95rem;
}

.ui-section__head p {
    margin: 0;
    color: var(--ui-text-muted);
    font-size: .8rem;
}

.ui-section--violet { --section-color: var(--ui-violet); --section-soft: var(--ui-violet-soft); }
.ui-section--green { --section-color: var(--ui-success); --section-soft: var(--ui-success-soft); }
.ui-section--gold { --section-color: var(--ui-accent); --section-soft: var(--ui-accent-soft); }
.ui-section--pink { --section-color: #ec4899; --section-soft: #fdebf4; }
.ui-section--danger { --section-color: var(--ui-danger); --section-soft: var(--ui-danger-soft); }
.ui-section--slate { --section-color: var(--ui-slate); --section-soft: var(--ui-slate-soft); }

/* شبكة حقول مرنة: عمودان أو ثلاثة حسب العرض */
.ui-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: .9rem 1rem;
}

.ui-form-grid > .is-wide {
    grid-column: 1 / -1;
}

/* ---------- أزرار الحفظ: شريط ثابت أسفل الشاشة ---------- */

.ui-form-actions {
    position: sticky;
    bottom: .75rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .65rem;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(8px);
}

.ui-form-actions .ui-btn {
    min-width: 9rem;
}

.ui-btn--success {
    background: linear-gradient(135deg, #0fb87a, #3ddc97);
    box-shadow: 0 6px 16px rgba(15, 184, 122, .28);
}

.ui-btn--danger {
    background: linear-gradient(135deg, #ef4461, #ff7a8a);
    box-shadow: 0 6px 16px rgba(239, 68, 97, .28);
}

.ui-btn--plain {
    color: var(--ui-text-muted);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    box-shadow: none;
}

.ui-btn--plain:hover {
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-sm);
}

/* ---------- صفحة عرض: أزواج (عنوان / قيمة) ---------- */

.ui-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .6rem;
    margin: 0;
}

.ui-facts > div {
    display: grid;
    gap: .15rem;
    padding: .55rem .75rem;
    background: var(--ui-bg);
    border-radius: 12px;
}

.ui-facts dt {
    color: var(--ui-text-muted);
    font-size: .74rem;
    font-weight: 700;
}

.ui-facts dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ui-facts dd:empty::before,
.ui-facts dd.is-empty {
    color: var(--ui-text-muted);
    font-weight: 500;
}

.ui-facts dd:empty::before {
    content: "—";
}
.ui-notes {
    margin: 0;
    white-space: pre-line;
}

.ui-notes--empty {
    color: var(--ui-text-muted);
    font-size: .88rem;
}
/* ---------- اختيار من أزرار صغيرة ملونة (بديل القائمة المنسدلة القصيرة) ---------- */

.ui-choice {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.ui-choice__item {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.ui-choice__item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ui-choice__item span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .8rem;
    color: var(--ui-text-muted);
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    transition: color var(--ui-transition), background var(--ui-transition), border-color var(--ui-transition);
}

.ui-choice__item:hover span {
    color: var(--ui-primary-strong);
    border-color: var(--ui-primary);
}

.ui-choice__item input:checked + span {
    color: #fff;
    background: var(--ui-gradient-primary);
    border-color: transparent;
}

.ui-choice__item input:focus-visible + span {
    box-shadow: 0 0 0 4px rgba(59, 91, 253, .2);
}
/* ---------- رسالة تأكيد بعد الحفظ ---------- */

.ui-flash {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .9rem;
    color: #0a7a55;
    background: var(--ui-success-soft);
    border: 1px solid #b7ecd7;
    border-radius: var(--ui-radius-sm);
    font-weight: 700;
}
.ui-form-page--narrow {
    width: min(100%, 720px);
}
.ui-flash--danger {
    color: #b3203d;
    background: var(--ui-danger-soft);
    border-color: #f7c2cd;
}
/* ---------- مفتاح صغير ملون (خانة اختيار على شكل زر) ---------- */

.ui-toggle {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.ui-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ui-toggle span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .85rem;
    color: var(--ui-text-muted);
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    transition: color var(--ui-transition), background var(--ui-transition), border-color var(--ui-transition);
}

.ui-toggle:hover span {
    border-color: #ec4899;
}

.ui-toggle input:checked + span {
    color: #fff;
    background: linear-gradient(135deg, #ec4899, #ff85a8);
    border-color: transparent;
}

.ui-toggle input:focus-visible + span {
    box-shadow: 0 0 0 4px rgba(236, 72, 153, .2);
}
/* ---------- فحص الرقم القومي والموبايل أثناء الكتابة ---------- */

.id-check {
    display: block;
    margin-top: .25rem;
    font-size: .76rem;
    font-weight: 700;
}

.id-check.is-ok { color: #0a7a55; }
.id-check.is-error { color: #b3203d; }
/* ---------- شريط زر الرجوع أعلى الصفحة ---------- */

.ui-backbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: calc(var(--ui-gap) * -.5);
}
/* ---------- إخوة الرب: سطر واحد في ملف الأسرة وملف الفرد (سرّي: للكاهن وخادم إخوة الرب) ---------- */

.brothers-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem .6rem;
    padding: .28rem .7rem;
    background: #fdebf4;
    border: 1px solid #f7c6de;
    border-radius: 999px;
    font-size: .8rem;
}

/* في رأس ملف الأسرة: تحت أزرار الزيارات والاحتياجات والمستند، بعرضها كلها */
.brothers-line--head {
    grid-column: 1 / -1;
    justify-content: center;
}

.brothers-line__title {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #be185d;
    font-weight: 800;
}

.brothers-line__text {
    color: var(--ui-text-muted);
    font-weight: 600;
}

.brothers-line__link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .08rem .6rem;
    color: #fff;
    text-decoration: none;
    background: #db2777;
    border-radius: 999px;
    font-weight: 700;
}

.brothers-line__link:hover {
    color: #fff;
    background: #be185d;
}

/* زر إخوة الرب تحت بطاقة كل فرد في ملف الأسرة: باهت قبل الإلحاق، ملوَّن بعده */
.person-brothers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    width: 100%;
    margin-top: .3rem;
    padding: .2rem .5rem;
    color: #9d174d;
    background: transparent;
    border: 1px dashed #f0a9cb;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.person-brothers:hover {
    color: #be185d;
    background: #fdebf4;
}

.person-brothers.is-on {
    color: #fff;
    background: #db2777;
    border: 1px solid #db2777;
}

.person-brothers.is-on:hover {
    color: #fff;
    background: #be185d;
}

/* ---------- رأس الصفحة الموحد: العنوان و«رجوع» تحته، وبجوارهما البطاقات في سطرين ---------- */

header.page-head--grid {
    display: grid;
    grid-template-columns: fit-content(55%) minmax(0, 1fr);
    align-items: center;
    gap: .6rem 1rem;
}

header.page-head--grid .ui-page-header__title p { margin: 0; }
header.page-head--grid .ui-page-header__title .ui-backbar { margin: .35rem 0 0; }
header.page-head--grid > :not(.ui-page-header__title):not(ul.page-stats) { grid-column: 1 / -1; }

ul.page-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin: 0;
}

ul.page-stats .ui-chip-stat {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: .6rem;
    min-width: 0;
    min-height: 2.6rem;
    padding: .3rem .65rem;
}

ul.page-stats .ui-chip-stat i { grid-row: auto; width: 2rem; height: 2rem; }
ul.page-stats .ui-chip-stat strong { font-size: 1.15rem; }
ul.page-stats .ui-chip-stat span { overflow: hidden; font-size: .82rem; font-weight: 700; opacity: 1; text-overflow: ellipsis; white-space: nowrap; }
ul.page-stats > li { min-width: 0; }
ul.page-stats .ui-birthdays { height: 100%; min-height: 2.6rem; flex-wrap: nowrap; }

@media (max-width: 1279.98px) {
    header.page-head--grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
    ul.page-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- لوحة المفاتيح ---------- */
/* الصف المحدد بالأسهم في الجداول */
.app-main table tbody tr.is-kb-row > td { background: #fff4d6 !important; box-shadow: inset 0 2px 0 #e0a526, inset 0 -2px 0 #e0a526; }
/* زر «رجوع» المضاف تلقائيًا تحت عنوان الصفحة */
.ui-backbar--title { margin: .35rem 0 0; }
/* قائمة الاختصارات */
.kb-dialog { width: min(36rem, 92vw); padding: 1.2rem 1.4rem; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); direction: rtl; }
.kb-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.kb-dialog h2 { margin: 0 0 .8rem; font-size: 1.15rem; font-weight: 800; }
.kb-dialog table { width: 100%; border-collapse: collapse; }
.kb-dialog td { padding: .4rem .3rem; border-bottom: 1px solid #eef1f6; font-size: .9rem; vertical-align: top; }
.kb-dialog td:first-child { width: 42%; white-space: nowrap; }
.kb-dialog kbd { padding: .1rem .45rem; color: #1e293b; background: #f1f4f9; border: 1px solid #d5dbe6; border-radius: 6px; font-family: inherit; font-size: .82rem; box-shadow: 0 1px 0 #cbd2de; }
.kb-dialog p { margin: .7rem 0; color: #5b6478; font-size: .84rem; }

/* صاحب الرقم القومي أو الموبايل تحت الخانة (site.js) */
.id-owner { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .3rem; padding: .4rem .6rem; border: 1px solid #cfe0f5; border-radius: .55rem; background: #f3f8ff; color: #1e3a5f; font-size: .8rem; line-height: 1.5; }
.id-owner > i { color: #2563eb; font-size: 1rem; }
.id-owner span { display: grid; flex: 1 1 12rem; min-width: 0; }
.id-owner small { color: #51607a; overflow-wrap: anywhere; }
.id-owner a { font-weight: 700; white-space: nowrap; }

/* علامة «صح» خضراء تحت الخانة الصحيحة (site.js) */
.field-ok { display: inline-flex; align-items: center; gap: .25rem; margin-top: .2rem; color: #0a7a55; font-size: .9rem; line-height: 1; }
.form-control.is-ok-mark, .form-select.is-ok-mark { border-color: #3fb17d; }
input.form-control.is-ok-mark:not([type=date]):not([type=time]) {
    padding-inline-end: 1.9rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230a7a55'%3e%3cpath d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.02L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: .95rem;
    background-position: left .55rem center;
}
[dir=ltr] input.form-control.is-ok-mark, input.form-control.is-ok-mark[dir=ltr] { background-position: right .55rem center; }

/* بطاقة صاحب الرقم تحت الخانة: عاجي بإطار ذهبي كالقوائم المنبثقة */
.id-owner { border-color: #e6cf97; background: #fbf6ea; color: #1f3d33; box-shadow: inset 0 1px 0 #fff, 0 3px 10px rgba(183, 121, 31, .12); }
.id-owner > i { color: #b7791f; }
.id-owner small { color: #5b5240; }
.id-owner a { color: #8a5a10; }

/* بطاقة صاحب الرقم: نفس تصميم القوائم المنبثقة */
.id-owner { border: 1.5px solid #e6cf97; border-inline-start: 5px solid #c9962e; font-weight: 600; box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(183, 121, 31, .15); }
.id-owner, .id-owner b, .id-owner small { color: #13295b; font-weight: 700; }
.id-owner small.is-place { color: #8a5a10; }

/* عنوان الصفحة القابل للتعديل (Partials/_PageTitle) */
.page-title-edit { margin-inline-start: .35rem; padding: .1rem .35rem; border: 0; border-radius: .4rem; background: transparent; color: #b7791f; font-size: .95rem; vertical-align: middle; opacity: .55; }
.page-title-edit:hover, .page-title-edit:focus { opacity: 1; background: #fbf6ea; }
.page-title-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: .4rem; align-items: center; margin-top: .4rem; padding: .5rem; border: 1.5px solid #e6cf97; border-inline-start: 5px solid #c9962e; border-radius: .6rem; background: #fbf6ea; }
.page-title-form[hidden] { display: none; }
.page-title-form small { grid-column: 1 / -1; color: #5b5240; }
@media (max-width: 767.98px) { .page-title-form { grid-template-columns: 1fr; } }

/* طفل الحضانة في تقرير أعياد الميلاد */
.birthdays-nursery { display: inline-flex; align-items: center; gap: .25rem; margin-inline-start: .35rem; padding: .05rem .5rem; border-radius: 999px; background: #fff3dc; color: #8a5200; font-size: .75rem; font-weight: 700; }

/* علامة «مكرر» بجوار اسم في أي قائمة، وتنبيه أعلى القائمة بعدد المكررين (Views/Shared/_DuplicateBadge و_DuplicateAlert) */
.dup-badge { display: inline-flex; align-self: flex-start; width: fit-content; align-items: center; gap: .2rem; margin-inline-start: .35rem; padding: 0 .5rem; color: #fff; background: #e2622d; border-radius: 999px; font-size: .72rem; font-weight: 800; line-height: 1.5; text-decoration: none; vertical-align: middle; white-space: nowrap; cursor: help; }
a.dup-badge { cursor: pointer; }
a.dup-badge:hover { color: #fff; background: #c4481a; }
.dup-alert { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: 0 0 .8rem; padding: .6rem .9rem; color: #8a2a12; background: #fff1ea; border: 1px solid #f6c7b0; border-inline-start: 5px solid #e2622d; border-radius: 12px; font-weight: 700; }
.dup-alert > i { font-size: 1.2rem; }
.dup-alert > span:not(.dup-alert__actions) { flex: 1 1 18rem; }
.dup-alert__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-inline-start: auto; }
.dup-alert .ui-btn { min-height: 2rem; padding: .15rem .8rem; font-size: .85rem; }
/* زر «مكرر» بعداد في شريط قائمة الفصل (Views/ServiceClasses/Roster.cshtml) */
.roster-dup-btn { color: #c4481a; border-color: #f6c7b0; background: #fff1ea; }
.roster-dup-btn:hover { color: #fff; background: #e2622d; border-color: #e2622d; }
.roster-dup-btn__count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .4rem; color: #fff; background: #e2622d; border-radius: 999px; font-size: .85rem; font-weight: 800; }
.roster-dup-btn:hover .roster-dup-btn__count { color: #e2622d; background: #fff; }
.roster-dup-btn--none { color: #1f7a4d; background: #ecf8f1; border-color: #bfe6cf; cursor: default; }
.roster-dup-btn--none:hover { color: #1f7a4d; background: #ecf8f1; border-color: #bfe6cf; }
.roster-dup-btn--none .roster-dup-btn__count, .roster-dup-btn--none:hover .roster-dup-btn__count { color: #fff; background: #2e9a63; }

/* تعديل المسميات: شريط وضع التعديل في كل الصفحات، وصفحة المسميات (Controllers/LabelsController, wwwroot/js/uiLabels.js) */
.label-edit-bar { position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 1080; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .7rem 1rem; color: #7a2e0e; background: #fff4ec; border: 2px solid #e2622d; border-radius: 16px; box-shadow: 0 10px 30px rgba(226, 98, 45, .25); font-weight: 600; }
.label-edit-bar[hidden] { display: none; }
.label-edit-bar > i { font-size: 1.4rem; color: #e2622d; }
.label-edit-bar > span { flex: 1 1 16rem; }
body.label-edit-mode { padding-bottom: 6rem; }
body.label-edit-mode :is(a, button, h1, h2, h3, h4, h5, th, label, strong, b, span, small, p, li, dt, dd, legend, summary):not(.label-edit-bar *):hover { outline: 2px dashed #e2622d; outline-offset: 2px; cursor: text; }
body.label-edit-mode :is(input, textarea)[placeholder]:not(.label-edit-bar *):hover { outline: 2px dashed #e2622d; outline-offset: 2px; cursor: text; }
.label-edit-start { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-inline-start: .5rem; padding: 0; vertical-align: middle; font-size: .95rem; color: #b45309; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 9px; opacity: .55; cursor: pointer; transition: opacity .15s; }
.label-edit-start:hover, .label-edit-start:focus-visible, body.label-edit-mode .label-edit-start { opacity: 1; color: #fff; background: #e2622d; border-color: #e2622d; }
.labels-page__icon { background: linear-gradient(135deg, #e2622d, #f59e0b); }
.labels-page .ui-card { margin-bottom: 1rem; padding: 1rem 1.1rem; }
.labels-page h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .7rem; font-size: 1.05rem; }
.labels-page__how ol { margin: 0; padding-inline-start: 1.3rem; line-height: 1.9; }
.labels-page__empty { margin: 0; color: var(--ui-text-muted, #6b7690); }
.labels-page__original { font-weight: 700; color: var(--ui-text-muted, #6b7690); }
.labels-page__row-form { display: flex; gap: .4rem; min-width: 14rem; }
.labels-page__add-form { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; margin-bottom: .4rem; }
.labels-page__add-form label { display: grid; gap: .25rem; flex: 1 1 14rem; font-weight: 700; font-size: .9rem; }
.labels-page__add small { color: var(--ui-text-muted, #6b7690); }

/* نسخة العرض: شريط ثابت أعلى المحتوى */
.showcase-banner {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .75rem;
    padding: .55rem .9rem;
    color: #6b4500;
    font-size: .88rem;
    background: linear-gradient(135deg, #fff5e1, #ffe7b3);
    border: 1px solid #f5c66b;
    border-radius: 12px;
}

.showcase-banner i { color: #d98a00; font-size: 1.1rem; }
/* شريط صفحات المرحلة: المخدومون والخدام · الحضور والغياب · الغياب المتكرر · الاعتراف */
.stage-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-bottom: .75rem;
    padding: .45rem .55rem;
}

.stage-tabs__name {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-inline-end: .5rem;
    color: var(--ui-primary-strong);
    font-weight: 800;
}

.stage-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .8rem;
    color: var(--ui-text);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--ui-bg);
    border-radius: 999px;
    transition: background var(--ui-transition);
}

.stage-tabs__item:hover { color: var(--ui-text); background: var(--ui-primary-soft); }
.stage-tabs__item i { color: var(--ui-primary); }
.stage-tabs__item.is-active { color: #fff; background: var(--ui-gradient-primary); }
.stage-tabs__item.is-active i { color: #fff; }
/* ---------- سطر البحث التلقائي فوق الجداول (site.js) ---------- */

.ui-auto-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 28rem;
    margin: .5rem 0;
    padding: .25rem .7rem;
    color: var(--ui-text-muted);
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
}

.ui-auto-search:focus-within {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px rgba(59, 91, 253, .12);
}

.ui-auto-search .form-control {
    flex: 1;
    min-width: 0;
    min-height: 2rem;
    padding: .1rem .2rem;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.ui-auto-search__count {
    font-size: .8rem;
    white-space: nowrap;
}

tr.is-search-hidden {
    display: none !important;
}

@media print {
    .ui-auto-search {
        display: none !important;
    }
}

/* ---------- «أسر مسجلة على البرنامج» تحت خانات البحث (site.js) ---------- */

.ui-family-hits {
    flex-basis: 100%;
    grid-column: 1 / -1;
    width: 100%;
    margin: .4rem 0 .6rem;
    padding: .6rem .7rem;
    background: #fff;
    border: 1px dashed var(--ui-border);
    border-radius: 14px;
}

.ui-family-hits[hidden] {
    display: none;
}

.ui-family-hits__title {
    margin-bottom: .45rem;
    font-size: .88rem;
    font-weight: 700;
    color: #b3203d;
}

.ui-family-hits__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: .4rem;
    max-height: 15rem;
    overflow-y: auto;
}

.ui-family-hits__item {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .45rem .6rem;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
}

.ui-family-hits__item > a {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    font-weight: 600;
    color: var(--ui-text);
    text-decoration: none;
}

.ui-family-hits__item:hover,
.ui-family-hits__item:focus-within {
    border-color: var(--ui-primary);
}

.ui-family-hits__item a:hover {
    color: var(--ui-primary-strong);
}

.ui-family-hits__show {
    align-self: flex-start;
    padding: .15rem .6rem;
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ui-primary-strong);
    background: var(--ui-primary-soft);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.ui-family-hits__members {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding-top: .3rem;
    font-size: .85rem;
    border-top: 1px dashed var(--ui-border);
}

.ui-family-hits__members[hidden] {
    display: none;
}

.ui-family-hits__members a {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .25rem .45rem;
    color: var(--ui-text);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
}

.ui-family-hits__members a small {
    color: var(--ui-primary-strong);
    white-space: nowrap;
}

.ui-family-hits__item small {
    font-size: .72rem;
    font-weight: 400;
    color: var(--ui-text-muted);
}

@media print {
    .ui-family-hits {
        display: none !important;
    }
}

/* اسم يوم الميلاد تحت خانة تاريخ الميلاد (site.js) */
.birth-day-hint { display: block; margin-top: .2rem; font-size: .78rem; font-weight: 700; color: #0f766e; }

/* على نسق صورة «سجل الأسر» (members-top__art): الشعار كبير على يسار رأس الصفحة بهالة ذهبية خفيفة، ويمتد فوق الرأس وتحته قليلًا */
.edu-top { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--ui-gap, 1rem); }
.edu-top:has(.edu-top__art) { grid-template-columns: minmax(0, 1fr) auto; }
.edu-top > header.edu-head { min-width: 0; }
.edu-top__art { position: relative; display: grid; place-items: center; width: clamp(150px, 13vw, 210px); margin: calc(var(--ui-gap, 1rem) * -.9) 0; }
.edu-top__art::before { content: ""; position: absolute; inset: -12% -4%; background: radial-gradient(circle, rgba(255, 214, 140, .45) 0%, rgba(155, 107, 255, .12) 45%, transparent 70%); border-radius: 50%; pointer-events: none; }
/* بلا إطار أبيض: القصّ دائريًا يزيل زوايا الخلفية البيضاء، و multiply يذيب أي بياض متبقٍّ في لون الصفحة */
.edu-top__art img { position: relative; width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; border-radius: 50%; mix-blend-mode: multiply; box-shadow: 0 10px 18px rgba(59, 91, 253, .22); }
@media (max-width: 991.98px) {
    .edu-top:has(.edu-top__art) { grid-template-columns: minmax(0, 1fr); }
    .edu-top__art { order: -1; width: 110px; margin: 0 auto; }
}
@media print { .edu-top__art { width: 24mm; margin: 0; } .edu-top:has(.edu-top__art) { grid-template-columns: minmax(0, 1fr) auto; } }

/* (2026-11-26) شعار «خدمة التربية الكنسية» في رأس صفحات مراحلها وفصولها (Partials/_ChurchEducationLogo) وصفحات حضور الفصول */
.ce-logo { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
@media (max-width: 575px) { .ce-logo { width: 48px; height: 48px; } }

/* «ضم» تحت رسالة تكرار الرقم القومي/التليفون أو الاسم: ربط السجل بملف موجود في البرنامج */
.id-check__merge { padding: .1rem .7rem; font-size: .78rem; margin-inline-start: .35rem; vertical-align: middle; }
.edu-dup__line { display: block; margin-top: .2rem; }
