/* =============================================================
   مختبر كاوزا — إضافات CSS لـ v1.3
   - بطاقات معايير EFQM
   - علم الحالة الحساسة
   - تكبير الشعار
   - رموز المساعدة (?)
   - عرض فئات الأسباب
   ============================================================= */

/* ===== بطاقات EFQM ===== */

.efqm-selector {
    margin-top: 0.5rem;
}

.efqm-axis-group {
    margin-bottom: 1.2rem;
}

.efqm-axis-group:last-child {
    margin-bottom: 0;
}

.efqm-axis-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--navy);
    font-weight: 700;
    margin-bottom: 0.6rem;
    padding: 0.25rem 0.7rem;
    background: linear-gradient(90deg, rgba(28,63,96,0.08) 0%, rgba(28,63,96,0) 100%);
    border-inline-start: 3px solid var(--gold);
    border-radius: 4px;
}

.efqm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.6rem;
}

.efqm-card {
    position: relative;
    display: block;
    padding: 0.75rem 0.85rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.efqm-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.efqm-card:hover {
    border-color: var(--gold);
    background: #FFFCF5;
}

.efqm-card:has(input:checked) {
    border-color: var(--gold);
    background: #FEFAE8;
    box-shadow: 0 1px 4px rgba(193, 148, 71, 0.25);
}

.efqm-card .efqm-code {
    display: inline-block;
    background: var(--navy);
    color: var(--white);
    font-size: 0.68rem;
    padding: 0.12rem 0.45rem;
    border-radius: 99px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.efqm-card:has(input:checked) .efqm-code {
    background: var(--gold);
    color: var(--navy);
}

.efqm-card .efqm-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.efqm-card .efqm-desc {
    font-size: 0.74rem;
    color: var(--muted);
    line-height: 1.45;
}

/* ===== شارات فئات الأسباب v2 ===== */

.cause-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid currentColor;
    background: transparent;
}

.cause-category-badge i {
    font-size: 0.85rem;
}

/* ===== علم الحالة الحساسة (إصلاح للأيقونة الغامضة) ===== */

.case-sensitive-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: #FEE2E2;
    color: #991B1B;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-inline-start: 0.4rem;
    vertical-align: middle;
}

.case-sensitive-badge i {
    font-size: 0.78rem;
}

/* ===== تكبير الشعار في الهيدر (نسبة 30%) ===== */

.navbar-brand .brand-logo {
    width: 52px !important;   /* كان 40 */
    height: 52px !important;
}

.navbar-brand .brand-text .brand-name {
    font-size: 1.4rem !important;   /* كان 1.1 */
}

.navbar-brand .brand-text .brand-en {
    font-size: 0.72rem !important;
}

/* "مدائن" داخل منطقة الشعار */
.navbar-brand .brand-madayn-inline {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 0.7rem;
    padding-inline-start: 0.7rem;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--gold-light);
    font-weight: 700;
    font-size: 1.05rem;
}

/* إخفاء "مدائن" المنفصلة القديمة (لو ظلّت في القالب) */
.navbar-brand > .brand-madayn:not(.brand-madayn-inline) {
    display: none !important;
}

/* ===== تكبير شعار صفحة الدخول (50%) ===== */

.login-card .login-logo {
    width: 96px !important;   /* كان ~64 */
    height: 96px !important;
}

.login-card h1 {
    font-size: 1.65rem !important;
}

/* ===== رموز المساعدة (?) ===== */

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: none;
    border: 1px solid var(--muted);
    color: var(--muted);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    margin-inline-start: 0.3rem;
    vertical-align: middle;
    transition: all 0.15s;
}

.help-icon:hover {
    border-color: var(--navy);
    color: var(--navy);
    background: var(--lighter);
}

.help-icon-small {
    width: 14px;
    height: 14px;
    font-size: 0.6rem;
    border-color: var(--muted);
    color: var(--muted);
    background: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    margin-inline-start: 0.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* نافذة المساعدة المنبثقة */
.help-popover {
    position: absolute;
    z-index: 9999;
    max-width: 380px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 1rem 1.1rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--ink);
}

.help-popover .help-popover-title {
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.help-popover .help-popover-close {
    margin-inline-start: auto;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem;
    line-height: 1;
}

.help-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0,0,0,0.05);
}

/* ===== مساحة الفئة الجديدة في نموذج إضافة سبب ===== */

.cause-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.55rem;
    margin-top: 0.4rem;
}

.cause-category-card {
    position: relative;
    display: block;
    padding: 0.6rem 0.7rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: start;
}

.cause-category-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cause-category-card:hover {
    border-color: var(--gold);
}

.cause-category-card:has(input:checked) {
    border-color: var(--gold);
    background: #FFFBEB;
}

.cause-category-card .ccat-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cause-category-card .ccat-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.95rem;
}

.cause-category-card .ccat-code {
    font-size: 0.65rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.cause-category-card .ccat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
}

/* ===== شريط تنبيه الثقة بدون أدلة ===== */

.confidence-mismatch-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 4px;
    font-size: 0.72rem;
    border: 1px solid #F59E0B;
}
