/* تمكين - الهوية البصرية الأساسية */
:root {
    --primary: #315f68;
    --primary-dark: #244a51;
    --primary-soft: #e7f0f1;
    --accent: #c9a86a;
    --accent-soft: #f7f0e3;
    --page-bg: #f4f7f8;
    --card-bg: #ffffff;
    --text: #263238;
    --muted: #78858b;
    --success: #3d8b6d;
    --warning: #d59b3d;
    --danger: #c65b5b;
    --info: #4f83a3;
    --border: #e2e8ea;
    --sidebar-width: 286px;
    --sidebar-collapsed: 88px;
    --shadow-sm: 0 8px 24px rgba(36, 74, 81, .07);
    --shadow-md: 0 16px 42px rgba(36, 74, 81, .11);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Cairo', system-ui, sans-serif;
    color: var(--text);
    background: var(--page-bg);
    font-size: 14px;
}
a { text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #315f68 0%, #274f57 54%, #203f46 100%);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width .25s ease, transform .25s ease;
    box-shadow: -8px 0 32px rgba(27, 58, 64, .13);
}
.brand-wrap {
    height: 82px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-link { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; flex: 1; }
.brand-link:hover { color: #fff; }
.brand-mark {
    width: 48px; height: 48px; border-radius: 15px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.14);
    color: #f2d79e; font-size: 22px; flex: 0 0 auto;
}
.brand-mark.has-logo { background: #fff; padding: 4px; overflow: hidden; border-color: rgba(255,255,255,.35); }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 10px; }
.login-brand .brand-mark.has-logo { background: #fff; border-color: rgba(255,255,255,.45); }

.brand-text { display: flex; flex-direction: column; line-height: 1.35; white-space: nowrap; overflow: hidden; }
.brand-text strong { font-size: 20px; font-weight: 800; }
.brand-text small { color: rgba(255,255,255,.7); font-size: 11px; }
.sidebar-collapse {
    width: 34px; height: 34px; border: 0; border-radius: 10px;
    align-items: center; justify-content: center; color: #fff;
    background: rgba(255,255,255,.1);
}
.sidebar-user {
    margin: 18px 15px 10px;
    padding: 14px;
    display: flex; align-items: center; gap: 11px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
}
.avatar {
    width: 43px; height: 43px; border-radius: 14px;
    display: grid; place-items: center;
    background: var(--accent); color: #fff; font-weight: 800; font-size: 17px;
    flex: 0 0 auto;
}
.sidebar-user-info { min-width: 0; display: flex; flex-direction: column; white-space: nowrap; overflow: hidden; }
.sidebar-user-info strong { font-size: 13px; text-overflow: ellipsis; overflow: hidden; }
.sidebar-user-info small { color: rgba(255,255,255,.62); font-size: 10px; }
.sidebar-nav { padding: 6px 12px 18px; overflow-y: auto; scrollbar-width: thin; flex: 1; }
.menu-label { color: rgba(255,255,255,.42); font-size: 10px; font-weight: 700; padding: 16px 12px 7px; letter-spacing: .2px; }
.nav-item {
    width: 100%; min-height: 44px; border: 0; color: rgba(255,255,255,.79);
    background: transparent; border-radius: 12px; padding: 10px 12px;
    display: flex; align-items: center; gap: 12px; margin: 3px 0; text-align: right;
    transition: .18s ease;
}
.nav-item i:first-child { width: 22px; text-align: center; font-size: 15px; color: #c9dedf; flex: 0 0 auto; }
.nav-item span { flex: 1; white-space: nowrap; overflow: hidden; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-item.active { box-shadow: inset -3px 0 0 var(--accent); }
.nav-toggle .toggle-arrow { font-size: 10px; transition: transform .2s ease; }
.nav-toggle[aria-expanded="true"] .toggle-arrow { transform: rotate(180deg); }
.submenu { margin: 2px 38px 8px 0; border-right: 1px solid rgba(255,255,255,.14); padding-right: 12px; }
.submenu a { display: block; color: rgba(255,255,255,.64); padding: 8px 10px; border-radius: 9px; font-size: 12px; }
.submenu a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-footer { padding: 15px 22px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; color: rgba(255,255,255,.45); font-size: 10px; }

.app-main { margin-right: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-right .25s ease; }
.topbar {
    height: 82px; padding: 0 30px; background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1020; backdrop-filter: blur(12px);
}
.page-heading h1 { font-size: 19px; font-weight: 800; margin: 0 0 5px; }
.breadcrumb-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.breadcrumb-line .dot { width: 4px; height: 4px; background: #bdc8cb; border-radius: 50%; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.quick-search { width: 285px; height: 42px; align-items: center; gap: 10px; padding: 0 14px; background: #f5f8f9; border: 1px solid var(--border); border-radius: 13px; }
.quick-search i { color: #94a2a7; }
.quick-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12px; }
.topbar-btn { width: 42px; height: 42px; border: 1px solid var(--border); background: #fff; border-radius: 13px; display: grid; place-items: center; color: var(--primary); position: relative; }
.notification-dot { width: 7px; height: 7px; border: 2px solid #fff; background: var(--danger); border-radius: 50%; position: absolute; top: 9px; right: 9px; }
.profile-btn { border: 0; background: transparent; display: flex; align-items: center; gap: 9px; padding: 3px 6px 3px 9px; }
.profile-btn::after { color: var(--muted); }
.small-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 14px; }
.profile-copy { text-align: right; line-height: 1.35; }
.profile-copy strong { display: block; font-size: 11px; }
.profile-copy small { display: block; font-size: 9px; color: var(--muted); }

.app-content { padding: 28px 30px 36px; flex: 1; }
.welcome-card {
    background: linear-gradient(115deg, var(--primary) 0%, #3b717b 64%, #4a7d84 100%);
    border-radius: 22px; padding: 27px 30px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-md);
}
.welcome-card::before, .welcome-card::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); }
.welcome-card::before { width: 250px; height: 250px; left: -80px; top: -130px; }
.welcome-card::after { width: 160px; height: 160px; left: 110px; bottom: -125px; }
.welcome-copy { position: relative; z-index: 1; }
.welcome-copy h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.welcome-copy p { margin: 0; color: rgba(255,255,255,.74); font-size: 12px; max-width: 650px; line-height: 1.9; }
.welcome-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.btn-soft-light { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; font-size: 11px; padding: 9px 13px; }
.btn-soft-light:hover { background: #fff; color: var(--primary); }

.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px; padding: 19px; box-shadow: var(--shadow-sm); height: 100%; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; width: 82px; height: 82px; border-radius: 50%; left: -34px; top: -38px; background: var(--soft, var(--primary-soft)); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; z-index: 1; }
.stat-icon { width: 45px; height: 45px; border-radius: 14px; display: grid; place-items: center; background: var(--soft, var(--primary-soft)); color: var(--tone, var(--primary)); font-size: 17px; }
.stat-trend { font-size: 9px; color: var(--success); background: #edf8f3; border-radius: 20px; padding: 4px 8px; }
.stat-label { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.stat-number { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat-caption { font-size: 9px; color: #9aa6aa; margin-top: 6px; }
.tone-blue { --tone: #4f83a3; --soft: #eaf2f7; }
.tone-green { --tone: #3d8b6d; --soft: #eaf5f0; }
.tone-gold { --tone: #b68a3f; --soft: #f8f1e5; }
.tone-purple { --tone: #7a6d9d; --soft: #f0edf6; }

.panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: 19px; box-shadow: var(--shadow-sm); height: 100%; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 19px 21px; border-bottom: 1px solid #edf1f2; }
.panel-title { margin: 0; font-size: 14px; font-weight: 800; }
.panel-subtitle { color: var(--muted); font-size: 9px; margin-top: 3px; }
.panel-body { padding: 20px 21px; }
.link-more { color: var(--primary); font-size: 10px; font-weight: 700; }
.school-type-row { display: grid; grid-template-columns: minmax(120px,1fr) 2.3fr 40px; gap: 11px; align-items: center; margin-bottom: 17px; }
.school-type-label { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.type-dot { width: 9px; height: 9px; border-radius: 4px; background: var(--dot, var(--primary)); }
.progress-soft { height: 8px; background: #edf2f3; border-radius: 20px; overflow: hidden; }
.progress-soft span { display: block; height: 100%; border-radius: inherit; background: var(--dot, var(--primary)); }
.school-type-count { text-align: left; font-weight: 800; font-size: 11px; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-action { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 10px; color: var(--text); transition: .18s ease; }
.quick-action:hover { transform: translateY(-2px); border-color: #c7d6d9; box-shadow: var(--shadow-sm); color: var(--primary); }
.quick-action i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.quick-action strong { display: block; font-size: 10px; }
.quick-action small { display: block; font-size: 8px; color: var(--muted); margin-top: 2px; }

.activity-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 35px; height: 35px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.activity-copy strong { font-size: 10px; display: block; }
.activity-copy p { font-size: 9px; color: var(--muted); margin: 3px 0; }
.activity-copy time { font-size: 8px; color: #a5afb2; }

.data-table { font-size: 11px; }
.data-table thead th { color: var(--muted); background: #f7f9fa; border-bottom: 1px solid var(--border); font-weight: 700; padding: 12px; white-space: nowrap; }
.data-table tbody td { padding: 12px; vertical-align: middle; border-color: #edf1f2; }
.badge-soft { border-radius: 20px; padding: 5px 9px; font-size: 9px; font-weight: 700; }
.badge-soft.success { background: #eaf6f0; color: var(--success); }
.badge-soft.warning { background: #fbf3e6; color: #a87520; }
.badge-soft.info { background: #ebf3f7; color: var(--info); }
.btn-icon { width: 32px; height: 32px; border: 1px solid var(--border); background: #fff; border-radius: 10px; color: var(--primary); display: inline-grid; place-items: center; }

.app-footer { padding: 14px 30px; border-top: 1px solid var(--border); background: #fff; display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); }

/* حالة طي القائمة */
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.app-shell.sidebar-collapsed .app-main { margin-right: var(--sidebar-collapsed); }
.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .sidebar-user-info,
.app-shell.sidebar-collapsed .nav-item span,
.app-shell.sidebar-collapsed .toggle-arrow,
.app-shell.sidebar-collapsed .menu-label,
.app-shell.sidebar-collapsed .submenu,
.app-shell.sidebar-collapsed .sidebar-footer small { display: none !important; }
.app-shell.sidebar-collapsed .brand-wrap { padding: 0 14px; }
.app-shell.sidebar-collapsed .brand-link { justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-collapse { position: absolute; left: -16px; background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.app-shell.sidebar-collapsed .sidebar-collapse i { transform: rotate(180deg); }
.app-shell.sidebar-collapsed .sidebar-user { justify-content: center; margin-inline: 10px; padding: 10px; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 8px; }
.app-shell.sidebar-collapsed .nav-item i:first-child { width: auto; }
.app-shell.sidebar-collapsed .sidebar-footer { justify-content: center; padding-inline: 6px; }

/* صفحة الدخول */
.login-page { min-height: 100vh; background: #eef3f4; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-page::before, .login-page::after { content: ''; position: fixed; border-radius: 50%; filter: blur(1px); }
.login-page::before { width: 450px; height: 450px; background: rgba(49,95,104,.08); right: -170px; top: -170px; }
.login-page::after { width: 330px; height: 330px; background: rgba(201,168,106,.12); left: -130px; bottom: -150px; }
.login-card { width: min(1040px, 100%); min-height: 610px; background: #fff; border-radius: 28px; box-shadow: 0 26px 80px rgba(36,74,81,.15); overflow: hidden; display: grid; grid-template-columns: 1.05fr .95fr; position: relative; z-index: 1; }
.login-visual { background: linear-gradient(145deg, #315f68 0%, #23474e 100%); color: #fff; padding: 50px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-visual::before { content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,.06); left: -130px; top: -90px; }
.login-visual::after { content: ''; position: absolute; width: 210px; height: 210px; border-radius: 50%; border: 38px solid rgba(201,168,106,.09); right: -60px; bottom: -50px; }
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-brand .brand-mark { background: rgba(255,255,255,.12); }
.login-brand h1 { margin: 0; font-size: 26px; font-weight: 800; }
.login-brand p { margin: 2px 0 0; color: rgba(255,255,255,.65); font-size: 11px; }
.login-visual-copy { position: relative; z-index: 1; }
.login-visual-copy h2 { font-size: 28px; font-weight: 800; line-height: 1.65; margin-bottom: 16px; }
.login-visual-copy p { color: rgba(255,255,255,.65); font-size: 12px; line-height: 2; max-width: 430px; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.feature-pill { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); border-radius: 20px; padding: 8px 11px; font-size: 9px; }
.login-visual-footer { position: relative; z-index: 1; font-size: 9px; color: rgba(255,255,255,.4); }
.login-form-wrap { padding: 65px 65px 50px; display: flex; flex-direction: column; justify-content: center; }
.login-form-head { margin-bottom: 30px; }
.login-form-head span { color: var(--accent); font-weight: 800; font-size: 11px; }
.login-form-head h2 { font-size: 25px; font-weight: 800; margin: 7px 0 8px; }
.login-form-head p { color: var(--muted); font-size: 11px; }
.form-label { font-size: 10px; font-weight: 700; color: #46565b; margin-bottom: 7px; }
.form-control-custom { height: 49px; border: 1px solid var(--border); border-radius: 13px; display: flex; align-items: center; padding: 0 14px; gap: 10px; transition: .18s ease; }
.form-control-custom:focus-within { border-color: #8eafb5; box-shadow: 0 0 0 4px rgba(49,95,104,.07); }
.form-control-custom i { color: #91a1a6; }
.form-control-custom input { border: 0; outline: 0; width: 100%; font-size: 12px; }
.password-toggle { border: 0; background: transparent; color: var(--muted); }
.login-submit { height: 50px; border: 0; border-radius: 13px; background: var(--primary); color: #fff; font-weight: 700; font-size: 12px; box-shadow: 0 12px 24px rgba(49,95,104,.2); }
.login-submit:hover { background: var(--primary-dark); }
.demo-note { margin-top: 20px; padding: 12px 14px; border-radius: 13px; background: #f7f9fa; color: var(--muted); font-size: 9px; line-height: 1.8; }
.error-box { background: #fff0f0; color: #a54444; border: 1px solid #f2d5d5; border-radius: 12px; padding: 10px 12px; font-size: 10px; margin-bottom: 16px; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(105%); width: min(290px, 88vw); }
    .sidebar.mobile-open { transform: translateX(0); }
    .app-main { margin-right: 0 !important; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(14,32,36,.42); z-index: 1035; }
    .sidebar-backdrop.show { display: block; }
    .topbar { padding-inline: 18px; }
    .app-content { padding: 20px 18px 30px; }
    .login-card { grid-template-columns: 1fr; max-width: 560px; }
    .login-visual { display: none; }
}
@media (max-width: 575.98px) {
    .topbar { height: 72px; }
    .page-heading h1 { font-size: 15px; }
    .breadcrumb-line { display: none; }
    .app-content { padding-inline: 13px; }
    .welcome-card { padding: 22px; }
    .welcome-copy h2 { font-size: 18px; }
    .quick-actions-grid { grid-template-columns: 1fr; }
    .app-footer { padding-inline: 15px; flex-direction: column; gap: 5px; text-align: center; }
    .login-page { padding: 12px; }
    .login-card { min-height: auto; border-radius: 20px; }
    .login-form-wrap { padding: 42px 25px; }
}

/* V1.1 - وحدة المدارس */
.action-btn { border-radius: 11px; font-size: 10px; font-weight: 700; padding: 8px 12px; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); }
.form-control, .form-select { border-color: var(--border); border-radius: 11px; font-size: 11px; min-height: 42px; }
.form-control:focus, .form-select:focus { border-color: #8eafb5; box-shadow: 0 0 0 4px rgba(49,95,104,.07); }
textarea.form-control { min-height: auto; }
.required::after { content: ' *'; color: var(--danger); }
.filter-grid { display: grid; grid-template-columns: minmax(230px,1.5fr) repeat(4,minmax(145px,1fr)) auto; gap: 12px; align-items: end; }
.filter-search { min-width: 0; }
.input-icon-wrap { position: relative; }
.input-icon-wrap i { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: #95a3a8; }
.input-icon-wrap input { padding-right: 38px; }
.filter-actions { display: flex; gap: 7px; padding-bottom: 1px; }
.school-name-cell { display: flex; align-items: center; gap: 10px; min-width: 245px; }
.school-name-cell strong { display: block; color: var(--text); font-size: 11px; }
.school-name-cell small { display: block; color: var(--muted); font-size: 8px; margin-top: 3px; }
.school-logo-mini { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: var(--school-color); background: color-mix(in srgb, var(--school-color) 13%, white); flex: 0 0 auto; }
.type-badge { display: inline-flex; border-radius: 18px; padding: 5px 9px; font-size: 9px; font-weight: 700; color: var(--school-color); background: color-mix(in srgb, var(--school-color) 11%, white); }
.type-badge.light { background: rgba(255,255,255,.17); color: #fff; }
.completion-cell { min-width: 95px; }
.completion-cell > span { font-size: 9px; color: var(--muted); }
.completion-cell .progress-soft { margin-top: 5px; height: 5px; }
.panel-footer-list { display: flex; justify-content: space-between; align-items: center; padding: 13px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.pagination .page-link { color: var(--primary); border-color: var(--border); font-size: 9px; }
.pagination .active .page-link { background: var(--primary); border-color: var(--primary); }
.empty-state { padding: 45px 15px; text-align: center; }
.empty-state i { font-size: 35px; color: #bdc9cc; }
.empty-state h4 { font-size: 14px; font-weight: 800; margin: 13px 0 5px; }
.empty-state p { color: var(--muted); font-size: 10px; margin: 0; }
.page-actions-bar { display: flex; justify-content: space-between; align-items: center; }
.page-actions-bar h2 { font-size: 18px; font-weight: 800; margin: 8px 0 5px; }
.page-actions-bar p { font-size: 10px; color: var(--muted); margin: 0; }
.back-link { font-size: 10px; color: var(--primary); font-weight: 700; }
.section-number { width: 33px; height: 33px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 10px; }
.form-errors { font-size: 10px; border-radius: 13px; }
.form-side-panel { top: 98px; z-index: 5; }
.switch-card { min-height: 42px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fafcfc; }
.switch-card label { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-size: 11px; }
.switch-card input { accent-color: var(--primary); width: 17px; height: 17px; }
.switch-card strong, .switch-card small { display: block; }
.switch-card small { font-size: 8px; color: var(--muted); margin-top: 2px; }
.checklist-grid { display: grid; gap: 8px; }
.check-card { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 11px; padding: 9px 10px; cursor: pointer; }
.check-card:has(input:checked) { border-color: #9bb8bd; background: var(--primary-soft); }
.check-card input { accent-color: var(--primary); }
.check-card strong, .check-card small { display: block; font-size: 9px; }
.check-card small { color: var(--muted); margin-top: 2px; font-size: 8px; }
.stage-settings-list { display: grid; gap: 10px; }
.stage-setting { border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.stage-check { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; }
.stage-check input { accent-color: var(--primary); }
.form-table th { background: #f7f9fa; color: var(--muted); font-size: 9px; white-space: nowrap; }
.form-table td { padding: 7px; border-color: var(--border); }
.form-table .form-control, .form-table .form-select { min-height: 38px; font-size: 10px; }
.school-profile-hero { padding: 25px; border-radius: 21px; background: linear-gradient(115deg,var(--school-color),color-mix(in srgb,var(--school-color) 74%,#173e45)); color:#fff; display:flex; justify-content:space-between; align-items:center; gap:18px; box-shadow:var(--shadow-md); }
.school-profile-main { display:flex; align-items:center; gap:15px; }
.school-profile-icon { width:68px; height:68px; border-radius:20px; display:grid; place-items:center; background:rgba(255,255,255,.16); font-size:27px; }
.school-profile-hero h2 { margin:0 0 5px; font-size:21px; font-weight:800; }
.school-profile-hero p { margin:0; color:rgba(255,255,255,.72); font-size:10px; }
.school-profile-actions { display:flex; flex-wrap:wrap; gap:8px; }
.profile-kpi { background:#fff; border:1px solid var(--border); border-radius:16px; padding:16px; display:flex; align-items:center; gap:12px; box-shadow:var(--shadow-sm); }
.profile-kpi i { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); }
.profile-kpi strong { display:block; font-size:19px; font-weight:800; }
.profile-kpi span { display:block; color:var(--muted); font-size:9px; }
.info-grid { display:grid; grid-template-columns:repeat(2,1fr); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.info-item { padding:13px 15px; border-left:1px solid var(--border); border-bottom:1px solid var(--border); }
.info-item.full { grid-column:1/-1; }
.info-item span { display:block; color:var(--muted); font-size:8px; margin-bottom:4px; }
.info-item strong { font-size:10px; line-height:1.8; }
.building-summary { display:grid; grid-template-columns:repeat(2,1fr); gap:9px; }
.building-summary div { padding:11px; border-radius:11px; background:#f7f9fa; }
.building-summary span,.building-summary strong { display:block; }
.building-summary span { font-size:8px; color:var(--muted); }
.building-summary strong { font-size:10px; margin-top:4px; }
.tag-list { display:flex; flex-wrap:wrap; gap:7px; }
.service-tag { padding:7px 10px; border-radius:20px; background:var(--primary-soft); color:var(--primary); font-size:9px; font-weight:700; }
@media(max-width:1399.98px){.filter-grid{grid-template-columns:repeat(3,1fr)}.filter-actions{grid-column:span 1}.form-side-panel{position:static!important}}
@media(max-width:767.98px){.filter-grid{grid-template-columns:1fr}.filter-actions{grid-column:auto}.panel-footer-list,.school-profile-hero{align-items:flex-start;flex-direction:column}.school-profile-main{align-items:flex-start}.school-profile-icon{width:52px;height:52px}.info-grid{grid-template-columns:1fr}.info-item.full{grid-column:auto}.building-summary{grid-template-columns:1fr}.school-profile-actions{width:100%}.school-profile-actions .btn{flex:1}}

/* تمكين V1.2 - وحدة الطلاب */
.page-heading { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.page-heading h2 { font-size:21px; font-weight:800; margin:2px 0 5px; }
.page-heading p { margin:0; color:var(--muted); font-size:10px; }
.eyebrow { color:var(--primary); font-size:9px; font-weight:800; background:var(--primary-soft); padding:5px 9px; border-radius:20px; }
.student-filter-grid { grid-template-columns:minmax(220px,1.5fr) repeat(6,minmax(130px,1fr)) auto; }
.student-avatar-mini { width:38px; height:38px; border-radius:12px; display:grid; place-items:center; background:#dcecee; color:var(--primary); font-weight:800; flex:0 0 auto; }
.student-avatar-mini.female { background:#f3e7ef; color:#8b5878; }
.student-profile-hero { padding:25px; border-radius:21px; background:linear-gradient(115deg,#315f68,#244a51); color:#fff; display:flex; justify-content:space-between; align-items:center; gap:18px; box-shadow:var(--shadow-md); }
.student-profile-hero h2 { margin:0 0 5px; font-size:21px; font-weight:800; }
.student-profile-hero p { margin:0; color:rgba(255,255,255,.72); font-size:10px; }
.student-profile-avatar { width:70px; height:70px; border-radius:22px; display:grid; place-items:center; background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.18); font-size:27px; font-weight:800; }
.student-profile-avatar.female { background:rgba(255,230,244,.18); }
.primary-service-tag { background:var(--primary); color:#fff; }
.small-kpi-value { font-size:12px!important; line-height:1.5; }
.student-list-table td { vertical-align:middle; }
.student-list-table .service-tag { white-space:nowrap; }
@media(max-width:1599.98px){.student-filter-grid{grid-template-columns:repeat(4,1fr)}.student-filter-grid .filter-search{grid-column:span 2}}
@media(max-width:991.98px){.student-filter-grid{grid-template-columns:repeat(2,1fr)}.student-filter-grid .filter-search{grid-column:span 2}.student-profile-hero,.page-heading{align-items:flex-start;flex-direction:column}.student-profile-hero .school-profile-actions{width:100%}}
@media(max-width:575.98px){.student-filter-grid{grid-template-columns:1fr}.student-filter-grid .filter-search{grid-column:auto}.student-profile-avatar{width:55px;height:55px;border-radius:17px}.page-heading .btn{width:100%}}

/* تمكين V1.3 - وحدة العاملين والتذييل العام */
.form-hint { margin-top:5px; color:var(--muted); font-size:8px; line-height:1.6; }
.age-preview { min-height:42px; border:1px solid var(--border); border-radius:11px; background:#f7fafb; padding:7px 11px; display:flex; flex-direction:column; justify-content:center; }
.age-preview strong { font-size:10px; color:var(--primary); font-weight:800; }
.age-preview small { color:var(--muted); font-size:7px; margin-top:2px; }
.staff-filter-grid { grid-template-columns:minmax(240px,1.5fr) repeat(4,minmax(145px,1fr)) auto; }
.skill-mini-list { display:flex; gap:5px; align-items:center; }
.skill-mini-list span { width:27px; height:27px; border-radius:9px; display:grid; place-items:center; color:var(--primary); background:var(--primary-soft); font-size:11px; }
.skill-cards { display:grid; grid-template-columns:repeat(2,1fr); gap:9px; }
.skill-card { min-height:82px; border:1px solid var(--border); border-radius:14px; background:#f7f9fa; color:#9aa8ac; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; font-size:9px; }
.skill-card i { font-size:20px; }
.skill-card.active { background:var(--primary-soft); border-color:#9bb8bd; color:var(--primary); font-weight:800; }
.staff-profile-hero { padding:24px; border-radius:21px; background:linear-gradient(115deg,#315f68,#244a51); color:#fff; display:flex; align-items:center; gap:16px; box-shadow:var(--shadow-md); }
.staff-profile-hero .profile-avatar { width:70px; height:70px; border-radius:22px; display:grid; place-items:center; background:rgba(255,255,255,.15); font-size:27px; flex:0 0 auto; }
.staff-profile-hero .profile-main { flex:1; min-width:0; }
.staff-profile-hero .profile-main h2 { margin:5px 0 4px; font-size:20px; font-weight:800; }
.staff-profile-hero .profile-main p { margin:0 0 9px; color:rgba(255,255,255,.7); font-size:9px; }
.staff-profile-hero .eyebrow { color:#f3dca9; background:rgba(255,255,255,.12); }
.profile-completion { width:145px; border-radius:16px; background:rgba(255,255,255,.12); padding:13px; text-align:center; }
.profile-completion strong { display:block; font-size:21px; }
.profile-completion > span { display:block; color:rgba(255,255,255,.7); font-size:8px; margin-bottom:7px; }
.profile-completion .progress-soft { background:rgba(255,255,255,.16); }
.profile-completion .progress-soft span { background:#f1d696; }
.details-grid { display:grid; grid-template-columns:repeat(4,1fr); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.details-grid > div { padding:12px 13px; min-height:59px; border-left:1px solid var(--border); border-bottom:1px solid var(--border); }
.details-grid > div.wide { grid-column:span 2; }
.details-grid > div.full { grid-column:1/-1; }
.details-grid span { display:block; color:var(--muted); font-size:8px; margin-bottom:5px; }
.details-grid strong { display:block; font-size:10px; line-height:1.7; }
.tone-red .stat-icon { background:#fae8e8; color:var(--danger); }
.tone-red .stat-trend { color:var(--danger); background:#fae8e8; }
.footer-credit { display:flex; flex-direction:column; align-items:center; line-height:1.6; color:var(--muted); }
.footer-credit strong { font-size:9px; color:var(--primary); }
.footer-credit small { font-size:7px; }
.login-credit { position:fixed; bottom:12px; left:50%; transform:translateX(-50%); z-index:2; text-align:center; color:#66797f; font-size:8px; line-height:1.7; white-space:nowrap; }
.login-credit strong { display:block; color:var(--primary); font-size:9px; }
@media(max-width:1399.98px){.staff-filter-grid{grid-template-columns:repeat(3,1fr)}.staff-filter-grid .filter-search{grid-column:span 2}}
@media(max-width:991.98px){.staff-profile-hero{align-items:flex-start;flex-wrap:wrap}.profile-completion{width:100%}.details-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:575.98px){.staff-filter-grid{grid-template-columns:1fr}.staff-filter-grid .filter-search{grid-column:auto}.details-grid{grid-template-columns:1fr}.details-grid > div.wide,.details-grid > div.full{grid-column:auto}.skill-cards{grid-template-columns:1fr}.login-credit{position:static;transform:none;margin-top:14px;white-space:normal}}

/* تمكين V1.3.1 - تحسين نموذج إضافة الطالب */
.required-data-panel { border:1px solid rgba(49,95,104,.28); box-shadow:0 10px 28px rgba(49,95,104,.08); }
.required-data-panel .panel-header { background:linear-gradient(90deg,rgba(49,95,104,.08),rgba(49,95,104,.02)); }
.required-checklist { display:grid; gap:8px; padding:12px; border-radius:13px; background:#f7fafb; border:1px solid var(--border); }
.required-checklist div { display:flex; align-items:center; gap:7px; color:var(--text); font-size:9px; font-weight:700; }
.required-checklist i { color:var(--success); }
.form-control.js-phone-11, .form-control.js-digits-only { direction:ltr; text-align:left; }
.was-validated .form-control:invalid, .was-validated .form-select:invalid { border-color:var(--danger); box-shadow:0 0 0 .18rem rgba(198,91,91,.12); }

/* تمكين V1.3.5 — نموذج الموظف الكامل */
.staff-form-page .panel { height: auto; }
.staff-form-section { scroll-margin-top: 105px; }
.form-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
}
.form-section-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
}
.form-section-nav a:hover { background: var(--primary); color: #fff; }
@media (max-width: 767.98px) {
    .form-section-nav a { flex: 1 1 calc(50% - 8px); justify-content: center; }
}

/* V1.3.6 — المستخدمون والصلاحيات */
.mini-stat-card{background:var(--card-bg,#fff);border:1px solid var(--border,#e2e8ea);border-radius:18px;padding:16px;display:flex;align-items:center;gap:13px;box-shadow:0 8px 24px rgba(30,55,60,.04)}
.mini-stat-card .stat-icon{width:44px;height:44px;border-radius:14px;background:rgba(49,95,104,.09);color:var(--primary);display:inline-flex;align-items:center;justify-content:center}
.mini-stat-card strong{display:block;font-size:22px;font-weight:800;color:var(--text)}
.mini-stat-card small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.table-person{display:flex;align-items:center;gap:10px}.avatar-sm{width:36px;height:36px;border-radius:12px;background:rgba(49,95,104,.1);color:var(--primary);display:inline-flex;align-items:center;justify-content:center;font-weight:800}.table-person strong,.table-person small{display:block}.table-person small{font-size:9px;color:var(--muted);margin-top:2px}
.scope-info-card,.password-hint{display:flex;align-items:flex-start;gap:12px;padding:14px;border-radius:15px;background:#f4f8f8;border:1px solid #deeaeb;color:var(--text)}.scope-info-card>i,.password-hint>i{width:34px;height:34px;border-radius:11px;background:rgba(49,95,104,.1);color:var(--primary);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}.scope-info-card strong,.scope-info-card small{display:block}.scope-info-card small,.password-hint span{font-size:10px;color:var(--muted);line-height:1.8}
.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--border,#e5ebed);border:1px solid var(--border,#e5ebed);border-radius:16px;overflow:hidden}.profile-grid>div{background:#fff;padding:15px}.profile-grid small,.profile-grid strong{display:block}.profile-grid small{font-size:9px;color:var(--muted);margin-bottom:5px}.profile-grid strong{font-size:11px;color:var(--text)}
.note-box{padding:14px;border-radius:14px;background:#fffaf0;border:1px solid #f0e4c9;font-size:11px;line-height:1.9}
.timeline-list{display:grid;gap:14px}.timeline-item{display:flex;gap:10px;align-items:flex-start}.timeline-item>span{width:9px;height:9px;border-radius:50%;background:var(--primary);margin-top:4px;box-shadow:0 0 0 5px rgba(49,95,104,.08)}.timeline-item strong,.timeline-item small{display:block}.timeline-item strong{font-size:10px}.timeline-item small{font-size:9px;color:var(--muted);margin-top:3px}
.role-card h3{font-size:14px;font-weight:800;margin-bottom:6px}.role-card p{font-size:10px;color:var(--muted);line-height:1.8;min-height:36px}.role-icon{width:44px;height:44px;border-radius:14px;background:rgba(49,95,104,.1);color:var(--primary);display:inline-flex;align-items:center;justify-content:center;font-size:17px}.role-meta{display:flex;flex-wrap:wrap;gap:8px}.role-meta span{background:#f6f8f9;border:1px solid #e8edef;border-radius:10px;padding:7px 9px;font-size:9px;color:var(--muted)}.role-meta i{color:var(--primary);margin-left:5px}
.permission-groups{display:grid;gap:22px}.permission-group{border-bottom:1px solid var(--border,#e5ebed);padding-bottom:20px}.permission-group:last-child{border-bottom:0;padding-bottom:0}.permission-group h4{font-size:12px;font-weight:800;color:var(--primary);margin-bottom:12px}.permission-card{height:100%;display:flex;align-items:flex-start;gap:10px;padding:13px;border:1px solid #e2e8ea;border-radius:14px;background:#fff;cursor:pointer;transition:.2s}.permission-card:hover{border-color:rgba(49,95,104,.45);background:#f8fbfb}.permission-card input{margin-top:4px;accent-color:var(--primary)}.permission-card strong,.permission-card small{display:block}.permission-card strong{font-size:10px}.permission-card small{font-size:9px;line-height:1.7;color:var(--muted);margin-top:3px}
.record-tabs{gap:8px}.record-tabs .nav-link{border-radius:12px;background:#fff;border:1px solid var(--border,#e2e8ea);color:var(--muted);font-size:10px;font-weight:700}.record-tabs .nav-link.active{background:var(--primary);border-color:var(--primary);color:#fff}.user-agent-text{font-size:9px;color:var(--muted)}
.status-pill.warning{background:#fff4dc;color:#99670f}.status-pill.danger{background:#fde9e9;color:#a43d3d}.status-pill.success{background:#e8f6ef;color:#287255}
@media(max-width:767.98px){.profile-grid{grid-template-columns:1fr}.mini-stat-card{padding:13px}}

/* V1.3.6.1 — وضوح نطاق المستخدم والحقول المطلوبة */
.scope-field-disabled {
    opacity: .62;
}
.scope-field-disabled .form-label,
.scope-field-disabled .text-muted {
    color: var(--muted-color, #78858b) !important;
}
.required-summary {
    background: #f4f8f9;
    border: 1px solid #dce7e9;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.8;
}
.required-summary ul {
    padding-right: 18px;
}
#userAccessPanel {
    border: 1px solid rgba(49, 95, 104, .18);
}


/* V1.3.6.4 — إصلاح تخطيط نموذج المستخدم وصلاحية الحذف */
.user-form-page {
    display: block;
    width: 100%;
}
.user-form-page > .row {
    align-items: flex-start;
}
.user-form-page .panel {
    height: auto;
}
.user-form-page #userAccessPanel,
.user-form-page #userAccountPanel {
    margin-bottom: 16px !important;
}
.user-form-page .form-side-panel .panel {
    height: auto;
}
.permission-card.permission-danger {
    border-color: rgba(198, 91, 91, .28);
    background: #fffafa;
}
.permission-card.permission-danger:hover {
    border-color: rgba(198, 91, 91, .65);
    background: #fff5f5;
}
.permission-card.permission-danger strong {
    color: #a43d3d;
}
.table-actions .btn-icon.danger {
    color: var(--danger);
    border-color: rgba(198, 91, 91, .25);
    background: #fffafa;
}
.table-actions .btn-icon.danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}
.app-footer {
    flex-shrink: 0;
}

/* V1.3.6.6 — تثبيت تذييل صفحة ملف المستخدم أسفل جميع البطاقات */
.user-view-page {
    display: block;
    width: 100%;
}
.user-view-page > .row {
    align-items: flex-start;
}
.user-view-page .user-view-card,
.user-view-page .panel {
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
}
.user-view-page .col-xl-8,
.user-view-page .col-xl-4 {
    min-height: 0;
}

/* V1.3.7 - Settings */
.settings-year-form { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: #f8fbfb; }
.settings-year-form .switch-card { min-height: 70px; }
.settings-year-form .switch-card label { height: 100%; }
#academic-years .data-table td, #academic-years .data-table th { vertical-align: middle; }
.status-pill.info{background:#eaf3f8;color:#356d88}
