/* ============================================================
   Jadawel UI — سمة فاتحة مبنية على نموذج «المراحل والمواد»
   slate-50 خلفية · بطاقات بيضاء rounded-2xl · بلاطات أيقونات ناعمة
   خط Noto Kufi Arabic · لمسات نيلية (brand)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@300;400;500;600;700;800&display=swap');

:root {
    --ju-bg:     #F8FAFC;  /* slate-50 */
    --ju-card:   #FFFFFF;
    --ju-border: #E2E8F0;  /* slate-200 */
    --ju-text:   #1E293B;  /* slate-800 */
    --ju-mute:   #64748B;  /* slate-500 */
    --ju-brand:  #4F46E5;  /* indigo-600 */
    --ju-brand-2:#6366F1;
    --ju-brand-3:#818CF8;
    --ju-brand-50:#EEF2FF;
}

/* ── الأساس ── */
html { color-scheme: light; }
body, .fi-body {
    background: var(--ju-bg) !important;
    font-family: 'Noto Kufi Arabic', system-ui, sans-serif !important;
    color: var(--ju-text);
}
.fi-header-heading { font-weight: 800 !important; color: #0F172A !important; }
.fi-header-subheading { color: var(--ju-mute) !important; }
::selection { background: rgba(99,102,241,.25); }
* { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── السايدبار أبيض نظيف كالنموذج ── */
.fi-sidebar { background: #FFFFFF !important; border-inline-end: 1px solid var(--ju-border) !important; }
.fi-sidebar-group-label { color: #94A3B8 !important; font-size: .68rem !important; font-weight: 700; }
.fi-sidebar-item { border-radius: .75rem !important; color: #475569 !important; }
.fi-sidebar-item:hover { background: #F1F5F9 !important; color: #0F172A !important; }
.fi-sidebar-item-active, .fi-sidebar-item[aria-current="page"] {
    background: var(--ju-brand-50) !important; color: var(--ju-brand) !important; font-weight: 700;
}
.fi-sidebar-item-active .fi-sidebar-item-icon { color: var(--ju-brand) !important; }

/* ── التوب بار ── */
.fi-topbar { background: rgba(248,250,252,0.9) !important; backdrop-filter: blur(10px); border-bottom: 1px solid var(--ju-border) !important; }
.fi-topbar .fi-global-search-field input {
    border-radius: 9999px !important; background: #fff !important;
    border: 1px solid var(--ju-border) !important;
}
.fi-topbar .fi-global-search-field input:focus { border-color: var(--ju-brand-3) !important; box-shadow: 0 0 0 4px rgba(99,102,241,.12) !important; }

/* ── بطاقات ورقائق Filament ── */
.fi-card, .fi-section, .fi-wi-stat {
    background: #fff !important; border: 1px solid var(--ju-border) !important;
    border-radius: 1rem !important; box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
}
.fi-btn { border-radius: .75rem !important; font-weight: 700; }
.fi-btn-color-primary {
    background: linear-gradient(135deg,#4F46E5,#6366F1) !important; border: none !important;
    box-shadow: 0 4px 12px rgba(79,70,229,.25) !important;
}
.fi-badge { border-radius: 9999px !important; font-weight: 700 !important; }
.fi-input, .fi-select, .fi-textarea, .fi-fo-input, .fi-fo-select, .fi-fo-textarea {
    border-radius: .75rem !important; border-color: var(--ju-border) !important;
}
.fi-input:focus, .fi-fo-input:focus { border-color: var(--ju-brand-3) !important; box-shadow: 0 0 0 4px rgba(99,102,241,.12) !important; }
.fi-ta-table thead th { color: var(--ju-mute) !important; font-weight: 700 !important; }

/* ── شريط الخطوات (mockup steps) ── */
.ju-steps { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ju-step {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .45rem .85rem; border-radius: .8rem; font-size: .75rem; font-weight: 600;
    color: #64748B; background: #fff; border: 1px solid var(--ju-border);
    text-decoration: none; transition: all .15s;
}
.ju-step:hover { border-color: var(--ju-brand-3); color: var(--ju-brand); background: var(--ju-brand-50); }
.ju-step .n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.35rem; height: 1.35rem; border-radius: 9999px;
    background: #F1F5F9; color: #64748B; font-size: .68rem; font-weight: 800;
}
.ju-step.is-active { background: var(--ju-brand-50); border-color: #C7D2FE; color: #4338CA; }
.ju-step.is-active .n { background: var(--ju-brand); color: #fff; }
.ju-arrow { color: #CBD5E1; font-size: .8rem; }

/* ── بطاقة إحصاء النموذج ── */
.ju-stat {
    background: #fff; border: 1px solid var(--ju-border); border-radius: 1rem;
    padding: 1rem; box-shadow: 0 1px 2px rgba(15,23,42,.04);
    transition: box-shadow .15s, transform .15s;
}
.ju-stat:hover { box-shadow: 0 8px 20px rgba(15,23,42,.08); transform: translateY(-1px); }
.ju-stat .tile {
    width: 2.5rem; height: 2.5rem; border-radius: .8rem;
    display: flex; align-items: center; justify-content: center;
}
.ju-stat .num { font-size: 1.4rem; font-weight: 800; color: #1E293B; line-height: 1.2; }
.ju-stat .lbl { font-size: .7rem; color: #64748B; margin-top: .1rem; }

/* ── رأس لوحة النموذج ── */
.ju-panel { background: #fff; border: 1px solid var(--ju-border); border-radius: 1rem; overflow: hidden; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.ju-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1rem; border-bottom: 1px solid var(--ju-border); background: #fff;
}
.ju-panel-title { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: #1E293B; font-size: .875rem; }
.ju-panel-title .tile {
    width: 1.9rem; height: 1.9rem; border-radius: .6rem; background: var(--ju-brand-50);
    display: flex; align-items: center; justify-content: center; color: var(--ju-brand);
}
.ju-btn-soft {
    display: inline-flex; align-items: center; gap: .3rem; border: none; cursor: pointer;
    font-size: .72rem; font-weight: 700; padding: .35rem .7rem; border-radius: .6rem;
    color: var(--ju-brand); background: var(--ju-brand-50); transition: background .15s;
}
.ju-btn-soft:hover { background: #E0E7FF; }
.ju-btn-danger-soft {
    display: inline-flex; align-items: center; gap: .3rem; border: none; cursor: pointer;
    font-size: .72rem; font-weight: 700; padding: .35rem .7rem; border-radius: .6rem;
    color: #EF4444; background: transparent; transition: background .15s;
}
.ju-btn-danger-soft:hover { background: #FEF2F2; }
.ju-count-pill {
    border-radius: 9999px; background: #F1F5F9; color: #64748B;
    padding: .12rem .6rem; font-size: .68rem; font-weight: 800;
}
.ju-search {
    width: 100%; border-radius: .8rem !important; border: 1px solid var(--ju-border) !important;
    font-size: .8rem; background: #fff !important; padding: .55rem .8rem;
}
.ju-search:focus { outline: none; border-color: var(--ju-brand-3) !important; box-shadow: 0 0 0 4px rgba(99,102,241,.12); }

/* ── حالة فراغ النموذج ── */
.ju-empty { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 2.5rem 1rem; text-align: center; }
.ju-empty .t { font-weight: 800; color: #475569; font-size: .85rem; }
.ju-empty .d { color: #94A3B8; font-size: .72rem; }

/* ── بطاقة تقدم الإعداد (سايدبار) ── */
.ju-progress-card {
    margin: .75rem; padding: .8rem; border-radius: .9rem;
    background: var(--ju-brand-50); border: 1px solid #C7D2FE;
}
.ju-progress-card .t { display: flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 800; color: #4338CA; margin-bottom: .5rem; }
.ju-progress-track { width: 100%; height: .35rem; background: #C7D2FE; border-radius: 9999px; overflow: hidden; margin-bottom: .3rem; }
.ju-progress-fill { height: 100%; background: linear-gradient(90deg,#6366F1,#4F46E5); border-radius: 9999px; transition: width .5s; }
.ju-progress-card .x { font-size: .65rem; color: #6366F1; font-weight: 700; }

/* ── ظهور متدرج للبطاقات (نمط النموذج fadeInUp stagger) ── */
@keyframes ju-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ju-fade { animation: ju-fade-up .4s ease-out both; }

/* ── بطاقة المعالج الذكي (النيلية المتدرجة كالنموذج) ── */
.ju-wizard {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin: 0.875rem 0; padding: 1.1rem 1.25rem;
    background: linear-gradient(135deg,#4F46E5 0%,#6366F1 50%,#818CF8 100%);
    border-radius: 1rem; box-shadow: 0 10px 28px rgba(79,70,229,.35);
    color: #fff;
}
.ju-wizard-text { display: flex; align-items: center; gap: .9rem; }
.ju-wizard-icon {
    width: 3rem; height: 3rem; border-radius: .9rem; flex-shrink: 0;
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
}
.ju-wizard h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 .25rem; }
.ju-wizard p { font-size: .8rem; color: rgba(255,255,255,.8); margin: 0; line-height: 1.6; }
.ju-wizard-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.ju-wizard-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .6rem 1rem; border-radius: .8rem; cursor: pointer;
    background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3);
    font-size: .8rem; font-weight: 700; backdrop-filter: blur(4px); transition: background .15s;
}
.ju-wizard-btn:hover { background: rgba(255,255,255,.25); }
.ju-wizard-btn-go { background: #fff; color: #4F46E5; border-color: #fff; box-shadow: 0 4px 12px rgba(2,6,23,.2); }
.ju-wizard-btn-go:hover { background: #EEF2FF; }

/* ── شريط البحث الموحد + رقائق الفلترة ── */
.ju-toolbar {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    margin-bottom: 0.875rem;
}
.ju-toolbar-search {
    flex: 1; min-width: 220px; position: relative;
    display: flex; align-items: center; gap: .5rem;
    background: #fff; border: 1px solid var(--ju-border); border-radius: .8rem;
    padding: .55rem .85rem;
}
.ju-toolbar-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-family: inherit; font-size: .8rem; color: #1E293B;
}
.ju-toolbar-search input::placeholder { color: #94A3B8; }
.ju-toolbar-chips { display: flex; align-items: center; gap: .4rem; }
.ju-chip {
    padding: .5rem .95rem; border-radius: .8rem; cursor: pointer;
    font-family: inherit; font-size: .75rem; font-weight: 700;
    background: #fff; color: #64748B; border: 1px solid var(--ju-border);
    transition: all .15s;
}
.ju-chip:hover { border-color: #C7D2FE; color: #4F46E5; }
.ju-chip.is-on {
    background: var(--ju-brand-50); color: #4338CA; border-color: #C7D2FE;
}
